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

I finally managed to import the data from an OSM file to a PostgreSQL database :).
The problem is that, I think, I don't really understand the database structure.
Can someone, please, help me with a method to generate a list that will contain these informations:
1. Street name;
2. House number;
3. Lat;
4. Long;
Thanks!

asked 17 Jul '12, 12:18

Alexandru's gravatar image

Alexandru
15555
accept rate: 0%

What tool did you use to produce the PostgreSQL database?

(17 Jul '12, 12:22) Frederik Ramm ♦

I used osm2pgsql

(17 Jul '12, 12:51) Alexandru

Alexandru: How do you define that all your OSM objects in your database really belong to the city you want?

Do you have a boundary polygon that you used to do a clipping with osmosis or similar?

Or is it enough to describe the elements you want to process via a boundingbox?

(17 Jul '12, 16:40) stephan75

I downloaded the OSM file only for a city from here: http://downloads.cloudmade.com/. My question was about generating a list with some details, so please, let's focus on my question and stop answering me with other qwestions :)

(17 Jul '12, 18:36) Alexandru

stephan75 asked the right question as currently you would get addresses not only for your city but also for surrounding area.

(18 Jul '12, 05:47) RM87

Ok, that would not be a problem :). So, anyone cand help me? :D

(18 Jul '12, 05:59) Alexandru
showing 5 of 6 show 1 more comments

Take the data as raw .osm file or .pbf file and try Osmconvert.

There is recentry introduced option to export all elements with tag colums that you can define how you need it as CSV file (comma separated value.

try osmconvert --help on a command line and read more instructions in detail.

At least you should add columns for the tags "highway" and "name".

If you got your csv file like you need, you can load it in any spreadsheet program like libreoffice calc or similar. Sort the whole table for the column "name" and delete all doublettes.

Thus you get all road names of your area.

permanent link

answered 18 Jul '12, 17:15

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

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
×111

question asked: 17 Jul '12, 12:18

question was seen: 9,749 times

last updated: 18 Jul '12, 17:15

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