Thanks Both.

On Mon, Dec 18, 2017 at 10:58 AM, Sean Gillies <[email protected]> wrote:

> 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!
>

 jq is definitely very cool. My workflow is a little more complex, than
reading a CSV file as I'm converting from from a WFS endpoint and doing a
transformation with SQL. e.g:

ogr2ogr -f GeoJSON /vsistdout WFS:"
https://data.linz.govt.nz/services;key=$API_KEY/wfs/layer-51572"; -dialect
sqlite -sql "SELECT id, lease_name AS name,
ST_Y(ST_Transform(ST_Centroid(geometry), 4326)) || ', ' ||
ST_X(ST_Transform(ST_Centroid(geometry), 4326)) AS latlon FROM
\"data.linz.govt.nz:layer-51572\"" | jq "[.features[].properties]"

Cheers
Jeremy
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to