Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to turn a country's irregular border inside out (Win 10, 64-bit)?

  1. #1
    Guild Novice Rock's Avatar
    Join Date
    Jul 2018
    Location
    Little Rock, Arkansas USA
    Posts
    12

    Question How to turn a country's irregular border inside out (Win 10, 64-bit)?

    This question falls under several categories {software, computer graphics, graphic design, art, cartography, geographic information, mathematical transforms}, but the software (specifically for Windows 10 [64-bit]) to perform this function is what I'm seeking.

    I'm trying to shift geometric figures (specifically the borders of a political or geographic area) across a sphere:
    Sleeve-transform on genus 0 topology.png
    As you can see from the picture above, all points are meant to follow meridional paths, stretching the figure outward _around_ the surface's radial slices like an embedded rubber band until it crosses a great circle, then contracting back down to its original size a the far end of the sphere (so that the figure is now turned inside out).

    Basically, it's a question of flipping a figure's borderline radial distances around its mean radius (everting dents and inverting bulges). I know what I want, but I don't know how to get there.

    It's clearly not a rotation, translation (in the usual sense of being identical to a rotation), reflection (though that's close), scale, shear, or skew. The closest terminology that I've imagined so far is a "sleeve-transform on genus 0 topology", but I haven't found the right terms for a decent Google search on the underlying mathematical techniques with which to approach the transform.

    Right now, I'm doing it by hand -- finding the inscribing and circumscribing circles, taking the centroid as a locus from which to measure the edge-coordinates, and flipping the annulus of circles around the mean annular radius. A pain in the ass, but functional for figures that contain their centroid within their boundary (simple polygons are easy, but not something complex like a country's border, and definitely no good for figures with an external centroid (e.g.: the majuscule letter "F", or a sans serif minuscule "f").

  2. #2
    Guild Grand Master Azélor's Avatar
    Join Date
    Jul 2008
    Location
    Québec
    Posts
    3,363

    Default

    There are software to convert map projection but I m not sure this is what you are trying do?

    The Earth is a spheroid and what your want is to move a contry from one place to the other to see how it will look?

  3. #3
    Guild Novice Rock's Avatar
    Join Date
    Jul 2018
    Location
    Little Rock, Arkansas USA
    Posts
    12

    Info Moving countries to engulf spheroidal surfaces, and shrink back down

    Precisely that, Azélor. I wish to do so primarily for a dice-based RPG, though possibly also for some fictional writing.

    I can easily slide them across the surface from one place {x1, y1} to another {x2, y2}, but that's only by a simple motion of all points in the same direction and distance:
    {x1, y1 -> x1.a, y1.a -> x1.b, y1.b -> ... -> x1.n, y1.n -> ... -> x2, y2}, or the same process in polar coordinates, of course:
    {r1, θ1 -> r1.a, θ1.a -> r1.b, θ1.b -> ... -> r1.n, θ1.n -> ... -> r2, θ2}.

    "Exploding" the figure outward from its own centerpoint, expanding it until it passes the Earth's spheroidal maximum (e.g.: equator or any other maximal cross-section), and continuing onward to shrink back down to its original size (though now turned inside out)... yeah, that part isn't so easy.

    Since this isn't for any rigorous scientific pursuit, the results don't need to be extremely accurate, just decently close. Of course, "accurate" is a relative term, since this would necessarily warp the boundaries' curvatures and radial distances. I can do it by hand, but the results are clunky, awkward, and ugly -- mostly because I'm only taking sections of borderline and bending them in the other direction, then sticking them back together.

  4. #4

    Default

    Hmm... So fundamentally the operation could be described helpfully by, for a closed figure F, finding the figure F' such that for any point f on the border of F, the corresponding f' on the border of F' is located on the outside of the circumscribing circle of F, the same distance from said circle as f was from it on the inside?

    Or described differently, in 2D: find the circumscribing circle of the figure, then translate every point of the shape radially outwards by 2*d, where d is the shortest distance from that point to the circumscribing circle? Could you perform this operation in 2D and then project the resulting figure onto the sphere centered on that opposite centroid from the original one? That seems like it would accomplish what I think you're aiming for (I'm not 100% following all the terminology you use), and wouldn't be too onerous to automate, I think. It certainly seems like a method that would apply to the pictured example, although it only really would apply this simply if the operation is always a 'complete' flip (that is, the final circle it is projected relative to is always the same radius as the original circumscribing circle).

    In other words, would it correctly describe the transformation you're looking for to:
    1) Project the figure from the sphere onto a 2D surface centered on its circumscribing circle C.
    2) Move all points of the figure radially outwards until they are as far from the perimeter of C on the outside as they started from it on the inside.
    3) Project this back onto the sphere on the pole opposite the pole the original projection was centered on?

    If this does describe the transform you're going for, I think it would also work for the non-internal centroid cases, unless you're defining the transform you want such that the interior of the figure must 'go around' the sphere in the process (in other words, even figures with non-internal centroids must be turned inside-out). If that is the case this method probably isn't correct.

    EDIT: This is your original image annotated to show the pattern the above steps would correspond to:
    Sleeve-transform on genus 0 topology-Annotated.png
    Last edited by AzureWings; 07-09-2018 at 06:43 AM.

  5. #5
    Guild Novice Rock's Avatar
    Join Date
    Jul 2018
    Location
    Little Rock, Arkansas USA
    Posts
    12

    Post

    Yes, the process as you describe it is exactly in accord with what I have in mind:

    1) Project the figure from the sphere onto a 2D surface centered on its circumscribing circle C;
    2) Move all points of the figure radially outward until they are as far from the perimeter C on the outside as they started from it on the inside;
    3) Project this back onto the sphere [on the pole opposite the pole the original projection was centered on].

    Note that it needn't be at the antipodal pole, it's just that that was the easiest way that I could think of describing things. It's only the eversion itself that I'm concerned with.

    Sleeve-transform on genus 0 topology -- non-internal centroid.png

    In the figure above, the island with an overall C-shape and a J-inlet has a centroid that isn't within its landmass boundary, just the circumscribing circle. When everted, the C-shape remains pretty much unaffected in overall shape (only the "inner" and "outer" coastlines swap places, aside from their size-change), but its J-inlet is severely affected (now having become a J-peninsula).

    I have a simultaneous post of the same question over at Stack Exchange, and so far someone commented on the possibility that Blender might be up to the task, but that's about it so far. (I'm already learning AutoREALM & Inkscape, and have Paint.net, GIMP & Krita, so adding and trying Blender wouldn't be much of a stretch.)

  6. #6
    Guild Grand Master Azélor's Avatar
    Join Date
    Jul 2008
    Location
    Québec
    Posts
    3,363

    Default

    What I don't understand is how this will help you making a map.

    Basically, it seems like you want something to allow you to move the country shapes around to see what they look like placed at area on a sphere.

  7. #7
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,610

    Default

    Try generating a stereographic projection at your desired circle's center, inverting with respect to your desired circle, and then an inverse stereographic to get back to your spherical projection. It's the precise steps that you described, but you should be able to get all of the components that you need (with the possible exception of the invert step, which is easy to code up) using standard GIS tools. I'm certainly no mathematician, but something in the dark reaches of my brain was muttering something about "inverting a Riemann sphere". This term may mean something to the more mathematically inclined, but it's far too early in the morning for my conscious brain to make much of it.

    What data do you want to do this to? Is it a raster image or a set of vector data?

  8. #8
    Guild Member Runninghead's Avatar
    Join Date
    Oct 2016
    Location
    Earth
    Posts
    87

    Default

    Quote Originally Posted by waldronate View Post
    Try generating a stereographic projection at your desired circle's center, inverting with respect to your desired circle, and then an inverse stereographic to get back to your spherical projection. It's the precise steps that you described, but you should be able to get all of the components that you need (with the possible exception of the invert step, which is easy to code up) using standard GIS tools. I'm certainly no mathematician, but something in the dark reaches of my brain was muttering something about "inverting a Riemann sphere". This term may mean something to the more mathematically inclined, but it's far too early in the morning for my conscious brain to make much of it.

    What data do you want to do this to? Is it a raster image or a set of vector data?
    Not sure how useful this might be but Cinema 4D has some excellent tools for managing projections on globes- might go something like...
    Make spline from country coastline > Project Spline on to Sphere Primitive, etc.


    Sent from my iPad using Tapatalk

  9. #9
    Guild Novice Rock's Avatar
    Join Date
    Jul 2018
    Location
    Little Rock, Arkansas USA
    Posts
    12

    Default

    Not move them around precisely, more a plan to turn them inside out.
    What doesn't kill me just p*sses me off... 😉

  10. #10
    Guild Novice Rock's Avatar
    Join Date
    Jul 2018
    Location
    Little Rock, Arkansas USA
    Posts
    12

    Default

    Inverting a stereographic projection is a perfect description (and yes, the Riemann sphere analogy is exactly on spot) -- I love it. :-) Now I just need to find software for that approach.

    Right now I've only worked with raster, but I'm perfectly willing to try vector data sets (and know where I could get them, already).
    What doesn't kill me just p*sses me off... 😉

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •