All Projects → willemarcel → osmcha

willemarcel / osmcha

Licence: GPL-3.0 License
Python package to detect suspicious OSM changesets

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to osmcha

osm4scala
Scala and Spark library focused on reading OpenStreetMap Pbf files.
Stars: ✭ 62 (+87.88%)
Mutual labels:  openstreetmap, osm, gis
accessibility-cloud
👩🏽‍🦯🦮👩🏻‍🦽👩🏿‍🦼 the platform to exchange physical accessibility data in a standardized, future-proof, easy-to-use way.
Stars: ✭ 37 (+12.12%)
Mutual labels:  openstreetmap, osm, gis
Mapsui
Mapsui is a .NET Map component for WPF, Xamarin.Forms, Xamarin.Android, Xamarin.iOS and UWP
Stars: ✭ 447 (+1254.55%)
Mutual labels:  openstreetmap, osm, gis
gazetteer
OSM ElasticSearch geocoder and addresses exporter
Stars: ✭ 93 (+181.82%)
Mutual labels:  openstreetmap, osm, gis
a11yjson
A11yJSON: A standard to describe the accessibility of the physical world.
Stars: ✭ 58 (+75.76%)
Mutual labels:  openstreetmap, osm, gis
Osmunda
An offline geocode library for android, powered by SQLite, using osm data. 离线地理编码Android库,基于SQLite,使用开放街道地图数据。
Stars: ✭ 37 (+12.12%)
Mutual labels:  openstreetmap, osm
osm-export-tool-python
command line tool + Python library for exporting OSM in various file formats.
Stars: ✭ 32 (-3.03%)
Mutual labels:  openstreetmap, gis
Delphi OSMMap
Visual control for Delphi and Lazarus to display OSM map
Stars: ✭ 27 (-18.18%)
Mutual labels:  openstreetmap, osm
mapcontrib
Thematic OpenStreetMap contribution
Stars: ✭ 63 (+90.91%)
Mutual labels:  openstreetmap, osm
cloud-tileserver
Serve mapbox vectortiles via AWS stack
Stars: ✭ 48 (+45.45%)
Mutual labels:  openstreetmap, gis
AndroidOfflineMapLibrary
Offline OpenStreet Map Library (No Internet Required) You dont have to even one-time connect!
Stars: ✭ 16 (-51.52%)
Mutual labels:  openstreetmap, osm
openfairdb
Open Fair DB is the CreativCommons Backend of Kartevonmorgen.org
Stars: ✭ 53 (+60.61%)
Mutual labels:  openstreetmap, osm
osmcz
JS mapová appka pro openstreetmap.cz (osmcz-app)
Stars: ✭ 35 (+6.06%)
Mutual labels:  openstreetmap, osm
literan-moscow
No description or website provided.
Stars: ✭ 18 (-45.45%)
Mutual labels:  openstreetmap, osm
osm-data-classification
Migrated to: https://gitlab.com/Oslandia/osm-data-classification
Stars: ✭ 23 (-30.3%)
Mutual labels:  openstreetmap, osm
NotesReview
📝 Interface for searching and resolving OpenStreetMap notes
Stars: ✭ 34 (+3.03%)
Mutual labels:  openstreetmap, osm
HMap
:earth: HMap | 基于openlayers的封装组件
Stars: ✭ 64 (+93.94%)
Mutual labels:  openstreetmap, gis
LocationMapViewer
Android App to view Locations in a map with support for gpx, kml and kmz data
Stars: ✭ 31 (-6.06%)
Mutual labels:  openstreetmap, osm
earthwyrm
Vector tile map server for openstreetmap data
Stars: ✭ 16 (-51.52%)
Mutual labels:  osm, gis
maproulette2
MapRoulette back-end / API
Stars: ✭ 46 (+39.39%)
Mutual labels:  openstreetmap, osm

osmcha

OSM Changeset Analyser, osmcha, is a Python package to detect suspicious OSM changesets. It was designed to be used with osmcha-django, but also can be used standalone or in other projects.

You can report issues or request new features in the the osmcha-frontend repository.

Installation

pip install osmcha

Usage

Python Library

You can read a replication changeset file directly from the web:

c = ChangesetList('https://planet.openstreetmap.org/replication/changesets/002/236/374.osm.gz')

or from your local filesystem.

c = ChangesetList('tests/245.osm.gz')

c.changesets will return a list containing data of all the changesets listed in the file.

You can filter the changesets passing a GeoJSON file with a polygon with your interest area to ChangesetList as the second argument.

Finally, to analyse an especific changeset, do:

ch = Analyse(changeset_id)
ch.full_analysis()

Customizing Detection Rules

You can customize the detection rules by defining your prefered values when initializing the Analyze class. See below the default values.

ch = Analyse(changeset_id, create_threshold=200, modify_threshold=200,
  delete_threshold=30, percentage=0.7, top_threshold=1000,
  suspect_words=[...], illegal_sources=[...], excluded_words=[...])

Command Line Interface

The command line interface can be used to verify an especific changeset directly from the terminal.

Usage: osmcha <changeset_id>

Detection Rules

osmcha works by analysing how many map features the changeset created, modified or deleted, and by verifying the presence of some suspect words in the comment, source and imagery_used fields of the changeset. Furthermore, we also consider if the software editor used allows to import data or to do mass edits. We consider powerfull editors: JOSM, Merkaartor, level0, QGIS and ArcGis.

In the Usage section, you can see how to customize some of these detection rules.

Possible Import

We tag a changeset as a possible import if the number of created elements is greater than 70% of the sum of elements created, modified and deleted and if it creates more than 1000 elements or 200 elements case it used one of the powerfull editors.

Mass Modification

We consider a changeset as a mass modification if the number of modified elements is greater than 70% of the sum of elements created, modified and deleted and if it modifies more than 200 elements.

Mass Deletion

All changesets that delete more than 1000 elements are considered a mass deletion. If the changeset deletes between 200 and 1000 elements and the number of deleted elements is greater than 70% of the sum of elements created, modified and deleted it's also tagged as a mass deletion.

Suspect words

The suspect words are loaded from a yaml file. You can customize the words by setting another default file with a environment variable:

export SUSPECT_WORDS=<path_to_the_file>

or pass a list of words to the Analyse class, more information on the section Customizing Detection Rules. We use a list of illegal sources to analyse the source and imagery_used fields and another more general list to examine the comment field. We have also a list of excluded words to avoid false positives.

New mapper

Verify if the user has less than 5 edits or less than 5 mapping days.

User has multiple blocks

Changesets created by users that has received more than one block will be flagged.

Unknown iD instance

Verify the changesets created with iD editor to check the host instance. The trusted iD instances are: OSM.org, Strava, ImproveOSM, iDeditor, Hey, Mapcat and iD indoor, Softek and RapiD.

If you deploy an iD instance for an organization, please let us know so we can whitelist it.

Tests

To run the tests on osmcha:

git clone https://github.com/willemarcel/osmcha.git
cd osmcha
pip install -e .[test]
py.test -v

Publishing a new version

Update the version number in osmcha/__init__.py and execute the following commands:

python setup.py bdist_wheel
twine upload dist/osmcha-{version}...

Changelog

Check CHANGELOG for the version history.

Related projects

License

GPLv3

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].