Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
measprocess
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lukas Eller
measprocess
Commits
06cdb625
Commit
06cdb625
authored
Apr 26, 2021
by
Lukas Eller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed name to plot_locations_osm
parent
3af62942
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
13 deletions
+11
-13
__init__.py
measprocess/__init__.py
+2
-2
geospatial.py
measprocess/geospatial.py
+3
-5
plotting.py
measprocess/plotting.py
+2
-2
plotting_test.py
tests/plotting_test.py
+4
-4
No files found.
measprocess/__init__.py
View file @
06cdb625
from
.data_extractor
import
(
fetch_rtr_details
,
fetch_rtr_details
,
fetch_rtr_overview
)
from
.geospatial
import
(
...
...
@@ -14,7 +14,7 @@ from .geospatial import (
pull_from_geodatenviewer_meas
)
from
.plotting
import
(
plot_
serie
s_osm
,
plot_
location
s_osm
,
plot_street_nodes
)
from
.preprocess
import
(
...
...
measprocess/geospatial.py
View file @
06cdb625
...
...
@@ -36,7 +36,7 @@ def get_geoseries_streets(
"""
Obtain the street shapes in the area spanned by the measurement_coords.
:param measurement_coords: A geopandas geoseries of Points(lon, lat) representing the measurement positions in a
e
:4326 projection
:param measurement_coords: A geopandas geoseries of Points(lon, lat) representing the measurement positions in a
EPSG
:4326 projection
:param retries: Number of retries for overpy requests, default:5
:param crop: Set to True if the returned geoseries should be fixed to bounding box determined by measurement_coords, default: False
...
...
@@ -362,7 +362,7 @@ def pull_from_geodatenviewer_list(squares: List[str]) -> gpd.GeoDataFrame:
def
pull_from_geodatenviewer_meas
(
measurement_coords
:
gpd
.
GeoSeries
)
->
gpd
.
GeoDataFrame
:
'''
Downloads raster .zip file for Vienna Austria, extracts all raster polygon IDs containing measurements,
Downloads raster .zip file for Vienna Austria, extracts all raster polygon IDs containing measurements,
then calls pull_from_geodatenviewer_list() to extract building polygons.
:param measurement_coords: geopandas geoseries containing measurements in EPSG:4326 projection
...
...
@@ -378,7 +378,7 @@ def pull_from_geodatenviewer_meas(measurement_coords: gpd.GeoSeries) -> gpd.GeoD
"https://data.wien.gv.at/daten/geo?service=WFS&request=GetFeature&version=1.1.0&typeName=ogdwien:MZKBLATT1000OGD&srsName=EPSG:4326&outputFormat=shape-zip"
,
os
.
path
.
join
(
raster_path
,
"raster.zip"
),
)
file_name
=
os
.
path
.
join
(
raster_path
,
"raster.zip"
)
zip_ref
=
zipfile
.
ZipFile
(
file_name
)
# create zipfile object
zip_ref
.
extractall
(
raster_path
)
# extract file to dir
...
...
@@ -399,5 +399,3 @@ def pull_from_geodatenviewer_meas(measurement_coords: gpd.GeoSeries) -> gpd.GeoD
return_gdf
=
pull_from_geodatenviewer_list
(
polygonID_list
)
return
return_gdf
measprocess/plotting.py
View file @
06cdb625
...
...
@@ -5,7 +5,7 @@ import matplotlib.pyplot as plt
import
numpy
as
np
from
typing
import
Tuple
def
plot_
serie
s_osm
(
def
plot_
location
s_osm
(
gps_series
:
gpd
.
GeoSeries
,
c_series
:
np
.
ndarray
=
None
,
zoom_level
:
int
=
10
,
...
...
@@ -26,7 +26,7 @@ def plot_series_osm(
:param **kwargs: additional keword arguements which will directly be passed on to scatterplot
:param save_path: if not none then the plot will be saved under this path
"""
if
gps_series
.
crs
!=
"EPSG:4326"
:
raise
ValueError
(
"Make sure to pass data with EPSG:4326 projection"
)
...
...
tests/plotting_test.py
View file @
06cdb625
...
...
@@ -20,22 +20,22 @@ class TestPlottingOSM(unittest.TestCase):
def
test_basic
(
self
):
#Check if no exception comes up
series
=
self
.
_gps_series
.
set_crs
(
"EPSG:4326"
)
mpc
.
plotting
.
plot_
serie
s_osm
(
series
,
show
=
False
)
mpc
.
plotting
.
plot_
location
s_osm
(
series
,
show
=
False
)
def
test_exception_epsg
(
self
):
with
self
.
assertRaises
(
ValueError
):
series
=
self
.
_gps_series
#.set_crs("EPSG:4326")
mpc
.
plotting
.
plot_
serie
s_osm
(
series
,
show
=
False
)
mpc
.
plotting
.
plot_
location
s_osm
(
series
,
show
=
False
)
def
test_kwargs_basic
(
self
):
series
=
self
.
_gps_series
.
set_crs
(
"EPSG:4326"
)
mpc
.
plotting
.
plot_
serie
s_osm
(
series
,
show
=
False
,
color
=
"red"
)
mpc
.
plotting
.
plot_
location
s_osm
(
series
,
show
=
False
,
color
=
"red"
)
def
test_kwargs_double
(
self
):
#s is based twice here
with
self
.
assertRaises
(
TypeError
):
series
=
self
.
_gps_series
.
set_crs
(
"EPSG:4326"
)
mpc
.
plotting
.
plot_
serie
s_osm
(
series
,
show
=
False
,
s
=
100
,
color
=
"red"
)
mpc
.
plotting
.
plot_
location
s_osm
(
series
,
show
=
False
,
s
=
100
,
color
=
"red"
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Markdown
is supported
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