Skip to content

Commit

Permalink
Taking access environment into account when rendering referenceable d…
Browse files Browse the repository at this point in the history
…atasets
  • Loading branch information
constantinius committed Jan 11, 2023
1 parent 3bf1adf commit 0224e3a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions eoxserver/render/mapserver/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def create_coverage_layer(self, map_obj: Map, coverage: Coverage, fields: List[F
# TODO: apply subsets in time/elevation dims
num_locations = len(set(locations))
if num_locations == 1:
location = field_locations[0][1]
if not coverage.grid.is_referenceable:
location = field_locations[0][1]
data = location.path
ms.set_env(map_obj, location.env, True)
else:
Expand All @@ -150,12 +150,13 @@ def create_coverage_layer(self, map_obj: Map, coverage: Coverage, fields: List[F
wkt = osr.SpatialReference(map_obj.getProjection()).wkt

# TODO: env?
reftools.create_rectified_vrt(
field_locations[0][1].path, vrt_path,
order=1, max_error=10,
resolution=(resx, -resy), srid_or_wkt=wkt
)
data = vrt_path
with gdal.config_env(location.env):
reftools.create_rectified_vrt(
location.path, vrt_path,
order=1, max_error=10,
resolution=(resx, -resy), srid_or_wkt=wkt
)
data = vrt_path

elif num_locations > 1:
paths_set = set(
Expand Down

0 comments on commit 0224e3a

Please sign in to comment.