[gdal-dev] Regarding geometry layer creation options

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Mon Dec 9 02:01:25 PST 2019


Hi,

Have you tried with the syntax that is used in an example in the CSV
documentation https://gdal.org/drivers/vector/csv.html?

"This example shows using ogr2ogr to transform a shapefile into a .csv file
with geography field formatted using GeoJSON format."

ogr2ogr -f CSV -dialect sqlite -sql "select AsGeoJSON(geometry) AS geom, *
from input" output.csv input.shp

-Jukka Rahkonen-



Ravi Teja Krishna Wuyyuru wrote
> Hello Gdal team,
> 
> 
> 
> Iam using ogr2ogr tool for .shp or .geojson. or .kml to .csv conversion.
> But i want the Geometry to be as collections as show below. ( On giving
> GEOMETRY=AS_WKT iam getting in a normal format is there any option to get
> in the format i need )
> 
> 
> 
> format I need : { "type": "Polygon", "coordinates": [ [ [ 76.612, 33.173
> ], [ 76.64, 33.162 ], [ 76.709, 33.181 ] ] ] } 
> 
>                         or  atleast to have it in this format is aceptable
> for us POLYGON (([76.612 , 33.173],[76.64 , 33.162],[76.709 , 33.181])) 
> format iam getting :  POLYGON ((76.612 33.173,76.64 33.162,76.709
> 33.181)) 
> 
> 
> 
> Thanks.
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list