Giter VIP home page Giter VIP logo

sc-photo-service's Introduction

StreetComplete

StreetComplete is an easy to use editor of OpenStreetMap data available for Android. It can be used without any OpenStreetMap-specific knowledge. It asks simple questions, with answers directly used to edit and improve OpenStreetMap data. The app is aimed at users who do not know anything about OSM tagging schemes but still want to contribute to OpenStreetMap.

StreetComplete automatically looks for nearby places where a survey is needed and shows them as quest markers on its map. Each of these quests can then be solved on site by answering a simple question. For example, tapping on a marker may show the question "What is the name of this road?", with a text field to answer it. More examples are shown in the screenshots below.

The user's answer is automatically processed and uploaded directly into the OSM database. Edits are done in meaningful changesets using the user's OSM account. Since the app is meant to be used on a survey, it can be used offline and is economic with data usage.

To make the app easy to use, quests are limited to those answerable by asking simple questions.

Screenshots

Download

Get it on Google PlayGet it on F-DroidDownload APK from GitHub

Quests

There are quite a few different quest types now and more will be added over time. You can see a community-managed list of all quests in the OSM wiki.

FAQ

You can find a list of frequently asked questions in the wiki.

Contributing

This is an active open-source project, so you can get involved in it easily! You can do so without any programming or OpenStreetMap knowledge! Just choose a task that you like.

Here are a few things you can do:

Also, if you like StreetComplete, spread the word! ❤️

License

This software is released under the terms of the GNU General Public License.

Sponsors

GitHub Sponsors Liberapay Patreon
Many users are currently supporting this app through GitHub sponsors, Liberapay and Patreon. If you like the app, you can join them ☺️ to support the continued development and maintenance of the app.

German Federal Ministry of Education and ResearchPrototype Fund
Within the frame of Prototype Fund round 15 (March 2024 to August 2024), the German Federal Ministry of Education and Research currently sponsors Tobias Zwick to work on StreetComplete for iOS.
Development on this app was also sponsored in round 8 (September 2020 to February 2021) of the Prototype fund, with focus on collecting more data points and on general improvements of this app.

JawgMaps
Since mid 2020, JawgMaps provides their vector map tiles service to StreetComplete for free, i.e. the background map displayed in the app.

Past Sponsors

nlnet
The NLnet foundation sponsored development on this app in three individual grants with funds from the European Commission:
Two grants given to Mateusz Konieczny in 2019 and 2021 enabled him to work on StreetComplete for about one year in total, with a focus on clearer UI and improvements on data collection. Furthermore, yet another grant enabled Tobias Zwick to work about five months in 2021/2022 on - most notably - the overlays functionality and measuring with AR.

OpenStreetMap foundation
In August 2020, the OpenStreetMap foundation funded the development of Map Maintenance with StreetComplete within the frame of the microgrants program.

sc-photo-service's People

Contributors

exploide avatar r15ch13 avatar westnordost avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sc-photo-service's Issues

Uploading fails

Hmm, when uploading the picture, the script returns a 415: File type not allowed. The file type as determined by

$finfo = new finfo(FILEINFO_MIME_TYPE);
$file_type = $finfo->buffer($photo);

is application\/x-empty.

The upload has amongst others the following headers:
Content-Transfer-Encoding -> binary
Content-Type -> image/jpeg
and in the test, a file from /storage/emulated/0/Android/data/de.westnordost.streetcomplete.debug/files/Pictures/photo1001169951.jpg was uploaded with this code:

try (OutputStream outputStream = httpConnection.getOutputStream())
{
	byte[] buffer = new byte[16384];
	int bytesRead;
	try (FileInputStream inputStream = new FileInputStream(file))
	{
		while ((bytesRead = inputStream.read(buffer)) != -1)
		{
			outputStream.write(buffer, 0, bytesRead);
		}
		outputStream.flush();
	}
}

(Reads a file and writes it as-is to the output stream)

OAuth 2.0

OSM is deprecating OAuth 1.0a and HTTP Basic Auth.

Your application was identified as making HTTP Basic Auth calls, which will stop working later this year. We are still working out a precise timeline.

Filenames

I was reminded of a reason for having filenames not generated from a counting number: Even when directory listing is off, people could mass-download the pictures with a curl-for loop.
So, if there is a really good (security? privacy?) reason to disable directory listing, then this reason is also valid for not having filenames that count up.

What do you think?

Comments

Looks very good! Can't wait to see it in action!

A few comments. I'll just cluster this in one ticket now:

  1. I am not sure why there needs to be JSON at all. Doesn't it make things more complicated?:
    upload.php - could simply return the url in plaintext or a normal HTTP error code + message on failure
    activate.php - could have a normal POST parameter for the note id and the reply is not interesting for the client (=will not be parsed), perhaps if there is an error. The error could be a normal HTTP error code + message
    Generally, it seems a little weird to get a HTTP OK 200 on an error

  2. Posting raw data to upload the picture - is this normal? I thought it would be always multipart/form-data for file upload. Not sure if this changes anything.

  3. file upload limit: I would very much like a configurable file upload limit. On my website, the maximum upload file size in PHP.ini is 128MB and I do not want to change the default there to something as low as would be a good setting for this service (a few MB)

  4. Did you handle the case that a photo has already been moved from the tmp directory to the proper one? activate.php should in that case just return "OK", no error.

  5. Did you handle the case that the to-be-activated new picture is in one of the note comments and earlier comments or the first post in the thread also had links which are now dead because the note had been redacted/closed in the meantime but reopened later? (activate.php should still return "OK" and activate just the new one, ignore the rest)

  6. Photos of redacted notes should be cleaned up without considering MAX_LIFETIME_AFTER_NOTE_CLOSED_DAYS

  7. How well does the service handle if I would go about deleting this and that image manually from the filesystem (without touching the DB)?

  8. Why is the file extension saved to DB? (Because it is in the filesystem already). Hmm and actually, why is the id even saved to DB? - It's also in the name

  9. For making the file name as short as possible, perhaps a-z could also be used to count-up the filename.

  10. The service must be prepared to make all calls to the OSM Notes API with a logged in user, specifyable in the config. (because of GDPR / DSGVO the notes api will perhaps not be allowed to be used as anonymous)

  11. What seems to be missing is that the cleanup script also starts deleting photos if the max directory size exceeds the configured limit (oldest first)

  12. Finally, double check everything regarding not accepting parameters as-is from the user and preventing the possibility of a SQL injection?

Delete photos of closed OSM notes

I did not check whether it is already implemented, but possibly you can have some mechanism to clean-up old photos. (also to save space and so on…)

So:

  • if a note to a photo has been closed for, say, 3 months
  • and if the photo is older than 12 months or so

…then we can likely delete it.

Maybe this is an idea?

Move to StreetComplete?

I created a github organization "StreetComplete". Could we move this repo into the organization?

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.