Well, it’s Rails-based local map application with bla.. sorry, search and POI categories presenting OpenStreetMap data. You can see a working example at kalugamap.ru
You may use it for any (relatively small) region which is presented in OpenStreetMap - your country, city, district, favourite park or living room (well, really you should map your living room on OpenStreetMap first).
You may tune bundled styles, which are generated using excellent TileMill application from these stylesheets. It’s really easy to create your own sky-and-pink map style for your girlfriend, for example.
First of all you need:
-
Postgresql database installed (in Ubuntu it’s
postgresql-9.1
package) -
Postgis extension for spatial data representation (in Ubuntu it’s
postgresql-9.1-postgis
package) -
Sphinx search engine (in Ubuntu it’s
sphinxsearch
package)
If you want to render map tiles, when you also need:
-
{Mapnik}[http://mapnik.org/](dev) installed (in Ubuntu you may use package
libmapnik-dev
from launchpad.net/~mapnik/+archive/nightly-trunk). -
GDal with its Python wrappers installed (in Ubuntu they are
gdal-bin
andpython-gdal
packages)
There are bundled versions of Osm2pgsql and hillshading tools in vendor/bin
compiled for x86_64 architecture.
Why bundling them? There are reasons:
-
Tools for SRTM procesing and hillshade generation usually are not present in repositories, so you need to compile it by yourself.
-
Usually Osm2pgsql tool from repositories is compiled without OSMID64 flag, so it can’t present big object identifiers.
So, don’t bother about these problems and just use bundled versions if you are lucky to have 64-bit architecture. If you don’t - so, be ready for some fun. Well, really, there is nothing scary in compiling it by yourself =) And maybe I’ll bundle 32-bit versions also.
Well, installation is simple - clone this repository:
git clone git://github.com/alno/mapapp.git
Or download zipball from:
https://github.com/alno/mapapp/zipball/master
And then move to database preparation.
Well, there was a manual in OSM wiki, I should find it and link here…
There are 3 configuration files for now:
-
database.yml
- database settings (did you expect anything else?) -
sphinx.yml
- sphinx search engine settings -
mapapp.yml
- your application settings
For each file there is corresponding .sample
file which you may use as a base for configuring.
In database.yml
you should set your database name, host, username, password… Caveat! Database adapter should be postgis
according to used geo adapter requirements.
In sphinx.yml
you may set which stemmer to use. Yes, there are some other options, but you should change them only if you know them
And there are plenty of options in mapapp.yml
:
-
secret_token
- you really need to change it to something secret, as it’s used in subscription of your session data to prevent some attacks -
map
- map options-
init
- initial position of map (latitude, longitude and zoom level) -
bbox
- bounding box of diplayed data -
min_zoom
- minimal zoom level -
max_zoom
- maximal (nearest) zoom level -
styles
- map styles you want to display on map -
style_base
- base url for your tiles
-
-
Alexey Noskov (alno)
Copyright © 2012 Alexey Noskov, released under the MIT license