Skip to content

Commit

Permalink
[BREAKING] X/Y input via geofabrik .json + only support processing ma…
Browse files Browse the repository at this point in the history
…ps via geofabrik .json, delete `wahoomc/resources/json/` files, constants and related coding (#183)

* only read geofabrik file once + make "global" variable

* x/y coordinates working solution

lines 156-167 + 370-382 in geofabrik might not be needed / to be discussed

* unittest

* translate to and set geofabrik id_no if found

* reduce complexity

- reduce methods in geofabrik.py by using GeofabrikJson Ckass
- add geometry to geofabrik_overview dict + getter

* mode in Geofabrik class, get unittests to work again

- calc. all x/y tiles in one run - identical to country

* Geofabrik as interface and two classes

* cut geofabrik.py into functions, detailled unittests

* pylint and vulture findings + delete one dir more

* delete existing .json files implementation + unittests for retrieving tiles

some unittests did make sense to do them via geofabrik

* remove geofabrik_tiles input argument

for CLI and UI

* clean up launch configuration, comments

* PR review findings

* files of unittest run on macOS for malta 2. tile (geofabrik)

BREAKING CHANGE:
Processing is now only based on Geofabrik .json file which is downloaded both for country and X/Y input. The static country .json files and the whole implementation has been removed.
`-gt` input argument was also removed because there is only one processing method implemented.
Input should now be in Geofabrik style. The hardcoded translation to geofabrik countries has been removed.
The size of generated maps for X/Y coordinates should remain exactly the same as before. The size of generated maps for countries should roughly be the same as before.
  • Loading branch information
treee111 authored Mar 9, 2023
1 parent f400f89 commit 0d62840
Show file tree
Hide file tree
Showing 326 changed files with 9,080 additions and 355,709 deletions.
79 changes: 45 additions & 34 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "x/y: 134/88 (STG)",
"name": "x/y: 134/88 (stuttgart)",
"type": "python",
"request": "launch",
"module": "wahoomc",
Expand Down Expand Up @@ -34,7 +34,7 @@
]
},
{
"name": "germany",
"name": "co: germany",
"type": "python",
"request": "launch",
"module": "wahoomc",
Expand All @@ -46,7 +46,7 @@
]
},
{
"name": "malta (no POI)",
"name": "co: malta (no POI)",
"type": "python",
"request": "launch",
"module": "wahoomc",
Expand All @@ -64,26 +64,7 @@
]
},
{
"name": "malta-geofabrik (no POI)",
"type": "python",
"request": "launch",
"module": "wahoomc",
"console": "integratedTerminal",
"args": [
"cli",
"-co",
"malta",
"-tag",
"tag-wahoo.xml",
"-fp",
"-c",
"-md",
"100",
"-gt"
]
},
{
"name": "malta -c NO -fp",
"name": "co: malta NO -fp",
"type": "python",
"request": "launch",
"module": "wahoomc",
Expand All @@ -98,23 +79,23 @@
]
},
{
"name": "malta",
"name": "x/y: 138/100 (malta)",
"type": "python",
"request": "launch",
"module": "wahoomc",
"console": "integratedTerminal",
"args": [
"cli",
"-co",
"malta",
"-xy",
"138/100",
"-fp",
"-c",
"-md",
"100"
]
},
{
"name": "x/y: 135/91 (Garda) #160",
"name": "x/y: 135/91 (gardasee) #160",
"type": "python",
"request": "launch",
"module": "wahoomc",
Expand Down Expand Up @@ -166,25 +147,56 @@
"args": [
"cli",
"-xy",
"133/88"
"133/88",
"-c"
]
},
{
"name": "x/y: 138/100 (malta) -c",
"name": "x/y: 134/89 (bodensee 4 countries)",
"type": "python",
"request": "launch",
"module": "wahoomc",
"console": "integratedTerminal",
"args": [
"cli",
"-xy",
"138/100",
"134/89",
"-c"
]
},
{
"name": "x/y: 72/98 (virginia)",
"type": "python",
"request": "launch",
"module": "wahoomc",
"console": "integratedTerminal",
"args": [
"cli",
"-xy",
"72/98",
"-fp",
"-c",
"-md",
"100"
]
},
{
"name": "co: virginia -nbc",
"type": "python",
"request": "launch",
"module": "wahoomc",
"console": "integratedTerminal",
"args": [
"cli",
"-co",
"virginia",
"-fp",
"-c",
"-md",
"100",
"-nbc"
]
},
{
"name": "x/y: stg->gardasee (ten tiles)",
"type": "python",
Expand All @@ -198,7 +210,7 @@
]
},
{
"name": "mexico #113",
"name": "co: mexico #113",
"type": "python",
"request": "launch",
"module": "wahoomc",
Expand All @@ -212,7 +224,7 @@
]
},
{
"name": "solomon_islands geofabrik",
"name": "co: solomon_islands",
"type": "python",
"request": "launch",
"module": "wahoomc",
Expand All @@ -223,8 +235,7 @@
"solomon_islands",
"-c",
"-md",
"100",
"-gt"
"100"
]
}
]
Expand Down
Binary file added tests/resources/macos/137/100.map
Binary file not shown.
Binary file added tests/resources/macos/137/100.map.lzma
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions tests/resources/macos/137/100/land.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
Binary file added tests/resources/macos/137/100/land.shp
Binary file not shown.
Binary file added tests/resources/macos/137/100/land.shx
Binary file not shown.
Loading

0 comments on commit 0d62840

Please sign in to comment.