[gdal-dev] Re: how: dealing with osm data and creating custom shape files

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Wed Mar 24 05:07:44 EDT 2010

Christoph Dohmen <ChDohmen <at> gmx.de> writes:

> Thanks to Ralf and Frederik!
> But now I want to group those data together.
> Well, I want to create a shapefile containing all road-objects.
> This is quite easy using ogr2ogr select everything with a value
> for highway-attribute. Doing the same for rivers is also done
> in no time. BUT, I want to create an attribute containing the
> attribute value like 'object_id'. This should be set to the value
> of highway-atrtibute in case of generating the road-file and it
> should be set to the value of the waterway-attribute in case of
> generating the river-file.
> Can anyone give me a hint?

This is a question of how to make a proper SQL query. I am not good in those but
try something like:

SELECT roads.*, 'road_id' as object_id
FROM your_roads_table roads;

It should select everything from the table "your_roads_table" and add an extra
column titled as "object_id" and feel in value "road_id" for each line.  Is that
what you would like to have?

-Jukka Rahkonen-

> Christoph

More information about the gdal-dev mailing list