Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dynamic Exposure
OpenBuildingMap
quadtreegrid
Commits
f13fd05e
Commit
f13fd05e
authored
Sep 21, 2021
by
Danijel Schorlemmer
Committed by
Nicolas Garcia Ospina
Sep 21, 2021
Browse files
Apply 9 suggestion(s) to 2 file(s)
parent
80c78fb8
Pipeline
#27911
passed with stage
in 3 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
quadtreegrid/quadtreegrid.py
View file @
f13fd05e
...
...
@@ -48,7 +48,7 @@ parser.add_argument(
const
=
1
,
type
=
int
,
default
=
18
,
help
=
"Set zoom level of output tiles, default
=
18"
,
help
=
"Set zoom level of output tiles, default
:
18"
,
)
parser
.
add_argument
(
"-output"
,
...
...
@@ -56,8 +56,8 @@ parser.add_argument(
nargs
=
"?"
,
const
=
1
,
default
=
"./output_quadkeys.txt"
,
help
=
"""Set the output filepath and extension as
text or CSV filepath, default
=
./output_quadkeys.txt"""
,
help
=
"""Set the output file
path and extension as
text or CSV file
path, default
:
./output_quadkeys.txt"""
,
)
args
=
parser
.
parse_args
()
...
...
@@ -65,8 +65,8 @@ args = parser.parse_args()
def
main
():
if
args
.
in_bounds
:
sw_lon
,
sw_lat
,
ne_lon
,
ne_lat
=
args
.
in_bounds
assert
sw_lon
<
ne_lon
,
"West longitude is greater than
E
ast longitude"
assert
sw_lat
<
ne_lat
,
"South latitude is greater than
N
orth latitude"
assert
sw_lon
<
ne_lon
,
"West longitude is greater than
e
ast longitude"
assert
sw_lat
<
ne_lat
,
"South latitude is greater than
n
orth latitude"
elif
args
.
in_file
:
outline
=
gpd
.
read_file
(
args
.
in_file
).
to_crs
(
"epsg:4326"
)
geometry
=
outline
.
envelope
.
values
[
0
]
...
...
quadtreegrid/quadtreegrid_polyfill.py
View file @
f13fd05e
...
...
@@ -42,7 +42,7 @@ parser.add_argument(
const
=
1
,
type
=
int
,
default
=
18
,
help
=
"Set zoom level of output tiles, default
=
18"
,
help
=
"Set zoom level of output tiles, default
:
18"
,
)
parser
.
add_argument
(
"-max_batches"
,
...
...
@@ -67,8 +67,8 @@ parser.add_argument(
nargs
=
"?"
,
const
=
1
,
default
=
"./output_quadkeys.txt"
,
help
=
"""Set the output filepath and extension as
text or CSV filepath, default
=
./output_quadkeys.txt"""
,
help
=
"""Set the output file
path and extension as
text or CSV file
path, default
:
./output_quadkeys.txt"""
,
)
args
=
parser
.
parse_args
()
...
...
@@ -162,7 +162,7 @@ def main():
# Remove possible duplicated quadkeys
flat_list_ids
=
list
(
set
([
item
for
sublist
in
data
for
item
in
sublist
]))
if
len
(
flat_list_ids
)
>
0
:
logger
.
info
(
"Writing {}
Q
uadkeys to {}"
.
format
(
len
(
flat_list_ids
),
args
.
output
))
logger
.
info
(
"Writing {}
q
uadkeys to {}"
.
format
(
len
(
flat_list_ids
),
args
.
output
))
outfile
=
open
(
args
.
output
,
"w"
)
if
args
.
output
[
-
3
:]
==
"csv"
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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