Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Download Wikimapia places to your GPS
JavaScript Java CoffeeScript Other
tree: 2e992fddec

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.externalToolBuilders
build-only
coffee
java/com/motomapia
war
.classpath
.gitignore
.project
README.md
build.xml
optimize.sh
watch-coffee.sh

README.md

Motomapia - download Wikimapia to your GPS

Motomapia is a website that lets you download Wikimapia placemarks to your GPS as POI files. It is an opensource project demonstrating a handful of web technologies.

You can visit this code in operation at http://www.motomapia.com/

Technology

Motomapia is built on (and demonstrates the use of):

Frontend

Backend

Check it out

Some things you may want to look closer at:

  • Using Mozilla Persona for authentication
  • Building and optimizing javascript with RequireJS' r.js
  • Using a Guice interceptor to provide EJB-like transactions with Objectify4

How Motomapia works

  • When the user moves the map, the frontend makes a call to /places, passing the current lat/lng bounds of the viewport.

    • The backend makes a request to Wikimapia with this bound, getting back 100 places.
    • The backend ensures that all of these places are present in the local datastore.
      • The places will be fetched from memcache thanks to Objectify's @Cached feature.
      • Places are stored with an indexed list of geocells in which the centerpoint resides.
    • The backend returns the place data to the client as JSON.
      • Polygons are encoded as polylines; some places have hundreds of points and straight-up JSON impacts performance.
  • When the user clicks download, the frotnend makes a call to /download/poi.csv, passing the current lat/lng bounds of the viewport.

    • The backend calculates a relevant set of geocells for the bounding rectangle.
    • The backend queries the datastore for all Places which are indexed for the relevant geocells.
    • The backend writes all places back to the client in POI CSV format.

Issues

  • Nothing stops users from requesting download of all POIs worldwide. This might be expensive ($$) and might even exceed the 60s limit for GAE client requests.

  • There is no way to detect when Wikimapia places are deleted. The simple solution (not implemented) is to expire data in the datastore, although this creates expensive churn. Otherwise Wikimapia needs to be pressed for an API to fetch deleted items.

Development

You can build and run your own version of Motomapia.

To edit the frontend

  • Install Node.js, CoffeeScript, and Less
  • Run watch-coffee.sh to automatically compile the .coffee files on change

To edit the backend (and deploy)

  • Create a Google App Engine application at the GAE website
  • Install Eclipse
  • Install Project Lombok into Eclipse (run "java -jar build-only/lombok-edge.jar")
  • Install the Google Plugin for Eclipse
  • Install the Google App Engine SDK
  • Open the Motomapia project
  • Edit war/WEB-INF/appengine-web.xml and replace motomapia with your application id
  • Click the deploy button in Eclipse

Help

The most likely place to ask for help is the Objectify-Appengine group.

Something went wrong with that request. Please try again.