Hello everyone! This is my first post on this forum.
I know that those kind of posts are irritating, but before you judge me please understand, that I’m a man with a knife on my throat.
I’m stuck on my task and I don’t know what to do.
The job is:
- extract data from Open Street Map
- create database model containing following schema and data
Schema looks like this:
+---------+ +------------+ +----------+
| country | | adm_unit | | city |
+---------+ +------------+ +----------+
| id |--\ | id |--\ | id |
| name | \-| country_id | \--| adm_id |
+---------+ | name | | name |
+------------+ | coord_x | //coordinates - longitude and latitude
| coord_y |
+----------+
by “administrative unit” I understand top-level administrative unit for each country (eg. state in US, vovoidenship in Poland).
So far I managed to:
- download map itself (only for Poland to test it)
- import it to database using osm2pgsql tool * perform some selects and realize, I don’t know how to do it.
The main problem is: I can’t see any relations between different items of map. Taking Poland as example: I can find Warsaw (capitol city), as well as “masovian vovoidenship” performing few selects, but there is no relation between those two. There are lot of empty columns in my db instead. Also none of column names suggests that it should hold any relation to “parent”.
I don’t know how to find those relations. Is it something with imports that i’m missing? Should I change anything in my default.style (I haven’t changed anything inside it)? Or maybe there’s some kind of other approach to solve my problem? Maybe there are free databases that contain data I need and are less painful to work with? Geonames is no-go, their database is full of errors.
I’m really green when it comes to gis, I’m PHP programmer, that’s completely different world for me. Unfortunately, even if I want to explore it, my deadlines won’t allow that.
I will appreciate ANY help with my issue, any direction, any solution! Big big big thanks in advance!