Giter Club home page Giter Club logo

mapknitter's Introduction

MapKnitter

Code of Conduct Build Status codecov Join the chat at https://publiclab.org/chat first-timers-only-friendly View performance data on Skylight

Use Public Lab's open source MapKnitter to upload your own aerial photographs (for example, those from balloon or kite mapping: https://publiclab.org/wiki/balloon-mapping) and combine them into:

  • Web "slippy maps" like Google Maps
  • GeoTiff
  • TMS
  • High resolution JPEG

demo

Table of Contents

  1. Architecture
  2. Installation
  3. Logging in when running locally
  4. Running tests
  5. Bugs and support
  6. Developers
  7. Staging infrastructure and testing
  8. License
  9. MapKnitter in depth

Architecture

MapKnitter is broken into three major components:

  1. Map user interface
  2. Application
  3. Exporting system

Component 1 has been broken out into a new Leaflet plugin, Leaflet.DistortableImage, which allows for client-side, CSS3-based distortion of images over a Leaflet base map.

Component 2 is a Ruby on Rails application which is the core of what you've looked at. It stores images, image corner locations, annotations, map details, and user accounts.

Component 3 is a set of calls to an external application, MapKnitter Exporter, which performs the distortions and geolocations and produces export products like GeoTiff, TMS, JPG, etc. The external exporter service is built in a small Sinatra app at mapknitter-exporter-sinatra using the mapknitter-exporter gem. Requests for exports are sent and progress is tracked using the API.

Installation

Please consider which installation method you prefer. Cloud Installation requires fewer steps and is platform agnostic, but you may value working from your terminal, for familiarity, more.


Cloud Installation

Cloud installation is possible with GitPod using this link and is a fully-automated process:

https://gitpod.io/#https://github.com/publiclab/mapknitter


Standard Installation


Prerequisites for Standard Installation

Make sure you have the 3 prerequisites below installed before moving forward with the Installation Steps.

Instructions are for an Ubuntu/Debian system. Varies slightly for mac/fedora/etc.

macOS 10.14 users may need this: https://silvae86.github.io/2018/07/05/fixing-missing-headers-for-homebrew-in-mac-osx-mojave/

  1. MySQL - Database
  2. RVM - Ruby version manager
  3. Yarn - Package manager

MySQL

macOS and Linux users, please reference MYSQL.md instead.

  1. Install MySQL:
$ sudo apt-get install mysql-server
  1. Install application-specific dependencies:
$ sudo apt-get install bundler libmysqlclient-dev imagemagick ruby-rmagick libfreeimage3 libfreeimage-dev ruby-dev libmagickcore-dev libmagickwand-dev
  1. (Optional): For exporting, you'll need GDAL >=1.7.x (gdal.org) as well as curl and zip-- but these are not needed for much of development unless you're working on the exporting features.
$ sudo apt-get install gdal-bin python-gdal curl libcurl4-openssl-dev libssl-dev zip

==================

RVM

This is for RVM, but the alternative, rbenv, also works (instructions not listed here). Don't install RVM if you already have rbenv!

  1. Install RVM: (http://rvm.io)
$ curl -L https://get.rvm.io | bash -s stable
  1. At this point during the process, you may want to log out and log back in or open a new terminal window. RVM will then properly load in your environment.

    • Ubuntu users only: you may need to enable Run command as a login shell in Ubuntu's Terminal under Profile Preferences > Title and Command. Then close the terminal and reopen it.
  2. Use RVM to install version 2.4.6 of Ruby:

    • macOS Big Sur users only: You may encounter a Error running '__rvm_make -j8' compilation error while installing Ruby with RVM. Run export warnflags=-Wno-error=implicit-function-declaration and then retry the installation command below. if you still encounter issues, this thread provides very helpful suggestions.
$ rvm install 2.4.6

==================

Yarn

We use Yarn as our package manager, and it is available through npm.

  1. Install npm:
$ sudo apt-get install npm
  1. Ubuntu users only: you may need to also install the nodejs-legacy package, as due to a naming collision, some versions of Ubuntu already have an unrelated package called node. To do this, run:
$ sudo apt-get install nodejs-legacy
  1. Once npm is installed, you should be able to use it to install Yarn:
$ npm install -g yarn

NOTE: Refer to this Stack Overflow question in case npm throws permission errors.

==================

Installation Steps

You'll need Ruby v2.4.6 (use your local ruby version management system - RVM or rbenv - to install and set up locally).

  1. Fork the repo from https://github.com/publiclab/mapknitter
  2. Clone the forked repo into any fresh, temporary folder with git clone https://github.com/your_username/mapknitter.git
  3. Change your working directory into the root folder you just cloned locally with cd <folder-name>
  4. Add upstream with git remote add upstream https://github.com/publiclab/mapknitter.git
  5. Install gems with bundle install. You may need to run bundle update if you have older gems in your environment.
  6. Copy and configure config/database.yml from config/database.yml.example using a new empty database you've created.
  7. Copy and configure config/config.yml from config/config.yml.example. For now, this is used for adding the Google Maps API Key configurations and a path for logging in when running locally. Both are optional.
  8. Initialize database with bundle exec rails db:setup
  9. Enter ReCaptcha public and private keys in config/initializers/recaptcha.rb (copied from config/initializers/recaptcha.rb.example). To get keys, visit https://www.google.com/recaptcha/admin/create
  10. Install static assets (like external javascript libraries and fonts) with yarn install
  11. Start rails with bundle exec rails s and open http://localhost:3000 in a web browser. For some, just rails s will work; adding bundle exec ensures you're using the version of passenger you just installed with Bundler.

==================

Installation video

For a run-through of the Prerequisites and Installation Steps listed above, you can watch the installation video at:

http://youtu.be/iGYGpS8rZMY (it may be slightly out-of-date but gives an helpful overview of the entire installation process.)


Windows Installation

We recommend either working in a virtual environment or on a dual-booted system to avoid dependency issues. In addition, the Unix operating system works smoother with Ruby on Rails. Using a Linux or macOS will not only benefit you now with the Mapknitter project, but will also make your life easier while working on other Ruby projects in the future.

  1. Dual Booting
  2. Setting Up a Linux Virtual Environment

Logging in when running locally

Because MapKnitter uses a remote, OpenID login system that depends on PublicLab.org, it can be hard to log in when running it locally. To get around this, we've created a local login route that requires no password:

You can log in locally at the path http://localhost:3000/local/USERNAME where USERNAME is the login name of a user saved on your database.

For this to work:

  • You will need to have copied and configured config/config.yml from config/config.yml.example.

  • The user has to be an existing record. For your convenience, we have added two user accounts in seeds.rb to make their corresponding paths available in development after installation:

# basic account path - http://localhost:3000/local/harry
# created from:
User.create({login: 'harry', name: 'harry potter', email: '[email protected]'})

# admin account path - http://localhost:3000/local/albus
# created from:
u_admin = User.create({login: 'albus', name: 'albus dumbledore', email: '[email protected]', role: 'admin'})

Running tests

When you try to run tests in MapKnitter, you can run the default Rake tasks, such as:

rails test:unit rails test:controllers rails test:integration

or simply:

rails test

Running tests of a specific file:

rails test test/unit/some_file.rb

Running a single test from the test suite:

rails test test/functional/some_file.rb:[line number of the test]

Bugs and support

To report bugs and request features, please use the GitHub issue tracker provided at https://github.com/publiclab/mapknitter/issues

For additional support, join the Public Lab mailing list at http://publiclab.org/lists or for urgent requests, email [email protected]

For questions related to the use of this software and balloon or kite mapping, the mailing-list page above links to the "grassrootsmapping" discussion group.

Code of Conduct

Please read and abide by our Code of Conduct. Our community aspires to be a respectful place both during online and in-person interactions.

Developers

Help improve Public Lab software!

Staging infrastructure and testing

In addition to automatic testing with Travis CI, we have a branch (unstable) that is set to auto-build and deploy to a staging instance. This instance includes a copy of the production database and is intended for experimenting or debugging purposes in a production-like environment. We also have a stable build at https://stable.mapknitter.org/ which builds off of our main branch. Any commits or PRs merged to the main branch will trigger the stable server to rebuild, and you can monitor the progress at https://jenkins.laboratoriopublico.org/


License

MapKnitter 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.

MapKnitter 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 MapKnitter. If not, see http://www.gnu.org/licenses/.


MapKnitter in depth

MapKnitter is a free and open source software created and run by Public Lab. MapKnitter is hosted through a donation of server space by Rackspace.

MapKnitter can make maps from any image source, but it particularly lends itself to making maps with balloons and kites. The manual process of making maps with MapKnitter differs greatly from automated aerial imaging systems. In those systems, the imaging is of higher precision and processed with spatial and telemetry data collected along with the imagery, typically at higher altitudes and with consistent image overlap in the flight path sequence.

With MapKnitter, the cartographer dynamically places each image and selects which images to include in the mosaic. However, the approaches are similar in that they use some type of additional information (usually pre-existing imagery of a lower resolution) as a reference, and that they are bound to specific cartographic elements such as map scale and map projection.

mapknitter's People

Contributors

alaxalves avatar anishshah101 avatar benweissmann avatar cesswairimu avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar divyabaid16 avatar edsonmendieta avatar faithngetich avatar govindjeevan avatar gr455 avatar grvsachdeva avatar icarito avatar igniteeng000 avatar justinmanley avatar jywarren avatar kaustubh-nair avatar keshavsethi avatar peculiare avatar rarrunategu1 avatar sagarpreet-chadha avatar sakshi-2412 avatar sashadev-sky avatar sidharthbansal avatar singhavs avatar stefannibrasil avatar uzay-g avatar vidurangaw avatar vladimirmikulic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapknitter's Issues

separate title and URL fields in map creation

this will hopefully make for better URLs rather than automatically generating them. JavaScript could monitor changes to the title field and auto-fill the URL field, swapping "-" for spaces/punctuation and removing "and" and "the", but prompting the user to enter/edit/approve the final URL.

Login consolidation

There are currently two places on the home page where users can login.

multiplelogins

The login link in the upper right-hand corner sends the user's auth request to the PublicLab OpenId server and then returns the user to the MapKnitter homepage once the user has successfully authenticated.

The login link the upper left-hand corner doesn't transmit the user's auth info to Public Lab, it's just a plain redirect to the PublicLab homepage. In addition, it doesn't bring the user back to where they started once authentication is complete. This is non-intuitive behavior.

The link in the upper right-hand corner is more recent (I did a bunch of work on it over the summer). As far as I can tell, it's superior to the old login link, except for anonymous login functionality (which it doesn't currently support).

We should port anonymous login to the new login form and then remove the old login form.

second page of / paginated maps broken

@patcyole sez: I also got this when I tried to move to next page, going to page 3:

TypeError in Maps#index
Showing /home/warren/mapknitter2/app/views/maps/index.html.erb where line #62 raised:
wrong argument type nil (expected String)
Extracted source (around line #62):
59: | <%= map.location %>
60: 

61:

62: <%=raw truncate(markdown_to_html(map.description),:length =>200) %> 63: <% if !map.description %>no description<% end %> 64: 65:

Rails.root: /home/warren/mapknitter2 Application Trace | Framework Trace | Full Trace app/helpers/map_helper.rb:5:in `to_html' app/helpers/map_helper.rb:5:in `markdown_to_html' app/views/maps/index.html.erb:62:in `block in _app_views_maps_index_html_erb__2959561373103988946_28118360' app/views/maps/index.html.erb:41:in `_app_views_maps_index_html_erb__2959561373103988946_28118360' app/controllers/maps_controller.rb:11:in `index' Request Parameters: {"page"=>"3"} Show session dump Show env dump Response Headers: None

mapknitter2 issues screenshots images export_page_4

embedding maps with annotations

I am trying to embed the map-knitter preview with the annotation tool.
I am also looking for a more simple way to embed the web viewer of the map (like the map-knitter preview) to the website, overlaid on GoogleMaps or OSM.
there two problems - when i press the web viewer button here: http://mapknitter.org/map/view/vadi-asbestonim , the page never loads, and when I try the open layers button, the page loads but the map is blank, this happens with other maps as well.
last thing - There is spam and a change of location in some maps - what can I do to change it? http://mapknitter.org/map/view/beit-safafa

Displaying modal for uploads

Currently dropping images to map brings up the modal, should dropping images on the map just hide the upload interface(modal) and display them only in case of error occurred in file upload. Access to the upload interface can be provided with the same upload button showing the list of images.

easier way to move map's initial position

currently if you've placed an image or two, it's hard to move them to an entirely new place. Deleting them and moving, then re-starting can work, but the "named" map location may remain on the original place. This needs some thorough user interface thinking.

no preview for maps

screen shot 2014-07-14 at 7 13 13 pm

many times i don't get preview for map, in the preview page in MapKnitter

spam map descriptions

screen shot 2014-07-01 at 4 49 48 pm

Not map related comments, such as:
comment6, premature ejaculation gp, kaysnd, premature ejaculation ginseng, %]]], cheap viagra next day delivery, 0826, premature ejaculation hypnosis download, gznkyj, cheap viagra new zealand, zuflij, cheap viagra online usa, 6620, premature ejaculation prevention tips, 14979, premature ejaculation percentage, 8-]], premature ejaculation homeopathy treatment, 48420, premature ejaculation patient co uk, iicye, premature ejaculation information, ezvp, cheap viagra levitra cialis, lqhqt, premature ejaculation in teenagers, 36541, cheap viagra melbourne, 8-P, premature ejaculation medicine in india, jclu, cheap natural viagra, zel, premature ejaculation in men over 50, 516381, premature ejaculation lloyds pharmacy, %[[[,

Best browser & settings for MapKnitter? Kitty Currier to stewart

Kitty Currier
to stewart
Greetings,

I'm having problems using MapKnitter and am wondering if this is due to browser issues on my end, internet connectivity, or something else. I just created the user name "kapmappers" and started a map that currently has two images.

Using Chrome (v. 36.0.1985.125 m), when I open my map and click on the "edit" button, the tab hangs and eventually is killed by the browser. Using Firefox (v. 31.0) I was able to upload a couple images and manipulate them a bit, though MapKnitter seems to behave oddly (e.g. photos disappear unexpectedly, and I can't find them). This could be user error, but I suspect it's more, as when I tried to access MapKnitter from a different computer using the same two browsers, I couldn't get my map to open on either of them, at all.

Do you have any suggestions? Both computers I tried were connected via decently fast ethernet connections, so I don't think that would have caused my problems.

Thanks,
Kitty

export problem - no way to adjust resolution

I just tried to export the map Katamon-1946 and it exported half the image. I tried to reduce resolution for a new export, though anyway it wasn't high (~26), but the "adjust" button wasn't responding. well, it was responding but it didn't give me the option to adjust -

this is what I see when i press adjust:
screen shot 2014-07-14 at 7 08 37 pm

show "spiderweb" lines between auto-matched points in 2 overlapping images

if it's possible to identify matching interest points between two images, on the fly (client side would be AWESOME), then as someone drags an image, as it overlaps a neighboring image, the interface could try to find matches between the two images, and could draw spiderwebby red lines between possible matches, to help the user. It might even be possible to make those matches slightly "magnetic" if you know what I mean?

Base Layer Not displayinig

This is an issue for Amy Soyka:
her base layer isn't displaying. she's using:

CHROME VERSION
35.0.1916.153 m
OS VERSION
Windows NT: 6.1 SP1 (Windows 7)
mapknitter

<1cm/px maps fail to export; rounding problem

As noted in email:
Thanks Jeff. Interesting issues in results from this try:
http://mapknitter.org/map/view/livermore-ca-test-with-pl-mobius-infragram-point-and-shoot-on-parrot-ar-drone-2-0
Exports as jpeg and webviewer seem null or empty.
Edit map initially shows locked set of images as displaced, but seem to line up if pan in the editable map window.
All, may be function of the very low altitude images. Can't zoom in more to place them better. I'll note this in GetHub, but may just be due to this extreme case.

rdoc should be a dependency

I'm trying to get MapKnitter set up and ran into some issues. I tried to run rake --tasks but kept getting the following error:

rake aborted!
LoadError: no such file to load -- rdoc/task
/home/justin/prog/mapknitter/Rakefile:8
/home/justin/.rvm/gems/ruby-1.8.7-head/bin/ruby_executable_hooks:15
(See full trace by running task with --trace)

I was able to fix it by installing rdoc:

gem install rdoc

rdoc should be listed as a dependency in the README file. I'll add it at some point in the next few days and submit a pull request. I'm also looking in to using Bundler to make MapKnitter installation easier.

Let me know if there are specific version requirements for rdoc.

annotation UI requests

Filing for @bronwen9
When adding annotation, it should be possible to

  1. have a bigger field for adding text
  2. prompt to add a picture or video, explain that it already has to be online somewhere, and give an example link format.
  3. once an annotation is saved, have an option to edit the annotation. Currently, it has to be deleted and a new one added.

troubles exporting

I just tried exporting this edited map http://mapknitter.org/maps/vadi-asbestonim
and it seemed to do the job, it got stuck in warping 10-15. didn't move for a while, and at a certain moment I saw a message that said "ajax failed" that appeared for two seconds on the same line - warpping 10-15 (ajax failed) or something like that.

Upload modal to list uploaded images.

Should we have the upload modal show the list of uploaded images. This would be especially useful when there are a lot of images, providing info like locked, hidden or anything that would be relevant. Options to delete images could also be provided using the in the list.

Edit:
Comments from research note:

"Another thing is that as we transition to just showing all images for your viewport, rather than having people create a map which "contains" images, the list of images may just be those currently shown in your viewport, which could update whenever you move the viewport. This does complicate ordering (which then has to be ordered in relation to any nearby image... the order index numbering would have to contain all images globally in MapKnitter), but we can probably put off thinking too hard about that for the time being since I don't think we have someone working on ordering. Perhaps at that time, we'd allow you to order upon assembling a set of images to export, and store just local (not global) order in the Export record. Or, we could (gasp) use decimals for order, and just allow images to be ordered with near-infinite precision, never having to "run out of integers" when ordering, the way CSS breaks down. Perhaps we could use a rough starting order # based on extent, which maps global size to some initial order decimal." - jywarren

"As we get into the map annotations with embedded pictures/notes/audio, some sort of file management zone seems to become important. Maybe the map image zone isn't the place to play with that.
you'll have to sell me on the idea of only listing images in the current window area-- it sounds like a "bouncy" menu that will change as I move around the map and drive me kinda nuts with its rapid movement. I'm thinking of menus on phones that change between the time I think to touch them and when my finger gets there (think Google Maps suggestions). I understand that when people get to lots and lots of images in Mapknitter a "master list" may get a bit unwieldy. I think that can be manageable if the correspondence between image in map and image in list is maintained by highlighting images on the map when clicking on the list and vise versa." - mathew

Gsoc update link

Upload vector data

A long requested feature has emerged again: the ability to upload KML or CSV files to mapknitter to really use it as a presentation / information synthesis platform. Case in point, Staten Island's North Shore Waterfront Conservancy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.