I've the following WFS GetFeature request...


... and the response (that you can try ....), give me a GML response that I can use in a GIS Desktop.

I need to invoke this, and several other services like it, from command line and save the responses in files: any suggestions (curl? wget? other?) and samples on how to do it?

  • 2
    Hint: when you test, add &MaxFeatures=2 to your request. You can save your time and resources of the server. Once everything works drop the MaxFeatures and read the whole dataset.
    – user30184
    Dec 26, 2014 at 22:07

1 Answer 1


To save this response in a gml file you can do the following:

curl http://map.sitr.regione.sicilia.it.... -o ~/Desktop/test.gml

(I was not able to get your url to work)

  • Thanks for the reply. I've tried your suggestion using Cygwin but it gives me an error "-bash: -o: command not found" ..... The request it's quite "heavy": have you tried it in a browser? I'm using Chrome and it's working but you've to wait for the response
    – Cesare
    Dec 26, 2014 at 21:35
  • hmm, on OSX so not sure how it works on a non-unix environment. The -o filename.gml just stores the output. What do you get when you type curl --help
    – djq
    Dec 26, 2014 at 21:51
  • 1
    This works for me on Windows 7: curl "http://map.sitr.regione.sicilia.it/ArcGIS/services/CART_2000/Numeri_Civici/GeoDataServer/WFSServer?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=CART_2000:NumeriCivici_88006_Modica&SRSNAME=EPSG:3004&MaxFeatures=2" -o test.gml
    – user30184
    Dec 26, 2014 at 22:10
  • I noticed that it can be important to put the full WFS URL in quotation marks, else the shell may misinterpret the command. E.g., curl "http://geodata.nationaalgeoregister.nl/inspire/ps-natura2000/wfs?request=GetFeature&typeName=ps-natura2000:ProtectedSite&outputFormat=json" -o file.geojson Nov 21, 2020 at 5:44

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.