On Sun, May 1, 2011 at 7:09 AM, Shane StClair <[email protected]> wrote:
> Hi,
> I have some geometries that straddle the antimeridian (180/-180 longitude).
> I enabled continuous wrapping as explained in this post:
> http://geo-solutions.blogspot.com/2010/02/geoserver-continuous-map-wrapping.html
> ...but was still struggling with them for a while until I shifted one side
> of the longitudes to match the sign of the other. This properties file gives
> example geometries:
> _=id:Integer,name:String,location:Geometry:srid=4326
> test.1=1|Clockwise|POLYGON((-179 68,-179 67,179 67,179 68,-179 68))
> test.2=2|Counterclockwise|POLYGON((-179 65,179 65,179 64,-179 64,-179 65))
> test.3=3|Clockwise Shifted|POLYGON((-179 62,-179 61,-181 61,-181 62,-179
> 62))
> test.4=4|Counterclockwise Shifted|POLYGON((-179 59,-181 59,-181 58,-179
> 58,-179 59))
> The original geometries (1 and 2) stretch across the earth in the wrong
> direction, while the shifted geometries properly sit across the antimeridian
> (3 and 4). Ring orientation didn't affect the result.
> Is the best practice for serving this data via GeoServer to shift the
> longitudes so that they are all of the same sign (e.g. with the
> PostGIS ST_Shift_Longitude function)? Or am I missing another way?

When I developed continuous wrapping I was indeed provided with data that
had points shifted to all match the same sign.

The wrapping code is really just a set of heuristics that can break under
certain conditions (e.g., if you have a polygon that's crossing the
anti meridian but it's huge and also gets very close to Greenwich the
results might be odd).

If you want to try and improve the existing code, it's all handled by
a set of classes that does
pre-process the geometries before they are reprojected and painted in
the geotools renderer:
http://svn.osgeo.org/geotools/trunk/modules/library/render/src/main/java/org/geotools/renderer/crs/

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to