Git Product home page Git Product logo

mapswipe's Introduction

MapSwipe

The badges refer to the dev branch

Syntax & Linting Android build iOS build

Welcome to the MapSwipe app. This is the app that is distributed through mapswipe.org as well as through the Google Play and Apple stores. It was initially developed by Doctors without Borders as part of the Missing Maps project.

Main Overview

In a nutshell, here is how MapSwipe works:

  1. Humanitarian organisations set the parameters for projects through a web-based admin interface.
  2. Our backend workers process those projects and place them on Firebase. It imports them into groups that are safe for the user to cache locally on their phone (ideally 200 tiles). This image shows an example of how that grouping algorithm works.
  3. The app fetches the projects from the /projects reference in Firebase through the JavaScript SDK (don't use http requests to Firebase) and displays them to the user.
  4. The user searches those tiles and classifies them. The results are then synced back to Firebase.
  5. When a user chooses to map an area, he or she is distributed groups of the project. On completion, the user then gets badges for the distance they've mapped.

:)

Project Diagram

The following is an outline of how data typically flows and makes it into the mobile application. Most of the action happens in one of the three areas, namely the backend scripts, Firebase database, and clients.

Main overview

This application encompasses only the mobile Android & iOS clients. The role of the clients are to retrieve project information (metadata and tile information) so that volunteers can swipe through and tag them. Then, this tagging information is synchronized back to Firebase. The backend scripts (in a separate repository) are responsible for populating and processing the project information in Firebase.

Developing, Building, and Contributing to MapSwipe

If you'd like to modify and improve MapSwipe, read through the following to get familiar with the project. Please also read CONTRIBUTING.

Technology Used

  1. The app is written entirely in React Native
  2. Firebase provides the backend database. It is protected with security rules so that users and contributors to this open source project can not cause damage.
  3. The workers on the backend are running on Google Cloud and handle pre-processing and post-processing the data.

State of the project

The app was rebuilt at the end of 2018 on a recent version of react-native, and expanded to support multiple types of tasks, as well as a variety of languages.

mapswipe's People

Contributors

birnbaum2001 avatar danbjoseph avatar dependabot[bot] avatar eljocho avatar ericboucher avatar frozenhelium avatar habi avatar hagellach37 avatar hhk1 avatar jhenshall avatar kmpoppe avatar kopitek8 avatar laurents avatar mathcass avatar oiva avatar pimdewitte avatar rudloff avatar samshara avatar tahirau avatar thenav56 avatar tnagorra avatar transifex-integration[bot] 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

mapswipe's Issues

disable swipe when a tile is zoomed

depending on where you press and hold on the tiles, your finger can easily block a lot of image. being able to move your finger away would be useful here but when you try to do that the zoom is cancelled

dragging left or right cancels instantly while dragging up and down lets you move a bit (as long as its a perfect straight line, which is hard) but when your finger goes over any of the grid lines underneath its also cancelled

(moved from https://github.com/mapswipe/app-feedback/issues/41)

Scalebar (for Built Area projects)

While browsing tiles, natural patterns can make you wonder what you are actually looking at.

A scalebar, displayed on the upper border for example, could be really useful.

Offline support | "Download for later" doesn't seem to work

I recently wanted to download a chunk of tiles to help me pass the time on a flight. When I select "Download for later" under a project it first asks me for permission to download without WiFi. After giving the permission the "download for later" button is greyed out and nothing seem to happen. It doesn't seem to matter which package size I select. I kept the phone and mapswipe open for more than 10 minutes and still nothing happened.

I have never been able to download for later.
I have just reinstalled mapswipe and it didn't help.

Setup interactive tutorial

Create an interactive tutorial in the app for built area and building footprint projects, so that users learn to use the app by actually using it in a guided way. The tutorial will give them prompts of what to do, and provide feedback on their tries, depending on if they did the right thing or not.

The tutorial data will be pulled from the firebase backend like regular projects, but the data structure will also hold an attribute identifying the expected answer.

A mockup of the tutorial is visible at https://invis.io/SCQT6VN6ZJ9
Credit to Mona Yang for the design!

Not all results stored

This relates to the changes introduced in #47 and #48

Not all results are stored in firebase. With the new backend structure the client should store the result for each individual task. Currently only results for tasks are stored, where the user classified as either 1, 2 or 3. Also the 0s (no building) should be stored.

Allow a user to share or invite friends

Moved from https://github.com/mapswipe/app-feedback/issues/29

Instagram, facebook etc spread well by invite type mechanisms.

Being able to one click share to friends - "I just helped MSF fight Cholera in X with Mapswipe & MissingMaps" would be a useful tool for inviting new users.

If this ability was only tied to a project after some mapping was done, it would probably balance nicely between obnoxious and useful.

Group database writes per group

At the moment, results are uploaded one by one at the end of a group. This results in N writes in the database, which trigger at least N function calls on the server to update the user's contribution count.

To minimize network transfers and database updates (which also trigger renderings in the app), the app should upload results in a single write for each group.

Show positive feedback also for orange, red and empty tiles

The "reward" / "thank you" messages that appear after tapping a few green tiles are great.

Some tasks though have no tile to get tagged green, but still there's effort by the mapper to check that every one of them is either empty (no buildings or roads), a maybe (orange) or the imagery is not readable (cloudy or missing).

This effort should be rewarded in the same or similar way of when the user taps green. Knowing that no buildings are in one area I think it's as valuable as knowing where they are.

(Moved from https://github.com/mapswipe/app-feedback/issues/7)

Prevent race conditions between users of a same group

When 2 or more app users are working on the same group, we have seen cases where one user completes a group and uploads the results to firebase, which triggers a database update on other users' phones who are working on that group.
The app then reloads the screen and resets the group to the beginning, which is less than ideal.

This is due to react-redux-firebase keeping an open connection to firebase RTDB by default (a subscription of sorts) so that the client receives notifications of changes. We don't want that to happen within a group.

This ticket is for documentation mostly, as the fix is already written.

Awkward welcome message when signing in

If you already have an account and you sign in, the app flashes, "Welcome to MapSwipe, " as if to greet you by your username. I think at this stage in the app, the username is undefined somehow so we could fix this up or else rephrase it.

Showing the same user the same imagery sets more than once

I routinely get the same sets of imagery more than once.

I am only doing the mapping online method.

As you can see in the examples below, the only difference is that one was shown to me at 9:04 and 5 minutes later, probably 2 sets of images later, there is the exact same image. I was taking screenshots for a tutorial so luckily can prove it and not just "I swear I have seen that before... maybe not"

You will also note that they are both at the same % mapped in the set and I can confirm, it was exact the same set after this image.

img_0647-combined

Adding another type of mapping task: Count Buildings or other objects

Hey,
this is an idea how we could increase the information we get out of MapSwipe data. This would increase the value of the work the volunteers are doing and would enable better applications.

Towards a new type of mapping task

At the moment we are mostly mapping the presence of buildings using MapSwipe. This gives us a binary layer of tiles where there are settlements and tiles that are not inhabited. To get more detailed information about the distribution of population (e.g. population density) it would be interesting to explore further ways and new mapping tasks.

  • A new simple mapping task could consist of counting buildings.

What would be the improvement:

  • We would get more detailed information for each tile.
  • our previous work has shown, that tiles for which we detect more than 2 buildings are really "easy". These tasks don't require so many crowdsourced classifications. This would reduce the overall classifications, we therefore might finish projecst faster
  • Tasks where volunteers detect only 1 building are more likely to be incorrect. If we would have the information on building count, we could improve the reliability of those tasks by asking more people
  • the detailed information per task, could be used also as a better input for automated models, e.g. for building detection using machine learning (we could easily distinguish different types of tasks and provide better training samples. This could increase the quality of machine leaning methods)
  • Using building count we would be one step closer to a population density map. Still not perfect, but we would have a better input for spatial sampling methods applied by MSF or other users of MapSwipe data. Also in the HOT Tasking Manager we could prioritize areas using the number of estimated buildings per task.

How could it be done? What would we need to change?

1. Approach: Change nothing, but the description:

  • we already save our answer as integer values. Building = 1, Maybe = 2, Bad = 3.
  • we could use the same approach of tapping x-times to indicate the number of buildings
  • for example tapping once could be referred to as "1 building", tapping twice to "2 buildings", tapping three times to "more than 2 buildings"
  • we would only need to change the description that is shown to the users when they start their mapping session
  • we would need to think about the classes we are interested in? How many classes do we want?

2. Approach: A new type of input to add the building count:

  • whenever a volunteer tapped once to indicate the presence of a building, another input field would be available.
  • e.g. by tapping with two fingers you could increase the number of building (there might be more ways to do it)
  • or there would be an input field for integer values

3. Approach: A completely new type of interaction to map the building count:

  • currently we use tapping as our main interaction, however we might also think about something different
  • what about writing a number or symbol with your finger within the corresponding tile (think about how you would solve a sudoku on your smartphone, e.g. tap on the tile and then just write the number with your finger)
  • if you would like to classify an image as bad imagery you could just write an "X" with your fingers, for maybe a question mark "?"
  • in my opinion this could be really funny, but let's still it would require the most development on the client compared to the other approaches.

Let's start with a test region and prototype

  • let's test the effect of such a new approach for a small region, for which we have some reference data (does anyone of the data users has good population density information for a test region we could start with?)
  • this could help us to estimate the added value of this approach

So this is just a first idea. I wanted to share it here and foster the discussion, what the next MapSwipe should look like. MapSwipe was built to tackle some of the problems we had towards mapping areas like South Kivu. Let's think about our current problems and how an enhanced MapSwipe could help to solve them.

Best regards,
Benni

Save additional information "group_result" information when users submit their contributions

Originally submitted by @Hagellach37


When using the MapSwipe app, users work on a group of tasks. However, when uploading their contributions, individual "results" are saved in firebase. Each result consists of information, which refer to a specific task. Information that a group has been completed by a user are not explicitly stored in firebase as a "group_result" or similar things. Regarding groups, the only thing that happens is that the *CompletedCount" of a group is increased. But, no username or timestamp is added in this step. We therefore can't umambigiously match users and the groups they completed. Here's an example for a result:

key value
device "E2A6ACC2-850A-4192-BF99-00D6F2940889"
id "18-129743-119918"
item "BUILDINGS ONLY"
projectId "13511"
result 2
timestamp 1522859450025
user "c09QHjeOHXPpWliefir5yVKDPyo1"
wkt ""

To address this issue I propose to save an additional element in firebase: A group_result. This would not affect the existing workflow and could be added in parallel to the existing transfer of the results. This element could look like this:

key value
device "E2A6ACC2-850A-4192-BF99-00D6F2940889"
id "101"
item "BUILDINGS ONLY"
projectId "13512"
results {...}
timestamp 1522859450025
user "XXXXXXXXXXX"
xMax "157546"
xMin "157514"
yMax "133569"
yMin "133567"

The results attribute could be an additional place, where we could store the result information for this group.

Adding this new feature would allow us easily derive all contributions of individual users (including "no building" classifications which are not stored in the database), which is an important input to generate more reliable user statistics. Furthermore, we could use the group result to provide feeback to users.

Setup automated testing

Using jest or something equivalent for some key features to prevent major issues and regressions.

Mapswipe for iPad?

The current version is scaled on iPad as the app is build for phones only. Could you release an iPad version with more satellite tiles to tap on every swipe?

Back to level 1, -247km²

Hi,

I recently reinstalled the app on my phone.
I logged in with my account, I was already level 5.
After a few swipes, I see I am back to level 1 with a negative numver of swipes remaining.
Any idea?

img_20180729_183035

Support finer tracking of user involvement?

HOT has asked about the ability to track which users participate in what project, with the aim to provide more fine grained feedback to corporate partners, which would help increase their engagement.

Add "MissingCount" attribute to groups to address data quality issues

Originally submitted by @Hagellach37


When loading new tasks in MapSwipe users always request a group of tasks. For each project a user will download the group, which has been completed least. I propose to add another attribute "MissingCount" instead, to download the group, which still needs the most contributions.

This would enable us to prioritize specific groups for which we know, that data quality has been an issue. When implementing this change, we could easily add futher iterations to individual groups (e.g. groups with bad quality after 3 passes and therefore further users should have a look at them.). At the same time groups with a high quality would not be affected. Implementing this new feature would therefore help us a lot in addressing MapSwipe data quality issue and would help us to produce more reliable data.

Currently, the following information are stored in firebase for each group of MapSwipe tasks (distributedCount and reportCount are not used.):

key value
completedCount 4
count 99
distributedCount 0
id 101
projectId "13512"
reportCount 0
tasks {…}
xMax "157546"
xMin "157514"
yMax "133569"
yMin "133567"
zoomLevel 18

This information is requested by the app in this section of the code.

fetch(`${config.firebaseConfig.databaseURL}/groups/` + projectId + '.json?orderBy="completedCount"&limitToFirst=' + groupCount + '')

Finally, when a user completed a group, the information of the respective group is updated. This happens here.

group.completedCount = group.completedCount + 1;

Still it would be good to keep this information. But, we should add another transaction which reduces the MissingCount. E.g. like this:

group.MissingCount = group.MissingCount - 1;

These changes would also affect the project import. However, the required action would be minimal. We just need to set the MissingCount to a start value, e.g. 3 when creating the groups.

Issue loading map tiles

I'm having trouble loading map tiles on my device. For reference, here's a screenshot of what I see on my device where instead of overhead aerial photos, I just see blank space.

I've tried a few different things to troubleshoot this so far such as:

  • Forcing quit the app and reopening
  • Hitting the "Bugs? Clear Project Data"

but neither have resolved this for me.

As a user of the app, I'm happy to try more troubleshooting instructions if you have suggestions.

I didn't see an version in the app to report at all. I'm running an Android device and I can provide more detailed model and OS information if requested.

2017-05-26 10 19 27

Connect CI to google playstore deployment

For the production version.
We could do 2 steps:

  • deploy to a limited "testers" group,
  • then deploy to all users once the first group has briefly checked that no obvious problems remain.

Review permissions for Android (and iOS)

It seems that we're asking for Phone permissions in the mobile app but I don't see a real need for it.

We should verify that we don't need them and then see about removing them.

Results of *unfinished* groups are stored

This relates to the changes introduced in #47 and #48

I first started to map for Project A, but then stopped it and switched to Project B. I finished Project B and uploaded results to firebase. However, also the unfinished results of Project A have been added to firebase.

Results should only be uploaded, after finishing a group. If you stop mapping halfway, those results should not be uploaded to firebase.

Preload imagery

We should be able to preload images while the user is looking at other ones, to make the experience a bit smoother.

Setup Change Detection project type

This is mostly a tracking issue so we can link commits to something.

The Change Detection (CD) project type allows comparing two sets of imagery (a before and after image) and decide whether changes of some sort (new buildings, flooded areas, deforestation...) are visible.

Setup app translations

The app should be available in more than just English. We should ideally use https://transifex.com as a translation platform, as it is already the one used by the HOT/OSM communities (for instance for learnosm.org)

There are a few translation libraries for react-native, but none seems like a direct match for transifex.

My first research brought up the following thoughts:

  • we could use react-native-language to select the language from the phone's settings
  • https://github.com/i18next/react-i18next seems a good candidate for localization, despite a heavy bias towards using locize.com for actual translations. It looks like file formats are compatible with transifex though, so setup should be fairly easy
  • https://github.com/yahoo/react-intl is another option, though it looks like it results in very heavy code
  • https://ttag.js.org looks cool and plugs into very well established gettext tools, but only has a very small community so far

I Always get the same group

This relates to the changes introduced in #47 and #48

After finishing a group, I get the same tasks again. This might be related to the changes in the back end. In the back end we should query using the requiredCount attribute.

Groups with the highest requiredCount should be displayed.

Upgrade React-Native and dependencies

Submitted by @ericboucher and copied into public repository


The react-native version is quite old. It is important to update it. It will also be a good opportunity to try and use clean node-modules again.

In particular, we recently tweaked RCTSRWebSocket.m and RCTScrollView.m to work with more recent versions of iOS, which we shouldn't have to do.

Almost all of our iOS users have iPhones 9.3 or up.

Upgrade react-native to 0.61

...or whatever is most recent at the time.

As #14 has shown, it becomes very hard to maintain RN code when the versions of our main dependencies fall behind the current RN by too many revisions.

facebook produces roughly one big release per month, this ticket should almost be a recurrent one. We should aim to stay within 2-3 "major" versions of their current release at most. As I write this, there are already over 15 versions to go through...

tiles dont show the full image

if a building is right on the border between two tiles then its very easy too miss it from the main screen. they seem to be cropped slightly for some reason

its not a problem in this example since you can see other buildings but its happened in another project where there was a single hut on its own and i would have missed it if i hadnt zoomed in to check

1

(copied from https://github.com/mapswipe/app-feedback/issues/42)

publish app to F-Droid

F-Droid is an android app store for free and open source software.

It would be nice to have your app there, so people who don't want to have google play store on their phone can use it.

Test the app on slow network connection

Many users are expected to have a slow network connection when using the app. This tends to lead to many bugs that developers often miss as they often use a very high speed connection when developing.

The app development environment (or even better the CI test suite) should include a network speed throttling mechanism, so that developers can easily test the app's behaviour on slow networks.

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.