Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

opennewzealand/linz2osm

Repository files navigation

LINZ-2-OSM

Running at: http://linz2osm.openstreetmap.org.nz/

Requirements

  • Python 2.7 (not tested with Python 3)
  • Django 1.6
  • PostgreSQL 8.4 or later + PostGIS 1.5 or later
  • Pydermonkey (see notes)
  • Pygments
  • Django South
  • RabbitMQ
  • Celery 3 or later and django-celery
  • GDAL 1.5 or later
  • BeautifulSoup (only if generating layers from LINZ data dictionary with dd_load)
  • Requests v0.14.0 or later

(you can install most of these through pip: use the requirements.txt file)

Installing Pydermonkey

Pydermonkey needs to build spidermonkey-1.8.1pre, and the URL is out of date. To install:

  • run pip install --no-install pydermonkey
  • go into the build/pydermonkey directory, and checkout spidermonkey-1.8.1pre to a spidermonkey-1.8.1pre directory: run hg clone http://hg.toolness.com/spidermonkey/ -u 1.8.1pre spidermonkey-1.8.1pre
  • run python setup.py build_spidermonkey
  • go back to the virtualenv root and run pip install --no-download pydermonkey

Installing the app

  • make a settings_site.py file and add overrides for things like:

    • DATABASES
    • DEBUG, TEMPLATE_DEBUG
    • ADMINS, MANAGERS
    • MEDIA_ROOT
    • TEMPLATE_DIRS
    • SECRET_KEY
    • the non-default databases are used as datasets, add a _description and _srid field to define. If you add more datasets, run manage.py generate_datasets to update the app.
  • run manage.py syncdb to build the DB tables. Creating a user is a good idea.

  • run manage.py migrate to apply DB migrations.

  • run manage.py createcachetable django_cache to add a cache table.

Load data

  • run manage.py loaddata v16_layers to populate the layer models.
  • run manage.py loaddata example_tags to load some example tags for road_cl, and some defaults for all layers.

OR, to clone an existing installation

  • go to that existing installation (e.g. http://linz2osm.openstreetmap.org.nz), click on "Layers", then click "Export layers and tags".
  • download the file, and put it on your new machine
  • on your new machine, run manage.py loaddata <path_to_your_downloaded_file>

Then, either way:

  • run manage.py generate_datasets to configure the app for the datasets and layers you've added

Running in development mode

  • run manage.py runserver
  • from the linz2osm dir, run ../manage.py celery worker
  • head to http://localhost:8000
  • have fun! :)

New Datasets and Layers

To load some other IFF data, use the linz_topo scripts from nz-geodata-scripts to populate a PostGIS DB. Then, add it as a database in the settings file, (make sure it has _description and _srid defined).

Whenever you add a new dataset or layer, run manage.py generate_datasets to update the app.

Support, Bugs, Ideas

Special Thanks

LINZ-2-OSM is made possible with the generous support of these organisations:

Legal

Copyright (C) 2010-2015 Koordinates Ltd.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

More Legal

djangosnippets: http://djangosnippets.org/about/tos/


jQuery: Copyright 2012 jQuery Foundation and other contributors Released under the MIT license http://jquery.org/license


Bootstrap: Copyright 2012 Twitter, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

http://twitter.github.com/bootstrap/index.html