[gdal-dev] Update on RFC 41 implementation

Even Rouault even.rouault at mines-paris.org
Wed Sep 11 13:07:13 PDT 2013


Hi,

Just to notify you that most of RFC 41 (multiple geometry field support in OGR) 
has now been commited. The last remaining part will be the upgrade of the ILI 
driver done by Pirmin.

As a bonus to the RFC, support for multiple geometry fields has also been added 
to the SQLite SQL dialect (but not yet in SQLite table layer themselves)

I've also started "converting" a few OGR drivers (Shape, KML, LIBKML, GPX, 
GML, VRT, GeoJSON, FileGDB, EDIGEO, OSM and GeoRSS) that are not in the scope 
of RFC 41, so that the SRS of their unique geometry field definition is properly 
set.

To know if a driver has been upgraded, it is a matter of running test_ogrsf on 
a sample dataset and checking for the following warning : 
WARNING: poLayer->GetSpatialRef() and poFDefn->GetGeomFieldDefn(0)-
>GetSpatialRef() differ.

If folks are willing to help upgrading other drivers, you're welcome !

http://trac.osgeo.org/gdal/changeset/26448 should show you how to do that in 
simple situations.

This is mostly a matter of adding the following snippet :

if( poFeatureDefn->GetGeomFieldCount() != 0 ) 
    poFeatureDefn->GetGeomFieldDefn(0)->SetSpatialRef(poSRS);

and we can also remove the implementation of GetSpatialRef() that is then not 
necessary ( the base implementation of OGRLayer::GetSpatialRef() will return 
poFeatureDefn->GetGeomFieldDefn(0)->GetSpatialRef() )

For more complex situations (but I don't think there are a lot of such OGR 
drivers), i.e. where there was lazy resolution of the SRS in 
OGRLayer::GetSpatialRef(), the upgrade of the shapefile driver in 
http://trac.osgeo.org/gdal/changeset/26442 can be used as an exemple.

Even

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


More information about the gdal-dev mailing list