[gdal-dev] OSM driver to create separate tables for tags

Even Rouault even.rouault at mines-paris.org
Wed May 14 09:42:07 PDT 2014


Le mercredi 14 mai 2014 16:41:02, Jukka Rahkonen a écrit :
> Hi,
> 
> I wonder if it would make any sense in the GDAL context to have an option
> in the OSM driver to separate geometries and tags and write them into
> their own tables. The structure of the resulting tables (5 + 5 for points,
> lines, multilines, multipolygons and relations) would be like:
> 
> Geometry table
> ==============
> osm_id (long)integer or string (primary key)
> geometry geometry
> 
> Tag table
> =========
> tag_id (long)integer or string (primary key)
> osm_id (long)integer or string (foreign key)
> tag string 255
> value string 255
> 
> I am remembering that OSM has a 255 character limit for tags and values but
> I am not sure.
> 
> This way all the data from OSM could be converted without any loss into any
> database and into CSV and why not also into shapefile + additional dbf file
> for tags. That would make much sense for those who are using and especially
> analyzing OSM data because all the tags would be are reserved and they
> could be queried simply with standard SQL. However, almost everything else
> in GDAL/OGR is based on simple features and pushing OSM data into
> relational model may not suit for the engine we have.
> 
> Utilization of these tables in GIS would not be too complicated at least
> for read-only access. It would be best to create views or tables from the
> master tables for creating fixed schemata for the work layers but that's
> all.

This make some sense. I'm not sure what is the best place where to implement 
that if someone wants to tackle this.
This could be actually implement outside the OSM driver, in a rather generic 
way, by a Python script that would take any OGR datasource, the name of 
hstore-like fields and would split their content in separate tables like you 
describe.
Actually that could be a processing stage in a pipeline style workflow, but we 
don't have that mechanism in OGR.

> 
> -Jukka Rahkonen-
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

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


More information about the gdal-dev mailing list