NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

right now I am trying to make a touristic map for Abakan (the capital of the Republik of the Russian Republik Khakassia). So far I used the instruction on switch2osm to load OSM Data from Geofabrik into QGIS. I used the Carto stlye sheet. Now I would like to lable streets and touristic Objects with the German or English names, but the columns for these tags are missing. I guess, I somehow could get the columns tobe created using the hstore extension, but I dont kno how to do this. Is it clear what I am asking for? Thanks alot

asked 18 Jun '15, 13:45

oohay's gravatar image

oohay
26113
accept rate: 0%

edited 19 Jun '15, 15:07


Please do not ask two questions in one (particularly when they are technically not related), can you open a seperate question for your 2nd part?

Wrt hstore I'm assuming that you are actually loading them in to Postgres/Postgis not qgis, and likely doing that with osm2pgsql? If that is the case you can follow http://wiki.openstreetmap.org/wiki/Osm2pgsql#hstore and reimport.

permanent link

answered 18 Jun '15, 15:28

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

To import with hstore, you'll need to reimport. First run CREATE EXTENSION hstore; in the postgres database you want to use, then pass the --hstore option to osm2pgsql. Read more.

I'm afraid I don't know how to style QGis in the way you want, perhaps someone else can help. (Though like @SimonPoole, I advise you to open another question)

permanent link

answered 19 Jun '15, 08:41

rorym's gravatar image

rorym
5.4k1449100
accept rate: 11%

Thanks for your answers! Simon Poole is right. I am working with Postgis. And I already activated the --hstore Extension:

sudo -u postgres createuser -s $USER createdb gis psql -d gis -c 'CREATE EXTENSION hstore; CREATE EXTENSION postgis;

Than I loaded the Database in osm2pgsql by typing:

osm2pgsql --create --slim \ --cache 1000 --number-processes 2 --hstore \ --style ~/osm/openstreetmap-carto/openstreetmap-carto.style --multi-geometry \ ~/osm/meineosmdatei.osm.pbf

I guess, I have to change something in this last command to get the english an german Names. On the [switch2osm] (https://switch2osm.org/?s=loading+osm+data) page is written that:

--hstore causes tags not in the .style file to be stored in a special “hstore” column. Hstore is a key-value store that supports arbitrary keys and values. Having other tags in hstore allows changes later on, like rendering names in a specific language and overall makes the database more flexible, giving you greater freedom to render interesting data on maps you create.

But there is no special hstroe column in QGIS visble....

(19 Jun '15, 15:23) oohay

According to this older issue tracker link (https://hub.qgis.org/issues/3989), the latest versions of QGIS should display hstore columns as text (columns?). I guess it may be doing some "on-the-fly" conversion of the data to get in a more "GIS friendly" plain text column format, but since I don't have PostGIS installed, I can't tell you for sure.

(20 Jun '15, 13:51) mboeringa

Thanks a lot I rechecked my data in QGIS and found out that the English and German Names of the touristic objects are stored within the last column, which is called "tags". So my question kind of changed: How can I get two single columns with the English and German Names out of the tag column in which seem to be stored all additional tags not used by the Cartho style? Should I open a new question for that and declare my question as solved?

permanent link

answered 20 Jun '15, 22:02

oohay's gravatar image

oohay
26113
accept rate: 0%

edited 20 Jun '15, 22:02

1

Opening a new question can mean more visibility which can attract answers. To get the tags as separate columns, you can use the osm2pgsql style file to add name:en and name:de which means they'll be added as columns.

(21 Jun '15, 10:31) rorym

Okay thats the solution to the problem: I edited the openstreetmap-carto.style document to create separate columns for the tags name:en and the tag name:de. I just added the lines to the document:

node,way   name:en  text         linear

node,way   name:de  text         linear

Thanks for your help!

permanent link

answered 22 Jun '15, 19:10

oohay's gravatar image

oohay
26113
accept rate: 0%

edited 22 Jun '15, 19:15

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×440
×134
×67
×2
×1

question asked: 18 Jun '15, 13:45

question was seen: 6,994 times

last updated: 22 Jun '15, 19:15

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum