gws.gis.mpx.util

Utility functions for MapProxy integration.

This module provides utilities for annotating and decorating MapProxy images.

Source code: gws.gis.mpx.util

Module Contents

gws.gis.mpx.util.annotate(image: Any, service: str, layers: List[str], environ: Dict[str, Any], query_extent: Tuple[Any, Any], **kw: Any) mapproxy.image.ImageSource

Annotate a MapProxy image with request information.

This function is used as a callback for MapProxy’s decorate_img middleware. It adds text information about the request to the image.

Parameters:
  • image – The MapProxy image object to annotate.

  • service – The OWS service name (WMS, WMTS, etc.).

  • layers – List of requested layer names.

  • environ – The WSGI environment dictionary.

  • query_extent – A tuple containing SRS and coordinate information.

  • **kw – Additional keyword arguments.

Returns:

An ImageSource object with the annotated image.

class gws.gis.mpx.util.AnnotationFilter(app: Any)

Bases: object

Simple MapProxy decorate_img middleware.

This middleware annotates map images with information about the request. It can be used to debug MapProxy requests by adding visual information to the returned images.

app