[OSM-dev] osm2pgsql hstore column patch

Peter Körner osm-lists at mazdermind.de
Fri Jun 25 06:51:16 BST 2010


Hi all

i have missed two malloc's and forgot to free them, what is why it 
always failed with osm extracts bigger then berlin :)

I attached a new version of the patch that now imports germany without a 
problem. This has still not been tested on a planet nor with 
changeset-files so it is maybe not yet ready for svn trunk but that 
decision is not up to me ;)

Peter


Am 24.06.2010 00:02, schrieb Peter Körner:
> Hi
>
> I took Sven's hstore patch and added a new functionality.
> It is now possible to request an arbitrary number of extra hstore
> columns, that contains all tags that start with the column name.
>
> eg: osm2pgsql --hstore-column "name:" --hstore-column "wikipedia:"
>
> will add two new columns "name:" and "wikipedia:". When a node or a
> way contains a name:de=Deutschland tag, the "name:"-column will contain
> an hstore entry 'de'=>'Deutschland'.
>
> If no name:-Tag is present, the column is set to NULL. That way one can
> easily look for translated objects by toing a "name:" IS NOT NULL query.
>
> What kind of Index would you suggest for such a IS NOT NULL query? A
> conditional index on osm_id WHERE "name:" IS NOT NULL?
>
>
> I wrote the relevant code into a single function and also relocated the
> hstore code into a seperate function and documented both. Can someone
> with more C experience please check the patch because I'm not sure I did
> all pointer logic correct.
>
> I did successfully test it on the berlin geofabrik extract and will try
> to run a planet import during the next week (need to talk about that on
> Maps-l ;).
>
> The attached patch is against r21892 of the osm repo.
>
> Special thanks to Sven who did the real hard work.
> Peter
>
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hstore-column.patch
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20100625/d33b285e/attachment.ksh>


More information about the dev mailing list