Even, I found an example in the jq Cookbook of doing it with nothing other than jq.
https://github.com/stedolan/jq/wiki/Cookbook#convert-a-csv-file-with-headers-to-json The "sed for JSON" tagline is pretty accurate! On Sun, Dec 17, 2017 at 2:03 PM, Even Rouault <[email protected]> wrote: > On lundi 18 décembre 2017 09:36:10 CET Jeremy Palmer wrote: > > > I have a table without a geometry field and would like to create a simple > > > JSON file containing property key-pairs values without the GeoJSON > schema. > > > Is this possible with ogr2ogr? > > > > Jeremy, > > > > Given test.csv > > > > id,val > > 1,100 > > 2,200 > > > > > > $ ogr2ogr -f geojson /vsistdout/ test.csv -oo AUTODETECT_TYPE=YES | jq > "[.features[].properties]" > > > > [ > > { > > "id": 1, > > "val": 100 > > }, > > { > > "id": 2, > > "val": 200 > > } > > ] > > > > > > Even > > > > -- > -- Sean Gillies
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
