Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
Get Baden-Württemberg CityGML Opendata
Commits
dde3b35b
Commit
dde3b35b
authored
1 month ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Slight refactor
parent
af8f59dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
download_files_from_LGL_BW.py
+8
-12
download_files_from_LGL_BW.py
with
8 additions
and
12 deletions
+8
-12
download_files_from_LGL_BW.py
+
8
-
12
View file @
dde3b35b
...
@@ -10,7 +10,7 @@ This script downloads the required tiles for given regions
...
@@ -10,7 +10,7 @@ This script downloads the required tiles for given regions
Usage:
Usage:
python download_files_from_LGL_BW.py StuttgartCenter "POLYGON((9.175287 48.780916, 9.185501 48.777522, 9.181467 48.773704, 9.174429 48.768472, 9.168807 48.773902, 9.175287 48.780916))"
python download_files_from_LGL_BW.py StuttgartCenter "POLYGON((9.175287 48.780916, 9.185501 48.777522, 9.181467 48.773704, 9.174429 48.768472, 9.168807 48.773902, 9.175287 48.780916))"
python download_files_from_LGL_BW.py Freiburg "79098,79102"
python download_files_from_LGL_BW.py Freiburg "79098,79102"
python download_files_from_LGL_BW.py M
yRegio
n "70567" --download-only
python download_files_from_LGL_BW.py M
öhringe
n "70567" --download-only
python download_files_from_LGL_BW.py CustomPath "POLYGON(...)" --simstadt-folder "/path/to/SimStadt"
python download_files_from_LGL_BW.py CustomPath "POLYGON(...)" --simstadt-folder "/path/to/SimStadt"
Required:
Required:
...
@@ -29,7 +29,6 @@ import urllib.request
...
@@ -29,7 +29,6 @@ import urllib.request
import
time
import
time
import
zipfile
import
zipfile
import
logging
import
logging
import
sys
from
pyproj
import
CRS
from
pyproj
import
CRS
from
pyproj
import
Transformer
from
pyproj
import
Transformer
...
@@ -43,10 +42,7 @@ from get_coordinates_by_zipcode import get_coordinates_by_zipcode
...
@@ -43,10 +42,7 @@ from get_coordinates_by_zipcode import get_coordinates_by_zipcode
# Setup logging
# Setup logging
logging
.
basicConfig
(
logging
.
basicConfig
(
level
=
logging
.
INFO
,
level
=
logging
.
INFO
,
format
=
'%(asctime)s - %(levelname)s - %(message)s'
,
format
=
'%(levelname)s - %(message)s'
,
handlers
=
[
logging
.
StreamHandler
(
sys
.
stdout
)
]
)
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -116,6 +112,7 @@ def download_whole_region(output_dir: Path, wkt_region: str, x1: int, x2: int, y
...
@@ -116,6 +112,7 @@ def download_whole_region(output_dir: Path, wkt_region: str, x1: int, x2: int, y
wgs84_region
=
wkt
.
loads
(
wkt_region
)
wgs84_region
=
wkt
.
loads
(
wkt_region
)
local_region
=
transform
(
TO_LOCAL_CRS
.
transform
,
wgs84_region
)
local_region
=
transform
(
TO_LOCAL_CRS
.
transform
,
wgs84_region
)
for
x
in
range
(
x1
,
x2
+
1
,
RASTER
):
for
x
in
range
(
x1
,
x2
+
1
,
RASTER
):
for
y
in
range
(
y1
,
y2
+
1
,
RASTER
):
for
y
in
range
(
y1
,
y2
+
1
,
RASTER
):
tile_center
=
Point
((
x
+
1
)
*
KILOMETER
,
(
y
+
1
)
*
KILOMETER
)
tile_center
=
Point
((
x
+
1
)
*
KILOMETER
,
(
y
+
1
)
*
KILOMETER
)
...
@@ -225,7 +222,7 @@ def parse_arguments():
...
@@ -225,7 +222,7 @@ def parse_arguments():
Examples:
Examples:
python download_files_from_LGL_BW.py StuttgartCenter "POLYGON((9.175287 48.780916, 9.185501 48.777522, 9.181467 48.773704, 9.174429 48.768472, 9.168807 48.773902, 9.175287 48.780916))"
python download_files_from_LGL_BW.py StuttgartCenter "POLYGON((9.175287 48.780916, 9.185501 48.777522, 9.181467 48.773704, 9.174429 48.768472, 9.168807 48.773902, 9.175287 48.780916))"
python download_files_from_LGL_BW.py Freiburg "79098,79102"
python download_files_from_LGL_BW.py Freiburg "79098,79102"
python download_files_from_LGL_BW.py M
yRegio
n "70567" --download-only
python download_files_from_LGL_BW.py M
öhringe
n "70567" --download-only
"""
"""
)
)
...
@@ -272,8 +269,7 @@ def main():
...
@@ -272,8 +269,7 @@ def main():
# Extract region if not download-only
# Extract region if not download-only
if
not
download_only
:
if
not
download_only
:
if
not
simstadt_folder
:
simstadt_folder
=
simstadt_folder
or
find_simstadt_folder
()
simstadt_folder
=
find_simstadt_folder
()
if
not
simstadt_folder
:
if
not
simstadt_folder
:
logger
.
error
(
logger
.
error
(
"No SimStadt installation found! Please provide --simstadt-folder or use --download-only."
)
"No SimStadt installation found! Please provide --simstadt-folder or use --download-only."
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment