2
votes

I am having trouble displaying country borders properly in GeoServer, as you can see from the link below (map of Italy).

http://trideg.server.de/tridec/wms?service=WMS&version=1.1.0&request=GetMap&layers=tridec:static_hasc_regions&styles=&bbox=489196.9,4109254.4,2426416.9,5987770.7&width=775&height=330&srs=EPSG:900913&format=application/openlayers&viewparams=codes%3A%27IT%27

The problem occurs with country boundaries which have very sharp edges (I assume), e.g. the shape of Albania shows correctly:

http://trideg.server.de/tridec/wms?service=WMS&version=1.1.0&request=GetMap&layers=tridec:static_hasc_regions&styles=&bbox=489196.9,4109254.4,2426416.9,5987770.7&width=775&height=330&srs=EPSG:900913&format=application/openlayers&viewparams=codes%3A%27AL%27

I obtained the ESRI shapefile from naturalearthdata.com and used ogr2ogr to transfer them in a database, which GeoServer uses as a datasource and created a layer in it.

Anyone has a lead? Either I missed something in the layer configuration (the projections are alright though, as the shapes are positioned correctly in the map), or ogr2ogr messed up the data during the conversion.

1
The data is returned this way from the server, OpenLayers renders it as an image it and can do nothing to "fix" it (or, to put it other way, it actually displays it correctly). Looks like the data (or geoserver configuration) is wrong after all. You may try asking for more details on gis.stackexchange.com, you're more likely to get GIS-specific help. - kryger
Okay, this is a GeoServer question then. I just checked and even when I use the "image/jpeg" format in the URLs above, GeoServer returns an image which has the same problem. - Genti Saliu

1 Answers

1
votes

This looks like the common problem that is caused by how different products create polygons. Some products insist that the first and last point of a polygon must be the same co-ordinate whereas other products will automatically close the polygon from the last co-ordinate to the first.

From the Geoserver documentation it requires that polygons have the same first and last co-ordinate. I would recommend that you edit the polygons in the shape file to accomplish this.

You could use ArcMAP, Quantum GIS or FME off the top of my head to do the conversion.