[Geoserver-users] Problems with geoserver when using world coastline shape file

Hi All,

I’m using geoserver for an application and I have a problem when using a certain shape file.
The shape file that I’m using is the processed_p.shp file that is used in OpenStreetMaps as world coastlines (http://hypercube.telascience.org/~kleptog/).
When I select this shape file as datasource and show this map using the demo page the map is shown but I get a lot of errors in the log file. There are two types of errors. These are:
- ERROR [geotools.rendering] - Number of points must be 0 or >3 java.lang.IllegalArgumentException: Number of points must be 0 or >3

  • WARN [data.shapefile] - only one hole in this polygon record
    What do these error message mean and how do I solve it?

I also tried importing the shape file in postgis and then using this as datasource. This causes slightly different problems. When looking at the map via the demo page I do not see the intire map only a small portion of Alaska and the west coast of the US. When I inspect the log file there are a lot of these error messages: ERROR [geotools.rendering] - Number of points must be 0 or >3 java.lang.IllegalArgumentException: Number of points must be 0 or >3. I also tried disabeling the the WKB option. Now when I look at the map it shown although it is very slow. The log file still writes the above mentioned error messages.

Of course I suspected the shape file at first but I have no problem displaying the file in several GIS viewers so I ruled that out.
Can anyone help me with this?

Some technical details:
Geoserver version: 1.7.4 (I tried both the standalone as well as the web archive version.)
OS: Linux Suse 10.3
Client: OpenLayers ( as supplied with geoserver).

Thanks in advance!

Regards,

Pascal Blij

Hi,

It was long time ago when I imported these coastlines into PostGIS and I may remember it wrong. Anyway, I have a feeling that those errors did not prevent using the data. They are real topological errors that make those certain polygons unusable, but the rest should work OK. The "three point error" comes from a kind of polygons made out of points A and B like A-B-A, "from here to there and back". Result is much like a straight line without area. Another error comes from polygons which have only inner rings, holes, but not the outer ring. I believe those features are just skipped and they are not dangerous. Correct them in OpenStreetMap if you want to get rid of them. PostGIS function IsValid() helps to locate the erratic features. It is rather a big dataset and therefore slow. If you feel it is extraordinary slow compare the speed of PostGIS with shapefiles and think if spatial index is OK.

-Jukka Rahkonen-

Blij, Pascal wrote:

Hi All,

I'm using geoserver for an application and I have a problem when using a
certain shape file.
The shape file that I'm using is the processed_p.shp file that is used
in OpenStreetMaps as world coastlines
(http://hypercube.telascience.org/~kleptog/).
When I select this shape file as datasource and show this map using the
demo page the map is shown but I get a lot of errors in the log file.
There are two types of errors. These are:
    - ERROR [geotools.rendering] - Number of points must be 0 or >3
java.lang.IllegalArgumentException: Number of points must be 0 or >3
    - WARN [data.shapefile] - only one hole in this polygon record
What do these error message mean and how do I solve it?

I also tried importing the shape file in postgis and then using this as
datasource. This causes slightly different problems. When looking at the
map via the demo page I do not see the intire map only a small portion
of Alaska and the west coast of the US. When I inspect the log file
there are a lot of these error messages: ERROR [geotools.rendering] -
Number of points must be 0 or >3 java.lang.IllegalArgumentException:
Number of points must be 0 or >3. I also tried disabeling the the WKB
option. Now when I look at the map it shown although it is very slow.
The log file still writes the above mentioned error messages.

Of course I suspected the shape file at first but I have no problem
displaying the file in several GIS viewers so I ruled that out.
Can anyone help me with this?

Some technical details:
    Geoserver version: 1.7.4 (I tried both the standalone as well as the
web archive version.)
    OS: Linux Suse 10.3
    Client: OpenLayers ( as supplied with geoserver).

Thanks in advance!

Regards,

Pascal Blij

Blij, Pascal ha scritto:

Hi All,
I'm using geoserver for an application and I have a problem when using a certain shape file.
The shape file that I'm using is the processed_p.shp file that is used in OpenStreetMaps as world coastlines (http://hypercube.telascience.org/~kleptog/).
When I select this shape file as datasource and show this map using the demo page the map is shown but I get a lot of errors in the log file. There are two types of errors. These are:
/ - ERROR [geotools.rendering] - Number of points must be 0 or >3 java.lang.IllegalArgumentException: Number of points must be 0 or >3/
    - WARN [data.shapefile] - only one hole in this polygon record
What do these error message mean and how do I solve it?

I downloaded the same file and loaded it with the current GeoServer
1.7.x nightly build, had no issues to display it, no errors in
the log (at default logging level). What I did:
- downloaded http://hypercube.telascience.org/~kleptog/processed_p.zip
- configured the shapfile in GeoServer forcing the 900913 projection
   and using the "polygon" style
- went in the preview.. no issues. I've attached a screenshot of
   what I get.

Soo... not sure why it's not working for you.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

coastlines.png