[gdal-dev] ogr2ogr zfield behavior

Even Rouault even.rouault at spatialys.com
Tue Jan 12 12:51:39 PST 2016


Le mardi 12 janvier 2016 21:23:28, Fde_G . a écrit :
> Hi, whats the default behaviour of ogr2ogr when zfield specied unexistent
> field? 

As you experienced it was silently ignored and using the original geometry 
(but wrongly setting the geometry type to 25D). I've now added a warning in 
case the field is missing (and didn't modify the geometry type).

> I try run:
> ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=database
> password=postgres" -zfield fakeField file.shp file.shp with fields:param1
> : textparam2 : integerparam3 : geom (X Y Z) Testing, I can see that the
> shp is imported to the database, creating a table with geometry type
> GeometryZ with the correct Z value included in geom... gdalinfo
> --versionGDAL 1.10.1, released 2013/08/26
> postgis version:"POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921"
> PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26"
> LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER" postgres version:"PostgreSQL
> 9.3.10 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu
> 4.8.2-19ubuntu1) 4.8.2, 64-bit"

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


More information about the gdal-dev mailing list