wavded / ogre

ogr2ogr geojson-focused web client
http://ogre.adc4gis.com
MIT License
266 stars 79 forks source link

expose Content-Disposition header; and add extra param to name shp files in zip #45

Closed btfou closed 9 years ago

btfou commented 9 years ago

Two updates:

One: add res.header('Access-Control-Expose-Headers', 'Content-Disposition') to enableCors. When using xhr the POST request will fail because the preflight and POST headers don't match if modifying the request headers of the xhr POST. This resolves the issue and relieves the need to set the Access-Control-Expose-Headers header of the POST.

Two: Add additional fileName check/param to convertJson to set the filenames of the .shp file and friends.

wavded commented 9 years ago

Thanks @btfou, looks good (I didn't know about that nln option, that's sweet!).

btfou commented 9 years ago

@wavded I noticed this merge caused the is geojson test to fail. I'm not sure why since that's a convert test and not a convertJson test. Something to do with Access-Control-Expose-Headers addition to CORS?

Something else that came to mind was additional endpoints that would: 1) convert any format to another format; and 2) GeoJson to any format. The upload and json / jsonUrl params would be the same respectively, and a options param that would be a stringified hash of ogr2ogr options http://www.gdal.org/ogr2ogr.html to be parsed and push key:value pairs to an options array. Essentially allowing full control of GDAL/ogr2ogr via orge and ogr2ogr.