{"id":13481857,"url":"https://github.com/OSMCha/osmcha","last_synced_at":"2025-03-27T12:31:43.288Z","repository":{"id":31992661,"uuid":"35563198","full_name":"OSMCha/osmcha","owner":"OSMCha","description":"Python package to detect suspicious OSM changesets","archived":false,"fork":false,"pushed_at":"2024-02-23T21:06:46.000Z","size":229,"stargazers_count":42,"open_issues_count":8,"forks_count":25,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-06-11T17:25:49.596Z","etag":null,"topics":["gis","openstreetmap","osm","qa"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OSMCha.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-05-13T17:21:17.000Z","updated_at":"2024-06-08T17:23:55.000Z","dependencies_parsed_at":"2024-01-05T23:45:07.594Z","dependency_job_id":"f17a9528-db63-44fc-864e-90717d61ac52","html_url":"https://github.com/OSMCha/osmcha","commit_stats":{"total_commits":151,"total_committers":15,"mean_commits":"10.066666666666666","dds":"0.35761589403973515","last_synced_commit":"bbe9b451d76f40a27672206c0fac485106b93648"},"previous_names":["osmcha/osmcha","willemarcel/osmcha"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSMCha%2Fosmcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSMCha%2Fosmcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSMCha%2Fosmcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSMCha%2Fosmcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSMCha","download_url":"https://codeload.github.com/OSMCha/osmcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222251967,"owners_count":16955934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gis","openstreetmap","osm","qa"],"created_at":"2024-07-31T17:00:56.820Z","updated_at":"2024-10-30T15:31:30.135Z","avatar_url":"https://github.com/OSMCha.png","language":"Python","funding_links":[],"categories":["Tools"],"sub_categories":["Python"],"readme":"osmcha\n=======\n\nOSM Changeset Analyser, ``osmcha``, is a Python package to detect suspicious OSM changesets.\nIt was designed to be used with `osmcha-django \u003chttps://github.com/osmcha/osmcha-django\u003e`_,\nbut also can be used standalone or in other projects.\n\nYou can report issues or request new features in the the\n`osmcha-frontend repository \u003chttps://github.com/osmcha/osmcha-frontend\u003e`_.\n\n.. image:: https://badge.fury.io/py/osmcha.svg\n    :target: http://badge.fury.io/py/osmcha\n\n.. image:: https://coveralls.io/repos/OSMCha/osmcha/badge.svg\n    :target: https://coveralls.io/r/willemarcel/osmcha\n\n.. image:: https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg\n    :target: CODE_OF_CONDUCT.md\n\nInstallation\n============\n\n.. code-block:: console\n\n    pip install osmcha\n\nUsage\n=====\n\nPython Library\n--------------\n\nYou can read a `replication changeset file \u003chttps://planet.openstreetmap.org/replication/changesets/\u003e`_\ndirectly from the web:\n\n.. code-block:: python\n\n  from osmcha.changeset import ChangesetList\n  c = ChangesetList('https://planet.openstreetmap.org/replication/changesets/002/236/374.osm.gz')\n\nor from your local filesystem.\n\n.. code-block:: python\n\n  c = ChangesetList('tests/245.osm.gz')\n\n\n``c.changesets`` will return a list containing data of all the changesets listed in the file.\n\nYou can filter the changesets passing a `GeoJSON` file with a polygon with your\ninterest area to `ChangesetList` as the second argument.\n\nFinally, to analyse an especific changeset, do:\n\n.. code-block:: python\n\n  from osmcha.changeset import Analyse\n  ch = Analyse(changeset_id)\n  ch.full_analysis()\n\nCustomizing Detection Rules\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou can customize the detection rules by defining your prefered values when\ninitializing the ``Analyze`` class. See below the default values.\n\n.. code-block:: python\n\n  ch = Analyse(changeset_id, create_threshold=200, modify_threshold=200,\n    delete_threshold=30, percentage=0.7, top_threshold=1000,\n    suspect_words=[...], illegal_sources=[...], excluded_words=[...])\n\nCommand Line Interface\n----------------------\n\nThe command line interface can be used to verify an especific changeset directly\nfrom the terminal.\n\nUsage: ``osmcha \u003cchangeset_id\u003e``\n\nDetection Rules\n===============\n\n``osmcha`` works by analysing how many map features the changeset created, modified\nor deleted, and by verifying the presence of some suspect words in the ``comment``,\n``source`` and ``imagery_used`` fields of the changeset. Furthermore, we also\nconsider if the software editor used allows to import data or to do mass edits.\nWe consider ``powerfull editors``: JOSM, Merkaartor, level0, QGIS and ArcGis.\n\nIn the ``Usage`` section, you can see how to customize some of these detection rules.\n\nPossible Import\n---------------\n\nWe tag a changeset as a ``possible import`` if the number of created elements is\ngreater than 70% of the sum of elements created, modified and deleted and if it\ncreates more than 1000 elements or 200 elements case it used one of the ``powerfull editors``.\n\nMass Modification\n-----------------\n\nWe consider a changeset as a ``mass modification`` if the number of modified elements\nis greater than 70% of the sum of elements created, modified and deleted and if it\nmodifies more than 200 elements.\n\nMass Deletion\n-------------\n\nAll changesets that delete more than 1000 elements are considered a ``mass deletion``.\nIf the changeset deletes between 200 and 1000 elements and the number of deleted\nelements is greater than 70% of the sum of elements created, modified and deleted\nit's also tagged as a ``mass deletion``.\n\nSuspect words\n-------------\n\nThe suspect words are loaded from a `yaml file \u003cosmcha/suspect_words.yaml\u003e`_.\nYou can customize the words by setting another default file with a environment\nvariable:\n\n.. code-block:: console\n\n  export SUSPECT_WORDS=\u003cpath_to_the_file\u003e\n\nor pass a list of words to the ``Analyse`` class, more information on the section\n``Customizing Detection Rules``. We use a list of illegal sources to analyse the\n``source`` and ``imagery_used`` fields and another more general list to examine\nthe comment field. We have also a list of excluded words to avoid false positives.\n\n\nNew mapper\n-----------\n\nVerify if the user has less than 5 edits or less than 5 mapping days.\n\n\nUser has multiple blocks\n------------------------\n\nChangesets created by users that has received more than one block will be\nflagged.\n\nOSM Server Configuration\n------------------------\n\nIf you need to use OSMCha with another OSM server instance, you need to configure the OSM_SERVER_URL environment variable, without trailing slash. Example:\n\n.. code-block:: console\n\n  export OSM_SERVER_URL='https://www.openhistoricalmap.org'\n\nTests\n======\n\nTo run the tests on `osmcha`:\n\n.. code-block:: console\n\n  git clone https://github.com/osmcha/osmcha.git\n  cd osmcha\n  pip install -e .[test]\n  py.test -v\n\nPublishing a new version\n=========================\n\nUpdate the version number in ``osmcha/__init__.py`` and execute\nthe following commands:\n\n.. code-block:: console\n\n  python setup.py bdist_wheel\n  twine upload dist/osmcha-{version}...\n\nChangelog\n=========\n\nCheck `CHANGELOG \u003cCHANGELOG.rst\u003e`_ for the version history.\n\nRelated projects\n================\n\n* `osmcha-django \u003chttps://github.com/osmcha/osmcha-django\u003e`_ - backend and API\n* `osmcha-frontend \u003chttps://github.com/osmcha/osmcha-frontend\u003e`_ - frontend of the `OSMCha \u003chttps://osmcha.org\u003e`_ application\n* `osm-compare \u003chttps://github.com/mapbox/osm-compare\u003e`_ - library that analyse OSM features to input it to OSMCha\n\nLicense\n=======\n\nGPLv3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOSMCha%2Fosmcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOSMCha%2Fosmcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOSMCha%2Fosmcha/lists"}