Skip to content

CityOfBoston/geogit-viz

Repository files navigation

GeoGit-Viz

Store and visualize GeoGit repos in the cloud:

  • Create GeoGit repo from a local repo, GitHub, or OpenStreetMap

  • Dial-a-Diff: compare any commits in the GeoGit repo history

  • Download: get the latest version in GeoJSON, OSM XML, and Shapefile formats

Setup (tested on Ubuntu 12 or Mac OSX)

Download and build GeoGit

  • Install git

  • Download the latest version of GeoGit from OpenGeo's GitHub

      git clone https://github.com/opengeo/GeoGit.git ~/GeoGit
    
  • Install GeoGit's prerequisites (Java JDK, Maven, Jetty)

  • Build GeoGit / run all tests with

      cd ~/GeoGit/src/parent
      mvn clean install
    

Set up your GeoGit repo and API

Set up your database

  • Install and start MongoDB

  • Create an environment variable called SECRETKEY

Download and build this repo (geogit-viz)

  • Download geogit-viz from GitHub

      git clone https://github.com/CityOfBoston/geogit-viz.git ~/geogit-viz
    
  • Install Node.js and (if not included) NPM

  • Install dependencies and start server

      cd ~/geogit-viz
      npm install
      node app.js
    
  • View the map at http:https://localhost - note that no data will be visible in your initial commit

Set up GeoGit-as-a-Service

  • Install gdal and zip to create additional file formats

  • Make directories /root/github, /root/makeosm, and /root/empty

  • Describe services on /api, /push, /github, and /osm

Working with GeoGit

  • If you have a shapefile, OSM XML, Spatialite, or PostGIS database, you can set up a local GeoGit repo

  • Stop any related GeoGit web API process before importing, adding, or committing data to a repo

  • Import and commit data to your GeoGit repo. The response after 'geogit commit' will let you know if any points were added, modified, or removed.

      cd ~/mygeodata
      geogit osm import ../geogit-viz/osmoutput.osm
      geogit add
      geogit commit -m "updated geodata from server"
    
  • You won't see changes on the geogit-viz map until your second commit. Until then, you can verify the API is working at http:https://localhost:8080/geogit/log

Work with a GeoGit repo on the web

Pushing to a new repo

Cloning an existing repo

  • Find a project's GeoGit URL (for example, http:https://geoginger.com:8080/geogit )

  • Clone the GeoGit repo from the server to a local directory

      geogit clone GEOGIT_URL /Users/username/repodirectory
    

Track a service on ArcGIS Server

  • geogit-viz has two example updaters which save ArcGIS REST API service data as OSM-format XML files (/update_from_gis and /update_dev_projects)

Import a repo from GitHub

Are you already sharing maps on GitHub? GeoGit can import your GeoJSON files into a GeoGit commit history.

  • Register an OAuth application on GitHub: https://github.com/settings/applications/new

  • Add your OAuth keys as environment variables GITHUBCLIENTID and GITHUBCLIENTSECRET

  • Put the script inside user/project111 directory or set repo in generatefromgithub.py to 'user/project'

  • Create and populate the repo using this script

      python3 generatefromgithub.py
    
  • Apply future updates using this script:

      python3 updatefromgithub.py
    

Applications

  • GeoGit script keeps track of changes to the city's data via ArcGIS REST API

  • Show changes to a dataset or a data-collection project over time

  • Track changes to OpenStreetMap

  • User exports data in preferred format

  • User can retrieve all changes since their download by sending a commit ID to the JSON API

  • User can clone a GeoGit repo and use it to keep sources of a TileMill map in sync with the GeoGit repo