Commit ad4019de authored by Jgiannelos's avatar Jgiannelos
Browse files

Update README

parent ce262309
Pipeline #1470 passed with stages
in 2 minutes and 25 seconds
# Deduped map tilelist
# WMF maps tools
A collection of maps related CLI utils written in python.
## Dependencies
- Python >= 3.7
- PyYAML
- PyOsmium
- Psycopg 2
## Releases
Project releases are created automatically when a new tag is created. To create a new release with proper packaging:
- Bump the version under `setup.py`
- Bump the version under `debian/changelog`
- Push a new tag with the changes
## Deduped map tilelist
Given an input file with a list of line seperated tiles in `{zoom}/{x}/{y}` format, generate a distinct list of map tiles for all zoom levels from `minzoom` up to `maxzoom`.
## Usage
### Usage
```
usage: maps-deduped-tilelist [-h] minzoom maxzoom [tilelist_file]
......@@ -18,7 +37,7 @@ optional arguments:
-h, --help show this help message and exit
```
## Example
### Example
```
> cat tilelist.txt
......@@ -48,18 +67,24 @@ optional arguments:
1/1/1
```
## Context
### Context
This CLI tool is built as a way to generate a deduplicated tile list of distinct tiles based on the `imposm3` expired tile output. The reason behind this is to deduplicate tiles and optimize tile pregeneration by avoiding generating the same tile multiple times.
## Dependencies
## Imposm changeset verifier
- Python >= 3.7
Given an OSM changeset file and an imposm mapping, verify that operations described in the changeset are reflected in the DB after an OSM sync
## Releases
### Usage
```
usage: imposm-changeset-verify [-h] [--failfast] changeset mapping pgURL
Project releases are created automatically when a new tag is created. To create a new release with proper packaging:
positional arguments:
changeset
mapping
pgURL
- Bump the version under `setup.py`
- Bump the version under `debian/changelog`
- Push a new tag with the changes
optional arguments:
-h, --help show this help message and exit
--failfast
```
\ No newline at end of file
......@@ -27,20 +27,27 @@ class ElementHandler:
raise InconsistentChangeException(
f"Element with id:{change.id} shouldn't exist"
)
self.inconsistencies.append(change.id)
self.inconsistencies.append(
{"type": "should be deleted", "id": change.id}
)
def verify_existing(self, change):
at_least_once = False
for table in self.tables:
if not self.exists(table, change.id):
if self.failfast:
raise InconsistentChangeException(
f"Element with id:{change.id} should exist"
)
self.inconsistencies.append(change.id)
if self.exists(table, change.id):
at_least_once = True
break
if not at_least_once:
if self.failfast:
raise InconsistentChangeException(
f"Element with id:{change.id} should exist"
)
self.inconsistencies.append({"type": "should exist", "id": change.id})
def log_inconsistencies(self):
for elem in self.inconsistencies:
print(f"Inconsistency with OSM ID: {elem}")
print(f"Inconsistency: {elem}")
def __call__(self, change):
if change.deleted:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment