Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jts-dev] Recutting pole-wrapping polygons

My best guess about this is to cut the polygon into two pieces via a meridian line running from [-180, -90] thru the N pole [0, 90] back down to the S pole [0, -90].  But you can't do this as a planar geometric operation, because the "polygon" is not a valid 2D geometry.  However, it should be possible to do this by finding the segments which cross the splitting line and constructing the intersection points.  

If the polygon crosses the splitting meridian more than twice then it's harder, of course...

On Tue, Dec 5, 2017 at 10:46 AM, David Smiley <david.w.smiley@xxxxxxxxx> wrote:
Hello JTS community,

Lets say somehow I obtain a polygon that encloses the North pole. I have a sequence of consecutive points with their latitude and longitude in decimal degrees. I'd like to represent this as a valid geometry in JTS assuming plate-carre decimal degrees rectangular area (+/- 180, +/- 90).  Does anyone know of an algorithm / some code that does this?  I suspect it's already been done in open-source somewhere but it if not I'll think up an algorithm.

FYI Spatial4j's JtsGeometry has code that can handle dateline (anti-meridian) crossing, but not polygons enclosing a pole.

~ David
--
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker

_______________________________________________
jts-dev mailing list
jts-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/jts-dev



Back to the top