From 033ad081db81491349d89ac0cbe867211ae08727 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Tue, 6 Aug 2024 13:07:28 +0100 Subject: [PATCH] refactor: update references conflator --> osm-merge --- .dockerignore | 2 +- .github/labeler.yml | 2 +- .github/workflows/docs.yml | 2 +- .gitignore | 4 ++-- Dockerfile | 10 ++++----- Makefile | 2 +- README.md | 12 +++++------ docs/Doxyfile | 4 ++-- docs/{conflator.md => osm-merge.md} | 32 ++++++++++++++--------------- mkdocs.yml | 6 ++++-- pyproject.toml | 1 - setup.py | 32 ----------------------------- tests/test_placeholder.py | 2 +- 13 files changed, 40 insertions(+), 71 deletions(-) rename docs/{conflator.md => osm-merge.md} (64%) delete mode 100644 setup.py diff --git a/.dockerignore b/.dockerignore index 37c0e38..ca992f7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,7 +2,7 @@ ** # Allow files and directories -!conflator +!osm_merge !tests !pyproject.toml !pdm.lock diff --git a/.github/labeler.yml b/.github/labeler.yml index 38c81cc..0dc59b4 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -10,4 +10,4 @@ - "mkdocs.yml" - "README.md" "version": - - "conflator/__version__.py" + - "osm_merge/__version__.py" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c255657..6c5f616 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,7 +4,7 @@ on: push: paths: - docs/** - - conflator/** + - osm_merge/** - mkdocs.yml branches: [main] # Allow manual trigger (workflow_dispatch) diff --git a/.gitignore b/.gitignore index 3aeaaa3..11c8620 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ # gdb_history TAGS -Conflator.egg-info +osm-merge.egg-info NOTES -conflator.log +osm-merge.log docs/NOTES *~ docs/html/ diff --git a/Dockerfile b/Dockerfile index 1b9900b..1d393b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Copyright (c) 2022, 2023 Humanitarian OpenStreetMap Team -# This file is part of conflator. +# This file is part of osm-merge. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,7 +12,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with conflator. If not, see . +# along with osm-merge. If not, see . # ARG PYTHON_IMG_TAG=3.10 @@ -21,9 +21,9 @@ FROM docker.io/python:${PYTHON_IMG_TAG}-slim-bookworm as base ARG COMMIT_REF ARG PYTHON_IMG_TAG ARG MAINTAINER=admin@hotosm.org -LABEL org.hotosm.conflator.python-img-tag="${PYTHON_IMG_TAG}" \ - org.hotosm.conflator.commit-ref="${COMMIT_REF}" \ - org.hotosm.conflator.maintainer="${MAINTAINER}" +LABEL org.hotosm.osm-merge.python-img-tag="${PYTHON_IMG_TAG}" \ + org.hotosm.osm-merge.commit-ref="${COMMIT_REF}" \ + org.hotosm.osm-merge.maintainer="${MAINTAINER}" RUN set -ex \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install \ diff --git a/Makefile b/Makefile index 0960dc2..6584685 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ NAME := tm-admin VERSION := 0.1.0 all: - @cd conflator ; $(MAKE) + @cd osm_merge ; $(MAKE) apidoc: force cd docs && doxygen diff --git a/README.md b/README.md index d406048..e562b01 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Conflator +# OSM Merge

@@ -23,11 +23,11 @@ Test - - Package version + + Package version - - Downloads + + Downloads License @@ -36,7 +36,7 @@ --- -📖 **Documentation**: https://hotosm.github.io/conflator/ +📖 **Documentation**: https://hotosm.github.io/osm-merge/ 🖥️ **Source Code**: https://github.com/hotosm/osm-merge diff --git a/docs/Doxyfile b/docs/Doxyfile index 2f733fa..ce4abbe 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = Conflator +PROJECT_NAME = osm-merge # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -943,7 +943,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../conflator +INPUT = ../osm_merge # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/docs/conflator.md b/docs/osm-merge.md similarity index 64% rename from docs/conflator.md rename to docs/osm-merge.md index 6143dea..f1da7da 100644 --- a/docs/conflator.md +++ b/docs/osm-merge.md @@ -1,6 +1,6 @@ # Conflator Program -Conflator is a program that conflates building footprint data with +osm-merge is a program that conflates building footprint data with OpenStreetMap data to remove duplicates. The result of the conflation process is buildings that only exist in the footprints data file. @@ -18,16 +18,16 @@ document](conflation.md). These are the nost commonly used options. - --help(-h) Get command line options - --verbose(-v) Enable verbose output - --boundary(-b) Specify a multipolygon for boundaries, one file for each polygon - --project(-p) Tasking Manager project ID to get boundaries from database - --osmdata(-x) OSM XML/PBF or OSM database to get boundaries (prefix with pg: if database) - --outdir(-o) Output file prefix for output files (default "/tmp/tmproject-") - --footprints(-f) File or building footprints Database URL (prefix with pg: if database) - --dbhost(-d) Database host, defaults to "localhost" - --dbuser(-u) Database user, defaults to current user - --dbpass(-w) Database user, defaults to no password needed + --help(-h) Get command line options + --verbose(-v) Enable verbose output + --boundary(-b) Specify a multipolygon for boundaries, one file for each polygon + --project(-p) Tasking Manager project ID to get boundaries from database + --osmdata(-x) OSM XML/PBF or OSM database to get boundaries (prefix with pg: if database) + --outdir(-o) Output file prefix for output files (default "/tmp/tmproject-") + --footprints(-f) File or building footprints Database URL (prefix with pg: if database) + --dbhost(-d) Database host, defaults to "localhost" + --dbuser(-u) Database user, defaults to current user + --dbpass(-w) Database user, defaults to no password needed ## Tasking Manager Options @@ -36,9 +36,9 @@ a Tasking Manager database. A more common usage is to use the [splitter.py](splitter.md) program to download the project boundary from the Tasking Manager itself. - --splittasks When using the Tasking Manager database, split into tasks - --schema OSM database schema (pgsnapshot, ogr2ogr, osm2pgsql) defaults to "pgsnapshot" - --tmdata(-t) Tasking Manager database to get boundaries if no boundary file prefix with pg: for database usage, http for REST API + --splittasks When using the Tasking Manager database, split into tasks + --schema OSM database schema (pgsnapshot, ogr2ogr, osm2pgsql) defaults to "pgsnapshot" + --tmdata(-t) Tasking Manager database to get boundaries if no boundary file prefix with pg: for database usage, http for REST API ## OSM Options @@ -47,7 +47,7 @@ database, the default admin levl is 4, which is commonly used for couty boundaries. This lets the user select what level of administrative boundaries they want. - --admin(-a) When querying the OSM database, this is the admin_level, (defaults to 4) + --admin(-a) When querying the OSM database, this is the admin_level, (defaults to 4) ## Examples @@ -67,7 +67,7 @@ is used as the prefix for the output files. > PATH/conflator.py -v -x pg:kenya -b 12007-project.geojson -f pg:kenya_footprints -o 12057 -d mapdb -u me This is the same except the database is on a remote machine called -*mapdb* and the user needs to be *me*. +_mapdb_ and the user needs to be _me_. > PATH/conflator.py -t tmsnap -p 8345 -b pg:kenya_foot -o pg:Kenya diff --git a/mkdocs.yml b/mkdocs.yml index a0e980d..14fdc8b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,9 +65,11 @@ plugins: nav: - Home: index.md - About: about.md - - Conflation Guide: odkconflation.md + - Conflation Guides: + - General: conflation.md + - ODK: odkconflation.md - Utilities: - - Conflator: conflator.md + - OSM Merge: osm-merge.md - Utilities: utilities.md - API: api.md - Class Hierarchy: apidocs/html/classes.html diff --git a/pyproject.toml b/pyproject.toml index 24f8b48..4506bf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,4 +106,3 @@ convention = "google" [project.scripts] osm-merge = "osm_merge.conflator:main" -#conflator = "osm-merge.conflator:main" diff --git a/setup.py b/setup.py deleted file mode 100644 index 5cd0400..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/python3 - -# Copyright (c) 2022 Humanitarian OpenStreetMap Team -# -# This file is part of Conflator. -# -# Odkconvert 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. -# -# Odkconvert 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 Odkconvert. If not, see . -# - -from distutils.core import setup - -setup( - name='Conflator', - version='0.1', - packages=[], - url='https://github.com:robsavoye/conflator.git', - license='GPLv3', - author='Rob Savoye', - author_email='rob.savoye@hotos.org', - description='Conflate OSM map data', -) diff --git a/tests/test_placeholder.py b/tests/test_placeholder.py index 8c7369f..6861e80 100644 --- a/tests/test_placeholder.py +++ b/tests/test_placeholder.py @@ -1,6 +1,6 @@ # Copyright (c) 2022, 2023 Humanitarian OpenStreetMap Team # -# This file is part of conflator. +# This file is part of osm-merge. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by