Closed btfou closed 9 years ago
Thanks @btfou, looks good (I didn't know about that nln
option, that's sweet!).
@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.
Two updates:
One: add
res.header('Access-Control-Expose-Headers', 'Content-Disposition')
toenableCors
. 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 theAccess-Control-Expose-Headers
header of the POST.Two: Add additional
fileName
check/param toconvertJson
to set the filenames of the .shp file and friends.