Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a number of Shape files from a customer. I can read them with both ogrinfo and QGIS. They don't have a prj-file, but I know that the projection is EPSG:3006.

When I add them as layers in Geoserver, I declare the projection to be EPSG:3006 in the box "Declared SRS" by inputing "EPSG:3006". I set "SRS Handling" to be "Force declared". (It makes no difference if I add a .prj-file with a projection definition.) I can then calculate the bounds successfully.

When I try to preview the layer in Openlayers, I get an empty map. When I try to load the layer as WFS, I get an empty result.

There are no error messages in the logs as far as I can see. I have tried to change the log level.

If I run ogr2ogr and save them as new shape files, they work in Geoserver. If I export them to a new shape file from QGIS, they work in Geoserver.

Is there a way I can use ogr or QGIS to show my customer what the problem is?

share|improve this question
how do you "declare the projection to be EPSG:3006"? – iant Jun 3 '13 at 15:31
I edited my question to expand on this. Short version: I use the Declared SRS box. – Peter Thorin Jun 4 '13 at 5:54
can you post the ogrinfo output – iant Jun 4 '13 at 7:18
Unfortunately not since it is customer specific data. – Peter Thorin Jun 4 '13 at 8:57
up vote 1 down vote accepted

Turns out the problem was that in the original file, record numbers start at 0. Geotools (used by Geoserver) doesn't like this, since the specification states that record numbers start at 1.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.