-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
112 lines (71 loc) · 4.32 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Overview
This repository creates a generic mapnik tile server with apache2 and PostGIS.
The repo configures a mapnik server but it does not import data into the PostGIS database.
The easiest way to get a dataset is to download a dataset from geofabrique at download.geofabrik.de.
Using chrome search download.geofabrik.de and find a dataset you want, right click over the [osm.pbf]
or [osm.bz2] and select copy link address. This will put the link path into the clipboard.
Next, access the mapnik VM as the vagrant user. In the Vm commad line enter:
vagrant ssh
Once you are the vagrant user, become the osmdata user. At the commad line enter:
sudo su - osmdata
As the osmdata user cd to the /tmp directory.
cd /tmp
Download the geofabrique file to this location. You would enter command wget and then right click the mouse \
and select paste to enter the datafile selected earlier. The command would look like the following:
wget http://download.geofabrik.de/central-america/belize-latest.osm.pbf
Select enter and the file will download.
To import the file into the database run the following command as the osmdata user.
/opt/osm-tileset-chef-repo/scripts/install_datafile.sh
The install_datafile.sh script is intended to be a quick / flexible way to import only one osm pbf or bz2 data file.
The script will import all osm pbf and bz2 datafiles found in the /tmp directory but the osm2pgsql importer
called by this script deletes any existing osm data in the database as part of the import. If there are more than one
datafiles in the /tmp directory, the script will install all of them one at a time but only the last datafile will be
available.
After the data is in the database, restart the renderd service:
service renderd restart
It is important to remember renderd will not render tiles until data is in the database and the service must be
restarted after the data has been loaded.
Testing the installation
After the dataset is imported into the database the mapnik server should be ready for use. To test enter the following
in a web browser ( 192.168.99.90 is the default IP the VM is created with. If that is different for your instance
then change that to the correct IP):
http://192.168.99.90/osm_tiles/0/0/0.png
A tile of the world should appear in the upper left hand corner of the browser window.
Trouble shooting
Apache2
Assuming the VM completed successfully and the data was loaded into the PostGIS database using the script above
then test the Apache2 and renderd service.
To test if apache2 is running enter http://192.168.99.90 in a web browser. The Apache splash page should return.
If it does not then restart the apache service. As root enter service apache2 restart' at a command prompt.
The apache2 service should restart and come back with an OK, meaning the service has started.
Renderd
Renderd is the map tile renderind daemon. to check the renderd daemon restart the service. As root enter
'service renderd restart' at a command prompt. Renderd will return with four errors, that is a bug and is
normal, and an OK, meaning the service has started.
You can also monitor renderd as it handles tile requests. As the osmdata user enter the following at the command
prompt:
service renderd stop
renderd -f -c /usr/local/etc/renderd.conf
Then enter http://192.168.99.90/osm_tiles/0/0/0.png in a web browser. If the request is being sent to renderd
you will see the output in the monitor window.
After testing, restart renderd.
service renderd start
Checking Database
To see if you data is in the db, after you ssh into the vm, run:
sudo su - osmdata
psql -d gis
\d
select count(*) from planet_osm_point;
Recently completed:
- Removed unneseccary mapnik user accounts. These were created following an openstreetmap wiki guideline
but are unnecessary.
- Replaced package apache2-threaded-dec with apache2-dev.
- Replaced ruby-2.0.0-p353 with ruby-2.0.0-p645. This got rid of the security warnings.
- Cleaned up test code.
- Created osm data file import script.
- replaced genericpostgresql database packages with more secure versions.
- Updated the README file to be easier for users to do osm data file imports
- Updated the README file with ways to test and troubleshoot the installation.
Still to do:
- Review Berksfile and Gemfile. Build lock files.
- Review code for any leftover test code.