Skip to content

Commit 9b2f34d

Browse files
Merge pull request #32 from geo-engine/plot_crs
add crs to plot requests
2 parents e49546b + ef84531 commit 9b2f34d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

geoengine/workflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ def plot_chart(self, bbox: QueryRectangle) -> VegaLite:
272272
spatial_bounds = urllib.parse.quote(bbox.bbox_str)
273273
resolution = str(f'{bbox.resolution[0]},{bbox.resolution[1]}')
274274

275-
plot_url = f'{session.server_url}/plot/{self}?bbox={spatial_bounds}&time={time}&spatialResolution={resolution}'
275+
plot_url = f'{session.server_url}/plot/{self}?bbox={spatial_bounds}&crs={bbox.srs}&time={time}'\
276+
f'&spatialResolution={resolution}'
276277

277278
response = req.get(plot_url, headers=session.auth_header)
278279

tests/test_plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_ndvi_histogram(self):
3838

3939
m.get(
4040
# pylint: disable=line-too-long
41-
'http://mock-instance/plot/5b9508a8-bd34-5a1c-acd6-75bb832d2d38?bbox=-180.0%2C-90.0%2C180.0%2C90.0&time=2014-04-01T12%3A00%3A00.000%2B00%3A00&spatialResolution=0.1,0.1',
41+
'http://mock-instance/plot/5b9508a8-bd34-5a1c-acd6-75bb832d2d38?bbox=-180.0%2C-90.0%2C180.0%2C90.0&crs=EPSG:4326&time=2014-04-01T12%3A00%3A00.000%2B00%3A00&spatialResolution=0.1,0.1',
4242
json={
4343
"outputFormat": "JsonVega",
4444
"plotType": "Histogram",
@@ -201,7 +201,7 @@ def test_plot_error(self):
201201

202202
m.get(
203203
# pylint: disable=line-too-long
204-
'http://mock-instance/plot/5b9508a8-bd34-5a1c-acd6-75bb832d2d38?bbox=-180.0%2C-90.0%2C180.0%2C90.0&time=2004-04-01T12%3A00%3A00.000%2B00%3A00&spatialResolution=0.1,0.1',
204+
'http://mock-instance/plot/5b9508a8-bd34-5a1c-acd6-75bb832d2d38?bbox=-180.0%2C-90.0%2C180.0%2C90.0&crs=EPSG:4326&time=2004-04-01T12%3A00%3A00.000%2B00%3A00&spatialResolution=0.1,0.1',
205205
json={
206206
"error": "Operator",
207207
"message": 'Operator: Could not open gdal dataset for file path '

0 commit comments

Comments
 (0)