[gdal-dev] ogr2ogr CircleByCenterPoint convert problem

Even Rouault even.rouault at spatialys.com
Fri Mar 11 01:37:14 PST 2016


Le vendredi 11 mars 2016 10:28:43, Zakrzewski Stefan a écrit :
> Hi Everyone.
> 
> For several days I try to convert GML file for SHP. It contains objects in
> three geometry types: point, linear and polygon. They are located on
> several layers, each of which may contain all types of geometry. Some of
> polygon features are stored as CircleByCenterPoint.
> 
> After download GDAL 2.02 I've used this command:
> ogr2ogr -f "ESRI Shapefile" "file.shp" "file.gml" -overwrite -skipfailures
> -splitlistfields -where OGR_GEOMETRY='Polygon' -nlt CURVE_TO_LINEAR

I suspect this will not do what you intend. The -where OGR_GEOMETRY='Polygon'  
is applied *before* conversion of curves to linear geometries.
So either modify your where clause to select the curve geometries you want 
(you can use the OR boolean operator ), or do the filtering in a second stage 
by first outputing to let's say a temporary Spatialite and then convert to 
shape

> 
> For one layer in GML file ogr2ogr has made polygon features for circles,
> but for another completely not. I have checked twice and GML feature
> members in both layers are the same.

If your GML file has several layers, your above method will not merge them into 
a single shapefile.

You could do a ogr2ogr temporary_shp_directory file.gml [....]

and then merge all the shapefiles in temporary_shp_directory into a single one 
by using ogr2ogr / ogr2ogr -append

> 
> I've tried use CURVEPOLYGON, CIRCULARSTRING and got no polygons for Circles
> in shape file.
> 
> Any hints?
> 
> Regards
> Stefan

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list