Skip to content

DistributedOpenUnifiedGovernmentNetwork/mapwarper

 
 

Repository files navigation

README 
--------

Mapwarper is an open source map geo-rectification, warping and georeferencing application.
It enables a user to upload an image, a scanned map or aerial photo for example, and by placing control points on a
reference map and the image, to warp it, to stretch it to fit.

The application can be seen in use at http://mapwarper.net for public use and in library setting at http://maps.nypl.org

The application is a web based crowdsourced geospatial project that enables people and organisations to collaboratively publish images of maps online
and digitize and extract vector information from them. Users rectify, warp or stretch images of historical maps with a reference basemap,
assigning locations on image and map that line up with each other. Often these historical maps were in big paper books, and so for the first
time they can be stitched together and shown as a whole, in digital format. Users can crop around the maps, and join them together into layers.
By georeferencing the images, they can be warped or georectified to match the locations in space, and used in GIS software and other services.
One such use of these warped maps is an application that that helps people digitize, that is, trace over the maps to extract information from them.
For example, buildings in 18th Century Manhattan, details changing land use, building type etc. This application is called the Digitizer.

The application runs as a Ruby on Rails application using a number of open source geospatial libraries and technologies, including PostGIS, Mapserver, Geoserver, and GDAL tools.

The resulting maps can be exported as a PNG, GeoTIFF, WMS, Tiles, and KML for use in many different applications.

Groups of maps can be made into "layers" that will stictch together the composite map images.

There is also a vector digitizer application that works on layers also. It uses the WFS-V  protocol and so geoserver is needed for this.

NOTE ON CODE
-----

Rails2 branch is for older rails 2.3.5 code. Master will be updated to work with latest version of rails / ruby. The digitizer component is now in it's own repository (named digitizer) and it is removed from master and later versions but is in Rails2 branch. 

For Ruby 1.9.x  - use the ruby1.9.2 branch.

SETUP
------

For Ruby 1.9.3


config/deploy.rb for capistrano users, change this as fits. Have a look and see
 how it works with shared paths, to save mapserver map files and images between deploys.

gdal - needs to be installed, again FWTOOLS good. the path to the gdal executable
 directory can be added / changed in config/environments/production.rb and/or development.rb if
It cannot find it on the PATH.

Some files you will need to put manually there, and capistrano copies across to the correct place, basically enables
the code not to have site specific stuff in svn.

config/initializers/session_store.rb.example into shared/config/session_store.rb
config/initializers/mail.rb. put mail.rb into shared/config folder
config/environments/production.rb again, into shared/config folder
config/database.yml.production into shared/config folder
see deploy.rb for details

create folders shared/system/mapimages/src and /dst and /dst/png

(or if you are not using capistrano, public/mapimages/src  public/mapimages/dst public/mapimages/dst/png)

database - standard rails db migrate should do the trick. Has to be POSTGIS database.
make sure you login as the admin set up in the migration 010 and use this to create a new user, and use this to disable this initial default admin

be fine. Change the database.example file to your database.yml 

imagemagick required for paperclip and thumbnail handling....

---------
replace GOOGLE_MAPS_KEY in production.rb to your own


Other optional config options put in you environment files
MAX_DIMENSION =  2000  #max dimension width or height for an upload. Otherwise it will get resized to fit this max size
MAX_ATTACHMENT_SIZE = 5.megabyte #max upload file size
GDAL_MEMORY_LIMIT = 20 # max memory used for gdal_warp, may keep some servers sweet
if you comment these out, then no constraints are used
--
tim waters (tim_at_geothings.net)

---


Briefly - to get the website up on a 12/14 Ubuntu machine:

The database should be a postgresql extension PostGIS enabled database

There are a number of libraries that need installing
sudo apt-get install build-essential
sudo apt-get install libxml2-dev
sudo apt-get install libxslt-dev
sudo apt-get install imagemagick
sudo apt-get install libmapserver1
sudo apt-get install libg
sudo apt-get install gdal-bin
sudo apt-get install ruby-mapscript

You should use the https://github.com/timwaters/mapwarper/tree/ruby1.9.1  branch

1. install rvm
2. rvm install 1.9.3
3. rvm use 1.9.3
4. rvm gemset create warper
5. rvm gemset use warper
Either:
6. rvm rubygems 1.8.25  (to force the rvm to use 1.8.25- there are other ways of doing this also. 
OR 
6. gem update --system 1.8.25  (I did it this way)

7. bundle install
8. bundle exec script/server

Releases

No releases published

Packages

No packages published

Languages

  • HTML 40.0%
  • Ruby 25.4%
  • CSS 15.7%
  • JavaScript 11.8%
  • Python 7.0%
  • Makefile 0.1%