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

Hi everyone, I am new to open street map, I'm trying to download osm data, load in into Postgres database, and add a postgres layer in QGIS. The problem was that I found that the layer's attributes table are incomplete in QGIS, I guess 80% of the attributes are null. I downloaded whole australia data in format of .pbf from geofabrik, then using osm2pgsql to put the data in Postgres database (followed tutorial in LearnOSM, http://learnosm.org/en/osm-data/osm2pgsql/#importing-the-data). I think it maybe something wrong with the default.style file but I don't know how to fix it. I hope someone can help with this, and sorry about my english. :)

asked 12 Apr '15, 04:57

qiqiqi's gravatar image

qiqiqi
71235
accept rate: 0%


It is completely normal that for most objects, most columns are null. For example, there might be columns for name, opening hours, reference number, oneway, max speed and so on - how else would they be filled for a post box, or a tree? If you dislike the many "null" columns, have a look at the "hstore" facility that osm2pgsql offers, where it is possible to import all values into a single column; you might want to get rid of some column definitions in default.style then.

permanent link

answered 12 Apr '15, 09:42

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks for answering:)

(12 Apr '15, 11:56) qiqiqi

Nothing wrong there. null is used to signify that "this object does not have this tag", e.g. "There is no name tag for this road in the OSM database". Since osm2pgsql stores all points in one table, and all lines in another table, and all polygons in another table, it has to merge all the OSM objects together. Roads are stored next to footpaths. Building outlines are stored alongside lakes. Buildings will have a building tag (and hence have a non-null value for that column), whereas lakes will not have a building tag, and have null for that column.

permanent link

answered 12 Apr '15, 11:33

rorym's gravatar image

rorym
5.4k1449100
accept rate: 11%

OK I got it, thank you very much

(12 Apr '15, 11:56) qiqiqi

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:

×165
×67
×40
×22

question asked: 12 Apr '15, 04:57

question was seen: 4,004 times

last updated: 12 Apr '15, 11:56

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