4

I have developed a web application where i am using GeoServer and OpenLayers. I have displayed some Layers over Google map in a ASP.Net Web Page. I want to know is there any Method or Script available in OpenLayers for downloading and saving shapefile (the shapefile which is displayed over Google map in Web page) from web interface.

Actually the user wants to download the shapefile from Web interface and open it in his Dektop GIS (ArcView) system.

0

3 Answers 3

4

Use WFS with output format set to shape.

2

Append &outputformat=SHAPE-ZIP to the request, as in this example (replace the ws_world:world_cities with ur workspace and layer)

http://hostname.com/geoserver/ws_world/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ws_world:world_cities&maxfeatures=50&outputformat=SHAPE-ZIP

1
  • This works really well to get the files. One thing to note, this does not get the original files. I believe it gets the projected files. So if the original files had a different SRS than the decalred SRS. It will use the declared SRS (if forced).
    – Kalel Wade
    Commented May 26, 2015 at 19:33
0

Do you perhaps have any reference examples for this? As soon as I edit my WFS output format from 'outputFormat=application/json' to 'outputFormat=shape' it drops the layer completely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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