Sunday, 1 December 2019

postgresql - How to make osm2pgsql import a tag?


I loaded OSM data into PostgeSQL with Osmosis&Osm2PgSQL, and see many tags are missing. I need to make it import lanes tag. How can I make it save this tag too?


edit: my solution was to copy /usr/share/osm2pgsql/default.style into a new file, edit it adding a line:


way   lanes         int4         linear

then call osm2pgsql with parameter:


osm2pgsql ... --style my.style

Answer



With osm2pgsql, you have to edit the default.style file.


it is a simple text file, so any text editor will do.



For including lanes, add a line


node,way   lane     text         linear

you have to re-import your data afterwards.


If you have installed the hstore, you could extract the tags from there, but that's a bit more difficult.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...