dea-tools 0.3.2.dev49__tar.gz → 0.3.2.dev54__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dea-tools-0.3.2.dev49/dea_tools.egg-info → dea-tools-0.3.2.dev54}/PKG-INFO +1 -1
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/spatial.py +3 -3
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/waterbodies.py +13 -10
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54/dea_tools.egg-info}/PKG-INFO +1 -1
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/.gitignore +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/LICENSE +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/MANIFEST.in +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/README.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/__init__.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/__main__.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/__init__.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/animations.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/changefilmstrips.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/crophealth.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/deacoastlines.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/imageexport.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/miningrehab.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/app/widgetconstructors.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/bandindices.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/bom.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/classification.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/climate.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/coastal.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/dask.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/datahandling.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/landcover.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/maps.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/plotting.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/pyfes_model.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/temporal.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/validation.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools/wetlands.py +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools.egg-info/SOURCES.txt +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools.egg-info/dependency_links.txt +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools.egg-info/requires.txt +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/dea_tools.egg-info/top_level.txt +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.app.animations.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.app.changefilmstrips.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.app.crophealth.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.app.deacoastlines.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.app.imageexport.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.app.miningrehab.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.app.widgetconstructors.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.bandindices.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.bom.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.classification.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.climate.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.coastal.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.dask.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.datahandling.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.landcover.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.plotting.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.spatial.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.temporal.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.validation.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/gen/dea_tools.waterbodies.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/index.rst +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/pyproject.toml +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/setup.cfg +0 -0
- {dea-tools-0.3.2.dev49 → dea-tools-0.3.2.dev54}/setup.py +0 -0
|
@@ -601,7 +601,7 @@ def xr_interpolate(
|
|
|
601
601
|
A dataset of spatial points including at least one numeric column.
|
|
602
602
|
By default all numeric columns in this dataset will be spatially
|
|
603
603
|
interpolated into the extent of `ds`; specific columns can be
|
|
604
|
-
selected using `columns`. An
|
|
604
|
+
selected using `columns`. An warning will be raised if the points
|
|
605
605
|
in `gdf` do not overlap with the extent of `ds`.
|
|
606
606
|
columns : list, optional
|
|
607
607
|
An optional list of specific columns in gdf` to run the
|
|
@@ -646,10 +646,10 @@ def xr_interpolate(
|
|
|
646
646
|
ds = add_geobox(ds, crs)
|
|
647
647
|
y_dim, x_dim = ds.odc.spatial_dims
|
|
648
648
|
|
|
649
|
-
# Reproject to match input `ds`, and raise
|
|
649
|
+
# Reproject to match input `ds`, and raise warning if there are no overlaps
|
|
650
650
|
gdf = gdf.to_crs(ds.odc.crs)
|
|
651
651
|
if not gdf.dissolve().intersects(ds.odc.geobox.extent.geom).item():
|
|
652
|
-
|
|
652
|
+
warnings.warn("The supplied `gdf` does not overlap spatially with `ds`.", stacklevel=2)
|
|
653
653
|
|
|
654
654
|
# Select subset of numeric columns (non-numeric are not supported)
|
|
655
655
|
numeric_gdf = gdf.select_dtypes("number")
|
|
@@ -16,7 +16,7 @@ here: https://gis.stackexchange.com/questions/tagged/open-data-cube).
|
|
|
16
16
|
If you would like to report an issue with this script, file one on
|
|
17
17
|
GitHub: https://github.com/GeoscienceAustralia/dea-notebooks/issues/new
|
|
18
18
|
|
|
19
|
-
Last modified:
|
|
19
|
+
Last modified: March 2024
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
import geopandas as gpd
|
|
@@ -26,9 +26,12 @@ from owslib.etree import etree
|
|
|
26
26
|
import pandas as pd
|
|
27
27
|
|
|
28
28
|
WFS_ADDRESS = "https://geoserver.dea.ga.gov.au/geoserver/wfs"
|
|
29
|
+
LAYER_SELECT = {
|
|
30
|
+
"v2" : "DigitalEarthAustraliaWaterbodies_v2",
|
|
31
|
+
"v3" : "DigitalEarthAustraliaWaterbodies_v3"
|
|
32
|
+
}
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
def get_waterbody(geohash: str) -> gpd.GeoDataFrame:
|
|
34
|
+
def get_waterbody(geohash: str, version: str = "v3") -> gpd.GeoDataFrame:
|
|
32
35
|
"""Gets a waterbody polygon and metadata by geohash.
|
|
33
36
|
|
|
34
37
|
Parameters
|
|
@@ -45,7 +48,7 @@ def get_waterbody(geohash: str) -> gpd.GeoDataFrame:
|
|
|
45
48
|
filter_ = PropertyIsEqualTo(propertyname="uid", literal=geohash)
|
|
46
49
|
filterxml = etree.tostring(filter_.toXML()).decode("utf-8")
|
|
47
50
|
response = wfs.getfeature(
|
|
48
|
-
typename=
|
|
51
|
+
typename=LAYER_SELECT[version],
|
|
49
52
|
filter=filterxml,
|
|
50
53
|
outputFormat="json",
|
|
51
54
|
)
|
|
@@ -53,7 +56,7 @@ def get_waterbody(geohash: str) -> gpd.GeoDataFrame:
|
|
|
53
56
|
return wb_gpd
|
|
54
57
|
|
|
55
58
|
|
|
56
|
-
def get_waterbodies(bbox: tuple, crs="EPSG:4326") -> gpd.GeoDataFrame:
|
|
59
|
+
def get_waterbodies(bbox: tuple, crs="EPSG:4326", version: str = "v3") -> gpd.GeoDataFrame:
|
|
57
60
|
"""Gets the polygons and metadata for multiple waterbodies by bbox.
|
|
58
61
|
|
|
59
62
|
Parameters
|
|
@@ -70,7 +73,7 @@ def get_waterbodies(bbox: tuple, crs="EPSG:4326") -> gpd.GeoDataFrame:
|
|
|
70
73
|
"""
|
|
71
74
|
wfs = WebFeatureService(url=WFS_ADDRESS, version="1.1.0")
|
|
72
75
|
response = wfs.getfeature(
|
|
73
|
-
typename=
|
|
76
|
+
typename=LAYER_SELECT[version],
|
|
74
77
|
bbox=tuple(bbox) + (crs,),
|
|
75
78
|
outputFormat="json",
|
|
76
79
|
)
|
|
@@ -78,7 +81,7 @@ def get_waterbodies(bbox: tuple, crs="EPSG:4326") -> gpd.GeoDataFrame:
|
|
|
78
81
|
return wb_gpd
|
|
79
82
|
|
|
80
83
|
|
|
81
|
-
def get_geohashes(bbox: tuple = None, crs: str = "EPSG:4326") -> [str]:
|
|
84
|
+
def get_geohashes(bbox: tuple = None, crs: str = "EPSG:4326", version: str = "v3") -> [str]:
|
|
82
85
|
"""Gets all waterbody geohashes.
|
|
83
86
|
|
|
84
87
|
Parameters
|
|
@@ -97,7 +100,7 @@ def get_geohashes(bbox: tuple = None, crs: str = "EPSG:4326") -> [str]:
|
|
|
97
100
|
if bbox is not None:
|
|
98
101
|
bbox = tuple(bbox) + (crs,)
|
|
99
102
|
response = wfs.getfeature(
|
|
100
|
-
typename=
|
|
103
|
+
typename=LAYER_SELECT[version],
|
|
101
104
|
propertyname="uid",
|
|
102
105
|
outputFormat="json",
|
|
103
106
|
bbox=bbox,
|
|
@@ -106,7 +109,7 @@ def get_geohashes(bbox: tuple = None, crs: str = "EPSG:4326") -> [str]:
|
|
|
106
109
|
return list(wb_gpd["uid"])
|
|
107
110
|
|
|
108
111
|
|
|
109
|
-
def get_time_series(geohash: str = None, waterbody: pd.Series = None) -> pd.DataFrame:
|
|
112
|
+
def get_time_series(geohash: str = None, waterbody: pd.Series = None, version: str = "v3") -> pd.DataFrame:
|
|
110
113
|
"""Gets the time series for a waterbody. Specify either a GeoDataFrame row or a geohash.
|
|
111
114
|
|
|
112
115
|
Parameters
|
|
@@ -127,7 +130,7 @@ def get_time_series(geohash: str = None, waterbody: pd.Series = None) -> pd.Data
|
|
|
127
130
|
raise ValueError("One of waterbody and geohash must be specified")
|
|
128
131
|
|
|
129
132
|
if geohash is not None:
|
|
130
|
-
wb = get_waterbody(geohash)
|
|
133
|
+
wb = get_waterbody(geohash, version)
|
|
131
134
|
url = wb.timeseries[0]
|
|
132
135
|
else:
|
|
133
136
|
url = waterbody.timeseries
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|