Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV] Unittests for malta and liechtenstein. Check output per tile for files in tests/resources #56

Merged
merged 6 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 84 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,113 @@
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["${workspaceRoot}/tests/json/germany-only1.json", "-md", "100", "-fp", "-c", "-om"]
"args": [
"${workspaceRoot}/tests/json/germany-only1.json",
"-md",
"100",
"-fp",
"-c",
"-om"
]
},
{
"name": "only1-tag-hidrive2",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["${workspaceRoot}/tests/json/germany-only1.json", "-tag", "tag-wahoo-hidrive2.xml", "-md", "100", "-fp", "-c", "-om"]
"args": [
"${workspaceRoot}/tests/json/germany-only1.json",
"-tag",
"tag-wahoo-hidrive2.xml",
"-md",
"100",
"-fp",
"-c",
"-om"
]
},
{
"name": "only2-tile",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["${workspaceRoot}/tests/json/germany-only2.json", "-md", "100", "-fp", "-c", "-om"]
"args": [
"${workspaceRoot}/tests/json/germany-only2.json",
"-md",
"100",
"-fp",
"-c",
"-om"
]
},
{
"name": "only9",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["${workspaceRoot}/tests/json/germany-only9.json", "-tag", "tag-wahoo.xml", "-md", "100", "-fp", "-c"]
"args": [
"${workspaceRoot}/tests/json/germany-only9.json",
"-tag",
"tag-wahoo.xml",
"-md",
"100",
"-fp",
"-c"
]
},
{
"name": "koblenz",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["${workspaceRoot}/tests/json/germany-koblenz.json"]
"args": [
"${workspaceRoot}/tests/json/germany-koblenz.json"
]
},
{
"name": "germany",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["${workspaceRoot}/tests/json/germany.json"]
"args": [
"${workspaceRoot}/tests/json/germany.json"
]
},
{
"name": "germany_wo_bc",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": [
"germany",
"-tag",
"tag-wahoo.xml",
"-c",
"-md",
"100"
]
},
{
"name": "malta",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["malta", "-tag", "tag-wahoo.xml", "-fp", "-c", "-md", "100"]
"args": [
"malta",
"-tag",
"tag-wahoo.xml",
"-fp",
"-c",
"-md",
"100"
]
},
{
"name": "gui",
Expand All @@ -71,23 +129,39 @@
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["-h"]
"args": [
"-h"
]
},
{
"name": "hong_kong",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["hong_kong", "-fp", "-c", "-bc", "-md", "100"]
"args": [
"hong_kong",
"-fp",
"-c",
"-bc",
"-md",
"100"
]
},
{
"name": "macao",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/wahoo_map_creator.py",
"console": "integratedTerminal",
"args": ["macao", "-fp", "-c", "-bc", "-md", "100"]
"args": [
"macao",
"-fp",
"-c",
"-bc",
"-md",
"100"
]
}
]
}
1 change: 1 addition & 0 deletions common_python/file_directory_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def get_git_root():
# alternatives for ROOT_DIR: #os.getcwd() #getGitRoot()


# wahooMapsCreator directory
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
COMMON_DIR = os.path.join(ROOT_DIR, 'common_resources')
COMMON_DL_DIR = os.path.join(ROOT_DIR, 'common_download')
Expand Down
Binary file added tests/resources/134/89/land.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/resources/134/89/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/134/89/land.shp
Binary file not shown.
Binary file added tests/resources/134/89/land.shx
Binary file not shown.
104 changes: 104 additions & 0 deletions tests/resources/134/89/land1.osm
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<osm version='0.6'>
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459320' version='1' lon='10.00074009361646' lat='48.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459321' version='1' lon='10.00074009361646' lat='46.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459322' version='1' lon='8.99925990638354' lat='46.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459323' version='1' lon='8.99925990638354' lat='48.0005' />
<way timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459324' version='1'>
<nd ref='22951459320' />
<nd ref='22951459321' />
<nd ref='22951459322' />
<nd ref='22951459323' />
<nd ref='22951459320' />
<tag k='NHD:x' v='9' />
<tag k='NHD:y' v='47' />
<tag k='natural' v='nosea' />
<tag k='layer' v='-5' />
</way>
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459325' version='1' lon='7.999259906383539' lat='48.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459326' version='1' lon='8.2651837' lat='48.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459327' version='1' lon='9.00074009361646' lat='48.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459328' version='1' lon='9.00074009361646' lat='46.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459329' version='1' lon='8.2651837' lat='46.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459330' version='1' lon='7.999259906383539' lat='46.9995' />
<way timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459331' version='1'>
<nd ref='22951459325' />
<nd ref='22951459326' />
<nd ref='22951459327' />
<nd ref='22951459328' />
<nd ref='22951459329' />
<nd ref='22951459330' />
<nd ref='22951459325' />
<tag k='NHD:x' v='8' />
<tag k='NHD:y' v='47' />
<tag k='natural' v='nosea' />
<tag k='layer' v='-5' />
</way>
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459332' version='1' lon='7.999273630164373' lat='47.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459333' version='1' lon='8.2651837' lat='47.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459334' version='1' lon='9.000726369835627' lat='47.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459335' version='1' lon='9.000726369835627' lat='45.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459336' version='1' lon='8.2651837' lat='45.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459337' version='1' lon='7.999273630164373' lat='45.9995' />
<way timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459338' version='1'>
<nd ref='22951459332' />
<nd ref='22951459333' />
<nd ref='22951459334' />
<nd ref='22951459335' />
<nd ref='22951459336' />
<nd ref='22951459337' />
<nd ref='22951459332' />
<tag k='NHD:x' v='8' />
<tag k='NHD:y' v='46' />
<tag k='natural' v='nosea' />
<tag k='layer' v='-5' />
</way>
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459339' version='1' lon='10.000726369835627' lat='47.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459340' version='1' lon='10.000726369835627' lat='45.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459341' version='1' lon='8.999273630164373' lat='45.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459342' version='1' lon='8.999273630164373' lat='47.0005' />
<way timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459343' version='1'>
<nd ref='22951459339' />
<nd ref='22951459340' />
<nd ref='22951459341' />
<nd ref='22951459342' />
<nd ref='22951459339' />
<tag k='NHD:x' v='9' />
<tag k='NHD:y' v='46' />
<tag k='natural' v='nosea' />
<tag k='layer' v='-5' />
</way>
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459344' version='1' lon='10.000754580247529' lat='49.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459345' version='1' lon='10.000754580247529' lat='47.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459346' version='1' lon='8.999245419752471' lat='47.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459347' version='1' lon='8.999245419752471' lat='49.0005' />
<way timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459348' version='1'>
<nd ref='22951459344' />
<nd ref='22951459345' />
<nd ref='22951459346' />
<nd ref='22951459347' />
<nd ref='22951459344' />
<tag k='NHD:x' v='9' />
<tag k='NHD:y' v='48' />
<tag k='natural' v='nosea' />
<tag k='layer' v='-5' />
</way>
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459349' version='1' lon='7.999245419752471' lat='49.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459350' version='1' lon='8.2651837' lat='49.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459351' version='1' lon='9.000754580247529' lat='49.0005' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459352' version='1' lon='9.000754580247529' lat='47.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459353' version='1' lon='8.2651837' lat='47.9995' />
<node timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459354' version='1' lon='7.999245419752471' lat='47.9995' />
<way timestamp='1969-12-31T23:59:59Z' changeset='-1' id='22951459355' version='1'>
<nd ref='22951459349' />
<nd ref='22951459350' />
<nd ref='22951459351' />
<nd ref='22951459352' />
<nd ref='22951459353' />
<nd ref='22951459354' />
<nd ref='22951459349' />
<tag k='NHD:x' v='8' />
<tag k='NHD:y' v='48' />
<tag k='natural' v='nosea' />
<tag k='layer' v='-5' />
</way>
</osm>
Binary file added tests/resources/134/89/merged.osm.pbf
Binary file not shown.
17 changes: 17 additions & 0 deletions tests/resources/134/89/sea.osm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6">
<node timestamp="1969-12-31T23:59:59Z" changeset="-1" id="32951459320" version="1" lon="8.337500" lat="46.940182" />
<node timestamp="1969-12-31T23:59:59Z" changeset="-1" id="32951459321" version="1" lon="8.337500" lat="48.089922" />
<node timestamp="1969-12-31T23:59:59Z" changeset="-1" id="32951459322" version="1" lon="9.943750" lat="48.089922" />
<node timestamp="1969-12-31T23:59:59Z" changeset="-1" id="32951459323" version="1" lon="9.943750" lat="46.940182" />
<way timestamp="1969-12-31T23:59:59Z" changeset="-1" id="32951623372" version="1">
<nd ref="32951459320" />
<nd ref="32951459321" />
<nd ref="32951459322" />
<nd ref="32951459323" />
<nd ref="32951459320" />
<tag k="area" v="yes" />
<tag k="layer" v="-5" />
<tag k="natural" v="sea" />
</way>
</osm>
Binary file not shown.
Binary file added tests/resources/134/89/split-liechtenstein.osm.pbf
Binary file not shown.
Binary file added tests/resources/138/100/land.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/resources/138/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/138/100/land.shp
Binary file not shown.
Binary file added tests/resources/138/100/land.shx
Binary file not shown.
Loading