Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bnordgren committed May 4, 2017
2 parents a941a9f + 22ad4c4 commit a4a76e1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
53 changes: 37 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,60 @@ A system for rendering OpenStreetMap Based Topographic Maps

TopOSM runs on Linux. It may be possible to build and run it on other platforms, but I have not tested this. If you try it, please let me know.

TopOSM depends on some fairly recent software, including:
The original TopOSM documentation mentioned dependencies on these versions of the following software, with Ubuntu 11.04 as a base:

* Mapnik (2.0) with included patches and Cairo support
* Python (2.6)
* GDAL (1.7)
* PostgreSQL + PostGIS
* ImageMagick

(later versions than those mentioned above will probably work)
My fork is running with Ubuntu 16.04 as a base.


## Installation ##

Required packages will vary depending on your distribution. For Ubuntu 11.04, this list of packages may be a good start:

python-mapnik mapnik-utils gdal-bin gdal-contrib python-gdal
libgdal-dev proj libproj-dev python-pyproj python-numpy imagemagick
gcc g++ optipng subversion postgresql postgresql-contrib
postgresql-server-dev-8.4 postgis wget libxml2-dev python-libxml2
libgeos-dev libbz2-dev make htop python-cairo python-cairo-dev
osm2pgsql unzip python-pypdf libboost-all-dev libicu-dev libpng-dev
libjpeg-dev libtiff-dev libz-dev libfreetype6-dev libxml2-dev
libproj-dev libcairo-dev libcairomm-1.0-dev python-cairo-dev
libpq-dev libgdal-dev libsqlite3-dev libcurl4-gnutls-dev
libsigc++-dev libsigc++-2.0-dev ttf-sil-gentium
ttf-mscorefonts-installer "ttf-adf-*"
My Dockerfile sets up my installation as follows:

```
FROM ubuntu:16.04
MAINTAINER Bryce Nordgren <[email protected]>
# Need multiverse for mscorefonts
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-add-repository "deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse" && \
apt-add-repository "deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse" && \
apt-get update
# Processing requirements for TopOSM
RUN apt-get install -y debconf-utils && \
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula boolean true | debconf-set-selections && \
apt-get install -y python-mapnik mapnik-utils gdal-bin gdal-contrib python-gdal \
libgdal-dev proj-bin proj-data libproj-dev python-pyproj python-numpy imagemagick \
gcc g++ optipng git postgresql postgresql-contrib \
postgresql-server-dev-all postgis wget libxml2-dev python-libxml2 \
libgeos-dev libbz2-dev make htop python-cairo python-cairo-dev \
osm2pgsql unzip python-pypdf libboost-all-dev libicu-dev libpng-dev \
libjpeg-dev libtiff-dev libz-dev libfreetype6-dev libxml2-dev \
libproj-dev libcairo-dev libcairomm-1.0-dev python-cairo-dev \
libpq-dev libgdal-dev libsqlite3-dev libcurl4-gnutls-dev \
libsigc++-2.0-dev fonts-sil-gentium ttf-mscorefonts-installer \
"ttf-adf-*" vim python-xattr python-lockfile python-pillow \
python-pastescript python-webob \
&& rm -rf /var/lib/apt/lists/*
```

Set up PostgreSQL with PostGIS, see:
http://wiki.openstreetmap.org/wiki/Mapnik/PostGIS


### Build local patched Mapnik ###

This is retained for historical purposes. I'm using plain Mapnik installed from packages as shown above.
I have not been able to determine whether this patch was added to the Mapnik code base in the interim.
Regardless, the process seems to work without it.

```
$ git clone https://github.com/mapnik/mapnik.git
$ cd mapnik
Expand All @@ -51,7 +72,7 @@ $ python scons/scons.py
$ python scons/scons.py install
```

If you need a more recent boost than available for your system, you can build one locally (i.e. with PREFIX=$HOME) and tell the mapnik configure step to link against that by adding:
Also a historical note, because the process works with Boost installed from packages: _If you need a more recent boost than available for your system, you can build one locally (i.e. with PREFIX=$HOME) and tell the mapnik configure step to link against that by adding:_

```
BOOST_INCLUDES=$HOME/include BOOST_LIBS=$HOME/lib
Expand Down
2 changes: 1 addition & 1 deletion areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@

#Mineral-county-centric things
Montana = Box2d(-116.157396,44.420047,-103.676014,49.129227)
MineralVicinity = Box2d(-116.049,46.6316,-113.303,48.264)
MineralVicinity = Box2d(-117,45,-112,49)
Mineral = Box2d(-115.759,46.6966, -114.419,47.4968)
Sanders = Box2d(-116.049,47.1207, -114.187,48.264)
MissoulaCo = Box2d(-114.797,46.6316, -113.303,47.6003)
Expand Down
2 changes: 1 addition & 1 deletion import_nhd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export PGPASSWORD=$DB_PASS
SETUPCMD="shp2pgsql -p -I -g way -W latin1"
IMPORTCMD="shp2pgsql -a -g way -W latin1"
DBCMD="psql -q -h $DB_HOST -U $DB_USER -p $DB_PORT $DB_NAME"
TEMPDIR="/mnt/enterprise/Data/Bryce/rendered/temp"
TEMPDIR="/var/local/rendered/temp"
SRS="+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"
#SRS="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over"
TEMPFILE="$TEMPDIR/temp.shp"
Expand Down

0 comments on commit a4a76e1

Please sign in to comment.