The New MapRoulette
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
conf
docs
postman
project
public
scripts
test/org/maproulette
.gitignore
.jshintrc
LICENSE
README.md
build.sbt
contributors.md
start.bat
start.sh
system.properties

README.md

New MapRoulette

Version 2 of MapRoulette

Welcome to New MapRoulette, the powerful & popular bug fixing tool (or is it a game?) for OpenStreetMap.

This README deals with development related topics only. If you are interested in contributing to OpenStreetMap by fixing some bugs through MapRoulette, just head over to the MapRoulette web site and get started - it should be pretty self explanatory.

That said, read on if you want to contribute to MapRoulette development and are ready to deploy your local instance.

Contributing

Please fork the project and submit a pull request. See Postman Docs for information on API Testing.

Frameworks used

New MapRoulette is built upon the Play Framework using Scala. You can find more information about the Play Framework at https://www.playframework.com It uses the following core technologies:

  • Postgres 9.5 with PostGIS 2.2.1
  • Play Framework 2.5.0 with Scala 2.11.7

Deploying MapRoulette

Server

Local for test and development

Register Dev App with OpenStreetMap

Before beginning, you'll need to register an app with OpenStreetMap to get a consumer key and secret key. For development and testing, you may wish to do this on the OSM dev server (you will need to setup a new user account if you have't used the dev server before).

To register your app, login to your account, go to "My Settings", click on "oauth settings", and then click "Register your Application" near the bottom. Give your app a name and application URL (you can simply use http://localhost:9000 if desired) and leave the other URL fields blank. In the permissions section, check "read their user preferences" and then click the "Register" button at the bottom to get your consumer and secret keys. Be sure to take note of them.

For more details on the app registration process, see the OSM OAuth wiki page.

Mac OSX

These instructions assume you have at least Mac OS 10.10 (Mavericks) and Homebrew installed. We also assume that you have at least PostgreSQL 9.5 and PostGIS 2.2.1 installed. Homebrew provides packages for both (brew install postgresql and brew install postgis), which we recommend.

  • Make sure you have a Java 8 JDK. Check with java -version which should mention an 1.8.x version number. Get and install a Java 8 JDK if necessary.
  • Install the Play Framework activator: brew install typesafe-activator.
  • Create a PostgreSQL superuser osm: createuser -sW osm. Use osm as the password.
  • Create a new PostgreSQL database mp_dev owned by osm: createdb -O osm mp_dev.
  • Setup your environment variables:
    • Database connection JDBC string as MR_DATABASE_URL: export MR_DATABASE_URL='jdbc:postgresql://localhost:5432/mp_dev?user=osm&password=osm'
    • Consumer key from app registration as MR_OAUTH_CONSUMER_KEY: export MR_OAUTH_CONSUMER_KEY=<APPLICATION_CONSUMER_KEY>
    • Consumer secret from app registration as MR_OAUTH_CONSUMER_SECRET: export MR_OAUTH_CONSUMER_SECRET=<APPLICATION_CONSUMER_SECRET>
    • OSM server URL as MR_OSM_SERVER if you wish to use the dev server (defaults to production): export MR_OSM_SERVER='http://master.dev.openstreetmap.org'
    • APIHost used for Swagger API documentation as API_HOST: export API_HOST=localhost:9000
  • Clone New MapRoulette: git clone https://github.com/maproulette/maproulette2.git.
  • Navigate into the newly created maproulette2 directory and run the local development server: activator run. This will take some time the first run as dependencies are downloaded.
  • Head to http://localhost:9000/ and confirm you can see the New MapRoulette front end. This also may take a while as artifacts are compiled.

If you are having issues getting the activator to run, you can configure your instance with dev.conf

Linux

These instructions were written for Ubuntu 16.04

  • Make sure you have a Java 8 JDK. Check with java -version which should mention a 1.8.x version number.
  • If you don't have Java 8 JDK you can get it with the following command sudo apt install openjdk-8-jdk
  • Install the Play Framework activator
    • After downloading unzip the archive to a directory that you have read and write access to
    • Then add activator to your path: Add the following to your .bashrc or equivalent: export PATH=$PATH:/path/to/unzipped-files/bin/
  • Install PostgreSQL and PostGIS: sudo apt install postgresql postgis
  • Create a PostgreSQL superuser: osm: sudo -u postgres createuser -sP osm. Use osm as the password
  • Create a new PostgreSQL database mp_dev owned by osm: sudo -u postgres createdb -O osm mp_dev
  • Setup your environment variables:
    • Database connection JDBC string as MR_DATABASE_URL: export MR_DATABASE_URL='jdbc:postgresql://localhost:5432/mp_dev?user=osm&password=osm'
    • Consumer key from app registration as MR_OAUTH_CONSUMER_KEY: export MR_OAUTH_CONSUMER_KEY=<APPLICATION_CONSUMER_KEY>
    • Consumer secret from app registration as MR_OAUTH_CONSUMER_SECRET: export MR_OAUTH_CONSUMER_SECRET=<APPLICATION_CONSUMER_SECRET>
    • OSM server URL as MR_OSM_SERVER if you wish to use the dev server (defaults to production): export MR_OSM_SERVER=http://master.dev.openstreetmap.org
    • APIHost used for Swagger API documentation as API_HOST: export API_HOST=localhost:9000
  • Clone New MapRoulette: git clone https://github.com/maproulette/maproulette2.git.
  • Navigate into the newly created maproulette2 directory and run the local development server: activator run. This will take some time the first run as dependencies are downloaded.
  • Head to http://localhost:9000/ and confirm you can see the New MapRoulette front end. This also may take a while as artifacts are compiled.

Windows

A work-in-progress setup guide for Windows lives here. Please fork and improve!

Using dev.conf

Another way to handle dev related configuration variables is to use the dev.conf file which has a couple of prepopulated variables that would be beneficial for a test/development environment. To use this file you simply need to add the file as a jvm parameter, eg. -Dconfig.resource=dev.conf

activator run -Dconfig.resource=dev.conf

Your conf/dev.conf file should have the following:

include "application.conf"

db.default.url="jdbc:postgresql://localhost:5432/mp_dev?user=osm&password=osm"
maproulette.super.key="test"
maproulette.super.accounts="*"
osm.server="http://api06.dev.openstreetmap.org"
osm.consumerKey=<APPLICATION_CONSUMER_KEY>
osm.consumerSecret=<APPLICATION_CONSUMER_SECRET>

Creating new Challenges

The wiki for this repo has some information on creating challenges.

Challenge API has further information about creating challenges through the API.

See also the Swagger API documentation. You can view the documentation by going to the URL docs/swagger-ui/index.html?url=/assets/swagger.json on any MapRoulette instance.

Contact

Bug and feature requests are best left as an issue right here on Github. For other things, contact maproulette@maproulette.org

MapRoulette now also has a channel #maproulette on the OSM US Slack community. Invite yourself here!