Run on PC without internet

Hello!

Is it possible to download openstreetmap and run on PC locally?
I’m interested for map of a country, for example.

Regards

Yes you can!

  1. Download the complete planet dump or a country dump extracted from the planet dump

  2. Render the (country) dump

  3. can be done in many ways. You can create a slippy map using Mapnik or Osmarender which need to install a webserver and postgres database locally which is is not easy. You can also choose to use one of the offline renderers such as Kosmos, Navit, Gosmore etc.

Lookup the names in the OSM wiki for more information.

PS. working with the planet dump might require a lot of CPU power, disk space and time. Choosing a smaller extract to work with might be smart if you’re only interested in a small area (country size and smaller).

Thank you for the answer, Lambertus!

I’d follow your directions. Can you provide detailed step-by-step instrucions? Or where can i find them?
I’m looking around on the web, but also hope to get them ‘here’.
So, my aim is to run Openstreetmap on my local machine

Regards

http://wiki.openstreetmap.org/wiki/Mapnik

Or you can use Applications such as Navit and Gosmore.

I installed Mapnik (and Python25) successfully, database is initialized with 900913.sql ;

I reached the part
http://wiki.openstreetmap.org/wiki/Mapnik#Loading_Data

When i type

osm2pgsql -m -d gis planet-latest.osm.bz2

I get

osm2pgsql SVN version 0.55-20081113 $Rev: 10464 $

Connection to database failed: fe_sendauth: no password supplied

I tried to type -W:mypassword, but then i get the help screen for osm2pgsql

**How can i solve Loading Data?
**
Questions which appear now:
What is the next step? How can i set up later my own server?

Regards

This is a problem I think most ppl have while setting up mapnik+postgresql, and it would be good if someone could find out why it happens.

This error comes from a postgresql which is setup too restrictive, and I’m sure someone in the postgresql community can help you fix it…

Try giving username as well. If you do not give any then the default is to use the same that is used for logging in to computer. PostgreSQL may not have user account for that user. I suppose you are using Linux.

I appreciate your hints a lot!

I tried with

osm2pgsql -U:myusername -W:mypassword -m -d postgis planet.osm

but i also get the help screen for osm2pgsql
Problem still persist

Do you know any Postgresql forums where I might get solution for this problem? I found a few via google.

Regards

I’m using:

Windows XP
PostgreSQL\8.3
Postgis-pg83-1.3.5-1
mapnik-0_5_1
Python25

I still haven’t made any progress. Any more hints?

Regards

System that works for me is Windows XP (and Vista on other computer), PostgreSQL 8.2 and PostGIS 1.3.2 for 8.2.
Some more information is on page http://wiki.openstreetmap.org/wiki/User_talk:JRA
In short, it will work. Start by preparing the database by creating a user having the same username as your Windows account. Make database to use “trust” method so it will not require any password. Make a new database from PostGIS template and run osm2pgsql. Make first try with something smaller than the planet file, for example some country file from download.geofabrik.de.

I haven’t found those versions that U mentioned, so i keep on trying with PostgreSQL\8.3 Postgis-pg83-1.3.5-1
It seems that there are no problems with them, but with authentification.

I’m able to create database only with postgres username. 900913.sql can be executed only for postgres. I tried with sql query CREATE user WindosAccountUsername… and user is created, but when i try to execute 900913.sql authentification problem appears again.
How can i create this?

Regards

Try then to create the database as postgres but grant all possible rights for the user sharing the Windows user name. Or you can try to download another osm2pgsql binary from http://tile.openstreetmap.org/direct/osm2pgsql.zip
Read the discussion from OSM talk mailing list archives, thread [OSM-talk] Wanted: Osm2pgsql.exe developer which started 10th November 2008. I use still the Artem version because it is faster but the latter is more full featured and accepts usernames etc.

I solved the authentification problem by editing pg_hba.conf file to:
host all all 127.0.0.1/32 trust

But I stucked up again. At **Rendering with Mapnik **, what does the
$ source ./set-mapnik-env
$ ./customize-mapnik-map >$MAPNIK_MAP_FILE
mean?
I haven’t had success with executing set-mapnik-env.
I installed:
c:\mapnik-0_5_1
c:\Python25

What about next steps? How can i set up the server for local-openstreetmap? Is that a Tomcat server or some other? How can i read the maps from DB? This thoughts went through my mind… i will check them and also appreciate any useful hint.

Regards

P.S.
Just to remained that i’m using Win XP

They setup paths and stuff in the xml style file, and in the environment. If you install Cygwin you should be able to run them as stated. Or you can edit the scripts filling in the default directories yourself.

Or JRA has a better solution… :slight_smile:

I have this error message when i want to use source tool from Cygwin:

Execution of PostgresSQL by a user with administrative permissions is not permitted.
The server must be started under an unprivileged user ID to prevent possible system security compromises. See the documentation for more information how to properly start the serve

I’m looking in the PostgreSQL documentation after this problem, but i’d highly appreciate if i get appropriate hint.

Regards

Note: JRA is alot better at this than me.

First: Try starting it from a user without administrative privileges?

Second solution:
These are the script you are talking about:

http://trac.openstreetmap.org/browser/applications/rendering/mapnik/set-mapnik-env
http://trac.openstreetmap.org/browser/applications/rendering/mapnik/customize-mapnik-map

if you are really just wrting:
source ./set-mapnik-env

you should not get that error message since it will not start postgresql

Thank you emj!

As i assumed PostgreSQL server is started with WinXP. Where can i change the account running the PostgreSQL backend? How can i create (appropriate) account?

Regards