[gdal-dev] ogr2ogr with OSM data error Too many tags in relation

G. Allegri giohappy at gmail.com
Fri May 16 01:12:07 PDT 2014


Hi Even, thanks.
A new run ended with the mentioned errors and a warning about a bad
polygon.
I thought it was a bad sqlite because QGIS couldn't load it, but ogrinfo
and ogr2ogr work well with it (I could convert to shapefiles).

giovanni


2014-05-15 20:06 GMT+02:00 Even Rouault <even.rouault at mines-paris.org>:

> Le jeudi 15 mai 2014 16:29:52, G. Allegri a écrit :
> > I'm trying to use the OGR OSM driver to convert an .osm file to sqlite
> > (spatialite)
> > Running:
> >
> > ogr2ogr -f SQlite myosm.sqlite myosm.osm -dsco SPATIALITE=YES
> >
> > I obtain:
> >
> > ERROR 1: Too many tags in relation 365331
> > ERROR 1: Too many tags in relation 365331
> > ERROR 1: Too many tags in relation 365331
> > ERROR 1: Too many tags in relation 365331
> > ERROR 1: Too many tags in relation 365331
> > ERROR 1: Too many tags in relation 365331
> > ERROR 1: Too many tags in relation 365331
> >
> > (yes, it's repeated)
> > Relation 365331 is the italian administrative boundary (
> > http://www.openstreetmap.org/relation/365331). It contains a lot of tags
> > (mainly translations).
> >
> > Is there a limit to the number of relations OSM's driver can manage?
>
> The error comes from the XML .osm parser in fact. I see it has not the
> logic
> of the PBF parser to increase the hard-coded initial values. So the max is
> 256.
> If you convert your .osm into a .pbf, I suspect you wouldn't have this
> error.
> Otherwise if you compile from source you can increase the value at line
> 2246
> of ogr/ogrsf_frmts/osm/osm_parser.cpp ( psCtxt->nTagsAllocated = 256; ).
> But that error is not critical. The extra tags after the 256 first ones
> will
> just be ignored.
> Anyway it might be good if you can open a ticket about that issue.
>
> > How to
> > avoid loading all those name "subtags"?
> >
> > giovanni
>
> --
> Geospatial professional services
> http://even.rouault.free.fr/services.html
>



-- 
Giovanni Allegri
http://about.me/giovanniallegri
Twitter: https://twitter.com/_giohappy_
blog: http://blog.spaziogis.it
GEO+ geomatica in Italia http://bit.ly/GEOplus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140516/f88520ed/attachment.html>


More information about the gdal-dev mailing list