Mercator projection world map with Geoserver and Openlayers
Asked Answered
E

1

6

I'm trying to render a world map shapefile on my Geoserver with a Mercator projection. I've tried declaring the SRS on Geoserver and defining EPSG projections of 3785 or 900913 in Openlayers with no success. I've also tried to reproject the shapefile using ogr2ogr but the result is slightly off.

Original:Original

Converted: alt text

Here's the command used:

ogr2ogr -t_srs EPSG:3785 target.shp source.shp

I'm new to this technology & mapping concepts. Any pointers would be greatly appreciated!

Existentialism answered 16/12, 2010 at 17:50 Comment(1)
The wraparound is caused by the Asia shape crossing the International Dateline, and then being reprojected - there's probably a modulo in proj4js or OGR which is ensuring coordinates are in range, but upsets the wraparound.Tetryl
K
7

The geoserver pointer for this is continuous map wrapping.

In geoserver 2.0.1+ and above this problem can be resolved by starting geoserver with the following JVM options:

-DADVANCED_PROJECTION_HANDLING=true -DUSE_STREAMING_RENDERER=true

In the upcoming geoserver 2.1.X, this settings are turned on by default.

example image of a map projected in epsg:900913

https://static.mcmap.net/file/mcmap/ZG-Ab5ovKx9QWnzQWmYvX1Mea13QWRft/_0_xIiXP5xuY/S34-EuJPxAI/AAAAAAAAAKQ/Ez1_aMsRcHg/s1600/continents_900913.png

more info: http://geo-solutions.blogspot.com/2010/02/geoserver-continuous-map-wrapping.html

Kenishakenison answered 11/1, 2011 at 13:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.