drolbr / Overpass-API

A database engine to query the OpenStreetMap data.
http://overpass-api.de
GNU Affero General Public License v3.0
710 stars 90 forks source link

Output filename #153

Open pierzen opened 9 years ago

pierzen commented 9 years ago

Overpass query output files are actually named Interpreter (at least in Windows). To better document these outputs, I propose that the filename corresponds to the output type. For example, overpass.xml, overpass.csv, etc.

A outputfile parameter could also be added. This would facilitate the production of scripts with various outputs. An other example is with the various humanitarian actions where we offer Overpass url links to query for various OSM layers. A filename that clearly describes the output would be welcomed.

drolbr commented 9 years ago

I support the idea in general to have a meaningful file suffix. However, I'm not sure if there is a standard conforming way to do this from the server. The last say about the filename has usually the browser.

mmd-osm commented 9 years ago

RFC6266 has some details on the Content-Disposition Header Field, which could be used for that purpose.

Example:

    cout<<"Content-Disposition: inline; filename=overpass.csv\n";

BTW: Letting the user provide some arbitrary filename without further sanitation checks is usually a bad idea, as it introduces security risks (see security considerations in chapter 7 + stackoverflow)

@pierzen: Download tools like wget let you define any output file name using parameter -O.

pierzen commented 9 years ago

there is effectively no problem scripting with wget. For the Ebola Activation, we offer Overpass Service extracts to the humanitarians in the field. For the less techy users, it is not very intuitive to have a file named interpreter like at least in Windows. Some extract link at https://wiki.openstreetmap.org/wiki/2014_West_Africa_Ebola_Response#Custom_Exports_.28to_be_rerun_at_any_time.29