[gdal-dev] GML / NAS code redundancy

Even Rouault even.rouault at mines-paris.org
Sun Apr 6 03:52:34 PDT 2014


Hi Martin,

> 
> 2014-04-05 23:50 GMT+02:00 Even Rouault <even.rouault at mines-paris.org>:
> > Done. See http://trac.osgeo.org/gdal/changeset/27132
> 
> it's working perfectly!
> 
> I found out a small inconsistency when converting data to PostGIS. For
> layers which have multiple geometries, column name refers to 'name'
> tag - which is something what I would expect. Unfortunately for layers
> with single geometry, column name refers to default 'wkb_geometry'.
> It's cased by the fact that for these layers geometry column is added
> here [1]. For layers with multiple geometry it's added afterwards [2].
> 
> For now I used  GEOMETRY_NAME variable in my scripts, but it would be
> probably useful to fix that directly in PG driver, what do you think?

Actually the issue is more related to backward compatibility. Most use cases 
will still have a single geometry column, so I didn't want to remove the usual 
code path and the related creation options such that GEOMETRY_NAME, GEOM_TYPE, 
etc...
The "fix" would be more in ogr2ogr that currently has the following logic :
  does the output driver support multiple geometry fields ?
	- yes : does the source layer has several geometry fields ?
		- yes : use CreateGeomField() API, and pass wkbNone to CreateLayer()
		- no: pass the geometry type to CreateLayer()
	- no : pass the geometry type of the first geometry column to 
CreateLayer()

Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list