Skip to content

Commit

Permalink
getfeatureinfo prior to postprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminleighton committed Aug 20, 2023
1 parent f041ab9 commit 6949979
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/titiler/extensions/titiler/extensions/wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ def get_map_data(req):
"bbox",
"width",
"height",
"format",
}

intrs = set(req.keys()).intersection(req_keys)
Expand Down Expand Up @@ -513,12 +512,14 @@ def get_map_data(req):
detail=f"Invalid 'TRANSPARENT' parameter: {transparent}. Should be one of ['FALSE', 'TRUE'].",
)

if req["format"] not in self.supported_format:
raise HTTPException(
status_code=400,
detail=f"Invalid 'FORMAT' parameter: {req['format']}. Should be one of {self.supported_format}.",
)
format = ImageType(WMSMediaType(req["format"]).name)
format = 'None'
if 'format' in req:
if req["format"] not in self.supported_format:
raise HTTPException(
status_code=400,
detail=f"Invalid 'FORMAT' parameter: {req['format']}. Should be one of {self.supported_format}.",
)
format = ImageType(WMSMediaType(req["format"]).name)

height, width = int(req["height"]), int(req["width"])

Expand All @@ -541,14 +542,15 @@ def _reader(src_path: str):
pixel_selection=OverlayMethod(),
)

if post_process:
image = post_process(image)

return image, format, transparent

if request_type.lower() == "getmap":

image, format, transparent = get_map_data(req)

if post_process:
image = post_process(image)

if rescale:
image.rescale(rescale)
Expand Down

0 comments on commit 6949979

Please sign in to comment.