I installed postgresql, gis and mapnik conform this tutorial: http://www.hyperionreactor.net/blog/how-build-your-own-osm-server-part-1-postgis-and-mapnik . But i took a different step and instead of downloading the whole world, i downloaded just my country. Now, when i run generate_xml.py and generate_image.py(or tiles) i recieve the following error
asked 19 Oct '11, 13:49 alexz |
Ok, then it is osm2pgsql not importing your data. The tutorial says cd /mnt/bin/osm2pgsql./osm2pgsql -S default.style --slim -d gis -C 4096 /mnt/planet/planet-latest.osm.bz2How big is the file you import? It may take 1-2 hours per 100mb of compressed data. The -C 4096 expectes more than 4GB of RAM on your machine. In my toolchain, I use osm2pgsql --create --database osmdb --username osmuser --prefix planet --slim --cache 1024 -S default.style --hstore D:/Karten/osm/Geofabrik/duesseldorf.osm.bz2 osmdb, osmuser and planet to be modified for your needs. Could you protocol the output of osm2pgsql? HTH, ajoessen answered 21 Oct '11, 07:09 ajoessen Thanks a lot sir. But i receive errors with that command.
(21 Oct '11, 08:29)
alexz
some more similar messages, then:
(21 Oct '11, 08:30)
alexz
1
Ah, thats the point it stops. According to http://wiki.openstreetmap.org/wiki/Mapnik#PostgreSQL.2FPostGIS the _int.sql installed previous is interfering.
(21 Oct '11, 08:42)
ajoessen
@ajoessen, yes, i just fixed that by deleting my gis db and recreating it accordingly, with this fix : http://wiki.openstreetmap.org/wiki/Talk:Openptmap/Installation .
(21 Oct '11, 08:56)
alexz
1
The NOTICE: are ok. But the Segmentation fault not. Maybe the file was corrupted while downloading? Can you expand it to moldova.osm without error?
(21 Oct '11, 08:59)
ajoessen
Yes, extraction worked fine. I changed my cache space to -C 1024 and it seems to work now. Strange how 2048 didn't worked because i have 3 gb on my pc.
(21 Oct '11, 09:09)
alexz
The operating System still needs some memory ;-) Mine (Windows XP) ist satisfied with 500kB.
(21 Oct '11, 09:11)
ajoessen
So,import finished with
(21 Oct '11, 09:35)
alexz
Continue
(21 Oct '11, 09:39)
alexz
1
slowly getting ahead ;-) I usually make a copy of generate_tiles.py and change the parameters within that file, found at the end. render_tiles may suppress the error messgaes. You can try generate_image.py to produce a single picture for testing the installation.
(21 Oct '11, 09:46)
ajoessen
OH HEY! generate_image.py works! I needed to supply a pass for db user prodeng at generate_xml.py for it to work.
(21 Oct '11, 09:48)
alexz
Sounds good. In the generate_tiles.py, change the NUM_THREADS = 4 to NUM_THREADS = 1 for a try.
(21 Oct '11, 09:53)
ajoessen
Nope, that doesn't change anything. Are you sure this may be the cause for now? it says file not found though. EDIT: where is the xml generated anyway? Btw, is potlatch and gis db somehow connected? Because i've stumbled on an interesting change. Please visit this topic for relevancy: http://help.openstreetmap.org/questions/8561/potlatch2-loads-but-then-crashes-on-my-osm-server
(21 Oct '11, 10:02)
alexz
1
generate_xml creates a few xml.inc in the inc directory. For rendering, you want to use osm_local.xml? Normally, osm.xml in the same directory as generate_tile.py is used. You can edit that in the generate_tile.py: if name == "main": home = 'D:/' try: mapfile = "osm.xml" except KeyError: mapfile = home + "/svn.openstreetmap.org/applications/rendering/mapnik/osm-local.xml" try: tile_dir = 'D:/Tiles/myMapnik/'
(21 Oct '11, 10:18)
ajoessen
Why should i change that, i don't get it. Btw, my text is different:
(21 Oct '11, 10:31)
alexz
1
Change the mapfile = to the local place and file osm.xml you want to use for rendering. The osm-local.xml does not seem to exist in the right place.
(21 Oct '11, 10:37)
ajoessen
Cool. It works now. THough i get a lot of "unknown: empty tile" messages. Hope it's ok. Btw, where are these tiles going to be used? Can i see them in JOSM? Will i get something more if i'll use then for my osm server (assuming it doesn't).
(21 Oct '11, 10:55)
alexz
1
What do you expect when you import only moldava and render the hole world from -180° to +180°? Most of the tiles must be empty! To see them, you can set up a html-page with openlayers. My wiki-Page is only in German, but perhaps useful for you: http://wiki.openstreetmap.org/wiki/User:Ajoessen/Osmviewer_und_GPXviewer You have to change the path for the tiles from http://osm.org to your local file system, or setup an apache server to use http://localhost For your potlatch2 problem, I cant help you. I only use josm, but with the original osm servers.
(21 Oct '11, 11:05)
ajoessen
So then you download the xml from osm.org, make changes and then... what? upload the changes to your osm db / gis db / osm.org ? Just curious :)
(21 Oct '11, 11:43)
alexz
1
The Postgis database is only useful for rendering with mapnik. Osm2pgsql does a bit preprocessing to change route and multipolygon relations to geometry types that mapnik can understand. A database for editing must have a different database scheme, dealing with changesets and version history of nodes, ways and relations. Rails Port is the software and database behind that. I make my edits with josm on the osm.org servers, and take a copy of my local area every month from Geofabrik to render my area. Downloading all the tiles from osm.org is causing too much traffic on the tile servers.
(21 Oct '11, 12:05)
ajoessen
I tried reading it a couple of times but still not sure if i understand. As far as i know, you can download the map data from osm.org and then begin to edit it. THen you submit and upload the changes with your oms.org account. If you need to see the map changed you go to osm.org so how does Geofabrik fits in all this? (i don't know what's geofabrik).
(21 Oct '11, 13:10)
alexz
Geofabrik by Frederik Ramm http://download.geofabrik.de/osm/ offers the regional extracts (as cloudemade does, but also smaller extracts for my country). To see my changes, i visit openstreetmap.org, yes. But I use my own database to make transparent overlays for cycle and hiking routes, bus services, height contour data and borders. These I only use locally in the same way you use the little blue-white "+" on the right of osm.org. And I can take them on my mobile device without Internet access.
(21 Oct '11, 13:18)
ajoessen
Sorry, but that facebook stuff is not my world. You can contact me over my osm profile: http://www.openstreetmap.org/user/ajoessen
(24 Oct '11, 07:17)
ajoessen
showing 5 of 23
show 18 more comments
|
Please give us access to your xml file produced at the step 1 to inspect it. Have you imported the data with the same options (dbname, user) than in your given command? The best way is to look at your DB with a client to see if the table is already there. Can you do this? answered 19 Oct '11, 16:35 NicolasDumoulin 1.Which xml file? Where is it located? What does it represent? I'm new to osm and still trying to figure out how everything works.
(19 Oct '11, 17:10)
alexz
2.Different user? No, i don't think so. I used user prodeng. I hope this following table gives some clarity...
(19 Oct '11, 17:11)
alexz
3.What table are we looking for?
(19 Oct '11, 17:12)
alexz
(20 Oct '11, 08:42)
NicolasDumoulin
(20 Oct '11, 14:55)
alexz
(20 Oct '11, 14:58)
Richard ♦
here we go. This is osm.xml from my mapnik folder. http://pastebin.com/1eyEvD8V Btw, i can't generate tiles though i can generate the image.
(21 Oct '11, 10:11)
alexz
showing 5 of 7
show 2 more comments
|
The tables-Section usually holds 9 Entrys: the two shown, and planet_osm_line/nodes/point/polygon/rels/roads and ways. Maybe you should add --prefix planet_osm when importing with osm2pgsql, or look for error messages at this step. In the tutorial, look at the section Setup PostGIS for OSM sudo -u postgres -icreateuser prodengcreatedb -E UTF8 -O prodeng giscreatelang plpgsql gisexitpsql -f /usr/share/postgresql/8.4/contrib/postgis.sql -d gisecho "ALTER TABLE geometry_columns OWNER TO prodeng; ALTER TABLE spatial_ref_sys OWNER TO prodeng;" | psql -d gispsql -f /usr/share/postgresql/8.4/contrib/_int.sql -d gispsql -f /mnt/bin/osm2pgsql/900913.sql -d gisare the sql-files in the place where you call them? Otherwise the database is not ready for import. HTH, ajoessen answered 20 Oct '11, 14:04 ajoessen Yes, i think everything was done by the tutorial. The files where in place, too.
(20 Oct '11, 14:59)
alexz
|