99
1010:Author: Jeff McKenna
1111:Contact: jmckenna at gatewaygeomatics.com
12- :Last Updated: 2025-12-12
12+ :Author: Seth Girvin
13+ :Contact: sethg at geographika.co.uk
14+ :Last Updated: 2026-03-26
1315
1416.. contents:: Table of Contents
1517 :depth: 3
@@ -274,6 +276,8 @@ Example OGC API Server Mapfile
274276 "ows_getfeatureinfo_formatlist" "text/plain,text/html,application/json,application/vnd.ogc.gml,gml"
275277 "ows_enable_request" "*" #REQUIRED
276278 "oga_html_template_directory" "share/ogcapi/templates/html-bootstrap/" #REQUIRED
279+ "oga_fallback_to_map_extent" "true" # Optional. Can improve performance.
280+ "oga_use_default_extent_for_getfeature" "false" # Optional. Can improve performance.
277281 END
278282 END
279283
@@ -302,7 +306,8 @@ Example OGC API Server Mapfile
302306 "ows_abstract" "Oceans, NaturalEarth dataset, 2020"
303307 "gml_include_items" "all" #REQUIRED
304308 "gml_featureid" "ne_id" #REQUIRED
305- "oga_use_default_extent_for_getfeature" # Optional. Can improve performance.
309+ "oga_fallback_to_map_extent" "false" # Optional. Override WEB setting
310+ "oga_use_default_extent_for_getfeature" "true" # Optional. Override WEB setting
306311 "oga_queryable_items" "all" # required to allow filtering
307312 "oga_geometry_format" "geometry-polygn"
308313 "oga_sortable_items" "area"
@@ -462,13 +467,13 @@ Web Object Metadata
462467-------------------
463468
464469.. index::
465- triple: OGCAPI; METADATA; ows_extra_params
470+ triple: OGCAPI; METADATA; oga_extra_params
466471
467- **ows_extra_params **
472+ **oga_extra_params **
468473
469474 .. versionadded:: 8.6.0
470475
471- - *Description:* (Optional) The ``ows_extra_params `` (or ``oga_extra_params ``) metadata entry allows you to append
476+ - *Description:* (Optional) The ``oga_extra_params `` (or ``ows_extra_params ``) metadata entry allows you to append
472477 additional query parameters to all URLs generated by MapServer. This can be used, for example,
473478 to include authentication tokens such as JSON Web Tokens (JWT) in your API requests.
474479
@@ -522,6 +527,34 @@ Web Object Metadata
522527 The extra parameters are available in HTML templates for the OGC Features API as ``{{ template.extra_params }}``.
523528 The templates supplied in the MapServer repository append this value to all URLs by default.
524529
530+ .. _oga_fallback_to_map_extent:
531+
532+ .. index::
533+ triple: OGCAPI; METADATA; oga_fallback_to_map_extent
534+
535+ **oga_fallback_to_map_extent**
536+
537+ .. versionadded:: 8.8.0
538+
539+ - *Description:* (Optional) (or ``ows_fallback_to_map_extent``)
540+ When set to ``true``, if a ``LAYER`` has no explicit
541+ :ref:`EXTENT <mapfile-layer-extent>` and no ``ows_extent`` metadata item,
542+ MapServer will use the :ref:`MAP EXTENT <mapfile-map-extent>` as a fallback
543+ rather than querying the datasource to calculate the layer extent.
544+ The full priority order for extent resolution is:
545+
546+ 1. Layer ``ows_extent`` (or namespace-specific ``oga_extent``) metadata
547+ 2. Layer ``EXTENT``
548+ 3. Map ``EXTENT``, if this metadata item is set to ``true`` *(this option)*
549+ 4. Extent calculated from the datasource
550+
551+ Datasource extent calculation can be very slow for database
552+ layers. For some layer types (e.g. raster), it may be near-instant.
553+
554+ This item can be set in ``MAP WEB METADATA`` to apply to all layers, and
555+ can be overridden per-layer in ``LAYER METADATA`` to enable or disable the
556+ fallback for specific layers.
557+
525558.. index::
526559 triple: OGCAPI; METADATA; oga_features_cache_count
527560
@@ -543,20 +576,27 @@ Web Object Metadata
543576 Size of cache in bytes. See :ref:`wfs_features_cache_size` for details.
544577
545578.. index::
546- triple: OGCAPI; METADATA; ows_schemas_location
579+ triple: OGCAPI; METADATA; oga_geometry_format
547580
548- **ows_schemas_location **
581+ **oga_geometry_format **
549582
550- .. versionadded:: 8.2 .0
583+ .. versionadded:: 8.8 .0
551584
552- - *Description:* (Optional) (Note the name *ows_schemas_location* because all
553- OGC Web Services (OWS) use the same metadata) Root of the web tree where
554- the family of OGC API JSON Schema files are located. This must be a valid URL
555- where the actual .yaml files are located if you want your OpenAPI description
556- to be valid. Default is *http://schemas.opengis.net*
585+ - *Description:* (Optional) Value among "geometry-point", "geometry-multipoint",
586+ "geometry-linestring", "geometry-multilinestring", "geometry-polygon",
587+ "geometry-multipolygon", "geometry-geometrycollection", "geometry-any" (default value),
588+ "geometry-point-or-multipoint", "geometry-linestring-or-multilinestring"
589+ and "geometry-polygon-or-multipolygon"
557590
558- .. index::
559- triple: OGCAPI; METADATA; oga_queryable_items
591+ - Example Mapfile:
592+
593+ .. code-block:: mapfile
594+
595+ LAYER
596+ METADATA
597+ "oga_geometry_format" "geometry-polygon-or-multipolygon"
598+ END
599+ END
560600
561601**oga_queryable_items**
562602
@@ -604,41 +644,52 @@ Web Object Metadata
604644 END
605645 END
606646
647+ .. _oga_use_default_extent_for_getfeature:
648+
607649.. index::
608- triple: OGCAPI; METADATA; oga_geometry_format
650+ triple: OGCAPI; METADATA; ows_schemas_location
609651
610- **oga_geometry_format **
652+ **oga_use_default_extent_for_getfeature **
611653
612- .. versionadded:: 8.8 .0
654+ .. versionadded:: 8.4 .0
613655
614- - *Description:* (Optional) Value among "geometry-point", "geometry-multipoint",
615- "geometry-linestring", "geometry-multilinestring", "geometry-polygon",
616- "geometry-multipolygon", "geometry-geometrycollection", "geometry-any" (default value),
617- "geometry-point-or-multipoint", "geometry-linestring-or-multilinestring"
618- and "geometry-polygon-or-multipolygon"
656+ - *Description:* (Optional) (or ``ows_use_default_extent_for_getfeature``)
657+ Use ``MAP`` ``EXTENT`` as a spatial filter if no bbox is in the request.
658+ Setting to ``"false"`` can improve performance. See WFS equivalent
659+ at :ref:`wfs_use_default_extent_for_getfeature`.
619660
620- - Example Mapfile:
661+ **ows_schemas_location**
621662
622- .. code-block :: mapfile
663+ .. versionadded :: 8.2.0
623664
624- LAYER
625- METADATA
626- "oga_geometry_format" "geometry-polygon-or-multipolygon"
627- END
628- END
665+ - *Description:* (Optional) (Note the name *ows_schemas_location* because all
666+ OGC Web Services (OWS) use the same metadata) Root of the web tree where
667+ the family of OGC API JSON Schema files are located. This must be a valid URL
668+ where the actual .yaml files are located if you want your OpenAPI description
669+ to be valid. Default is *http://schemas.opengis.net*
629670
630671.. index::
631- triple: OGCAPI; METADATA; oga_use_default_extent_for_getfeature
672+ triple: OGCAPI; METADATA; oga_queryable_items
632673
633674Layer Object Metadata
634675---------------------
635676
677+ .. index::
678+ triple: OGCAPI; METADATA; oga_fallback_to_map_extent
679+
680+ **oga_fallback_to_map_extent**
681+
682+ .. versionadded:: 8.8.0
683+
684+ Same as :ref:`oga_fallback_to_map_extent <oga_fallback_to_map_extent>` in ``MAP WEB METADATA``, and can be
685+ set here to override the behaviour for individual layers.
686+
687+ .. index::
688+ triple: OGCAPI; METADATA; oga_use_default_extent_for_getfeature
689+
636690**oga_use_default_extent_for_getfeature**
637691
638692 .. versionadded:: 8.4.0
639693
640- - *Description:* (Optional) (or ``ows_use_default_extent_for_getfeature``)
641- Use ``MAP`` ``EXTENT`` as a spatial filter if no bbox is in the request.
642- Setting to ``"false"`` can improve performance. See WFS equivalent
643- at :ref:`wfs_use_default_extent_for_getfeature`.
644-
694+ Same as :ref:`oga_use_default_extent_for_getfeature <oga_use_default_extent_for_getfeature>` in ``MAP WEB METADATA``, and can be
695+ set here to override the behaviour for individual layers.
0 commit comments