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.

taudorf
1,6652 gold badges16 silver badges29 bronze badges
asked Jul 7, 2011 at 8:42
0

3 Answers 3

4

Use WFS with output format set to shape.

answered Jul 7, 2011 at 11:02
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

Stephen Lead
21.3k18 gold badges117 silver badges245 bronze badges
answered Aug 26, 2014 at 5:31
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). 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.

Fezter
22k11 gold badges72 silver badges128 bronze badges
answered Sep 26, 2017 at 13:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.