[gdal-dev] OGR GeoJSON output

Sean Gillies sean at mapbox.com
Sun Dec 17 13:58:27 PST 2017


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 <even.rouault at spatialys.com>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171217/d9e8207b/attachment.html>


More information about the gdal-dev mailing list