Hi,
thank you for the fast reply. Unfortunately, even with the srs given with the bbox the "Fetch" command does not forward any bbox at all. So mapserver / OGR fetches up to the max number of features given no matter where they are located. They are then filtered out by mapserver using the original bbox because they do not fit (just the first 500 or so).

Mapfile layer definition (sorry I forgot):
LAYER
    NAME "GROUND_REFERENCE_VALUES_NI"
    UNITS METERS
    TYPE POLYGON
    DEBUG  "5"
    CONNECTION "ground_reference_values_ni.xml"
    CONNECTIONTYPE OGR
    STATUS ON
    DATA "boris:BR_BodenrichtwertZonal"
    METADATA
      "wfs_srs" "EPSG:25832"
      "wfs_version"    "1.1.0"
      "wfs_storedquery_id" ""
      "wfs_title"    "GROUND_REFERENCE_VALUES_NI"
      "wfs_connectiontimeout" "30"
      "wfs_typename"    "GROUND_REFERENCE_VALUES_NI_int"
      "wfs_maxfeatures"       "500"
      "gml_include_items" "all"
      "wfs_enable_request" "*"
      "gml_featureid"     "gml_id"
     
    END # METADATA

    PROJECTION
      "init=epsg:25832"
    END # PROJECTION
    CLASS
      NAME "reference_map"
      STYLE
        OUTLINECOLOR 255 0 0
        WIDTH 0.7
      END # STYLE
    END # CLASS
  END # LAYER

The XML file referenced is in attach.

Best
Lars

Am 29.03.22 um 10:06 schrieb artcliff...@gmail.com:

Hi Lars,

 

Might this help?

geoserver - WFS and WMS query SRS parameter and BBOX usage - Geographic Information Systems Stack Exchange

 

I haven’t done much with the WFS tech but based on the link above, you may need to provide the crs info for the bbox.

In their example:

http://demo.geo-solutions.it/geoserver/tiger/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=tiger:tiger_roads&srsName=EPSG:3857&bbox=40.7,-74,40.8,-73,urn:ogc:def:crs:EPSG:4326&maxFeatures=1

Note the bbox is defined as:
bbox=40.7,-74,40.8,-73,urn:ogc:def:crs:EPSG:4326


If your bbox is the same as the requested projection:
your bbox in the wfs request would be:

BBOX=545592,5806696,548144,5810131,urn:ogc:def:crs: EPSG:25832

Or the epsg code at the end would be whatever units your bbox is in.
Note, the bbox EPSG code can be different than the srsName



 

From: MapServer-users <mapserver-users-boun...@lists.osgeo.org> On Behalf Of Lars Fricke
Sent: Tuesday, March 29, 2022 12:31 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] mapserver OGR does not forward BBOX at all

 

Hi All,

First of all, thank you for your support and great work on Mapserver!

I have a strange issue using either OGR WFS driver on Mapserver 7.6.4-1 or ogrinfo (GDAL 3.0.4, released 2020/01/28) on Ubuntu 20.

When I call on a particular public server, mapserver / gdal / ogr does not seem to forward the bbox. I had a similar issue before (over a year ago) on another server but this was fixed by an update in GDAL it seemed.

The Server is

`https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?`

The Layer is
`boris:BR_BodenrichtwertZonal`

A direct call from the browser works:

`https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&SRSNAME=EPSG:25832&BBOX=545592,5806696,548144,5810131&TYPENAMES=boris:BR_BodenrichtwertZonal`

I can see in Mapserver log (CONFIG "CPL_DEBUG" "ON"  CONFIG "PROJ_DEBUG" "ON") that the BBOX is missing:

`Fetch(https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?SERVICE=WFS&VERSION=1.1.0&MAXFEATURES=500&SRSNAME=EPSG:25832&TRUST_CAPABILITIES_BOUNDS=YES&REQUEST=GetFeature&TYPENAME=boris:BR_BodenrichtwertZonal)`

By the way, it does not matter if WFS 1.1.0 or 2.0.0 are used.

Trying with ogrinfo:
```
ogrinfo -ro -spat 545592 5806696 548144 5810131 WFS:"https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022" "boris:BR_BodenrichtwertZonal"

INFO: Open of `WFS:https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022'
      using driver `WFS' successful.
Metadata:
  ABSTRACT=BORIS 2022 WFS by XtraServer
  PROVIDER_NAME=Landesamt für Geoinformation und Landesvermessung Niedersachsen (LGLN) - Landesbetrieb Landesvermessung und Geobasisinformation
  TITLE=BORIS 2022 WFS
ERROR 1: No schema information loaded
Warning 1: NAS: Skipping geometry without feature

Layer name: boris:BR_BodenrichtwertZonal
Metadata:
  TITLE=boris_BR_BodenrichtwertZonal
Geometry: None
Feature Count: 33931
```
There should be some 62 Features in that bbox.

Any help is much appreciated.

Best

Lars


<OGRWFSDataSource>
  <URL>https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?SERVICE=WFS&amp;VERSION=1.1.0&amp;MAXFEATURES=500&amp;SRSNAME=EPSG:25832</URL>
  <wfs:WFS_Capabilities xmlns:ows="http://www.opengis.net/ows"; xmlns:ogc="http://www.opengis.net/ogc"; xmlns:wfs="http://www.opengis.net/wfs"; xmlns:gml="http://www.opengis.net/gml"; xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://www.opengis.net/wfs http://www.boris.niedersachsen.de/schema/ii/wfs/1.1.0/wfs.xsd"; version="1.1.0">
    <ows:ServiceIdentification>
      <ows:Title>BORIS 2022 WFS</ows:Title>
      <ows:Abstract>BORIS 2022 WFS by XtraServer</ows:Abstract>
      <ows:Keywords>
        <ows:Keyword>AAA</ows:Keyword>
        <ows:Keyword>WFS</ows:Keyword>
        <ows:Keyword>BORIS</ows:Keyword>
      </ows:Keywords>
      <ows:ServiceType>WFS</ows:ServiceType>
      <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
      <ows:ServiceTypeVersion>1.1.0</ows:ServiceTypeVersion>
      <ows:ServiceTypeVersion>2.0.0</ows:ServiceTypeVersion>
      <ows:Fees>Dieses Angebot kann gemäß der "Datenlizenz Deutschland Namensnennung 2.0" (https://www.govdata.de/dl-de/by-2-0) genutzt werden. { "id": "dl-de-by-2.0", "name": "Datenlizenz Deutschland Namensnennung 2.0", "url": "https://www.govdata.de/dl-de/by-2-0 ", "quelle": "© GDI-NI" }</ows:Fees>
      <ows:AccessConstraints>Es gelten keine Beschränkungen.</ows:AccessConstraints>
    </ows:ServiceIdentification>
    <ows:ServiceProvider>
      <ows:ProviderName>Landesamt für Geoinformation und Landesvermessung Niedersachsen (LGLN) - Landesbetrieb Landesvermessung und Geobasisinformation</ows:ProviderName>
      <ows:ProviderSite />
      <ows:ServiceContact>
        <ows:IndividualName>Kundenservice - Geodatenmanagement</ows:IndividualName>
        <ows:ContactInfo>
          <ows:Phone>
            <ows:Voice>+49 511 64609 555</ows:Voice>
          </ows:Phone>
          <ows:Address>
            <ows:DeliveryPoint>Podbielskistraße 331</ows:DeliveryPoint>
            <ows:City>Hannover</ows:City>
            <ows:AdministrativeArea>NI</ows:AdministrativeArea>
            <ows:PostalCode>30659</ows:PostalCode>
            <ows:Country>DE</ows:Country>
            <ows:ElectronicMailAddress>geodatendien...@lgln.niedersachsen.de</ows:ElectronicMailAddress>
          </ows:Address>
          <ows:OnlineResource xlink:href="http://www.lgln.niedersachsen.de"; />
          <ows:HoursOfService>0900 - 1800 GMT+1, Mon - Fri</ows:HoursOfService>
        </ows:ContactInfo>
        <ows:Role>pointOfContact</ows:Role>
      </ows:ServiceContact>
    </ows:ServiceProvider>
    <ows:OperationsMetadata>
      <ows:Operation name="GetCapabilities">
        <ows:DCP>
          <ows:HTTP>
            <ows:Get xlink:href="https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?"; />
            <ows:Post xlink:href="https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022"; />
          </ows:HTTP>
        </ows:DCP>
        <ows:Parameter name="AcceptVersions">
          <ows:Value>1.1.0</ows:Value>
          <ows:Value>1.0.0</ows:Value>
        </ows:Parameter>
        <ows:Parameter name="AcceptFormats">
          <ows:Value>text/xml</ows:Value>
        </ows:Parameter>
        <ows:Parameter name="Sections">
          <ows:Value>ServiceIdentification</ows:Value>
          <ows:Value>ServiceProvider</ows:Value>
          <ows:Value>OperationsMetadata</ows:Value>
          <ows:Value>FeatureTypeList</ows:Value>
          <ows:Value>Filter_Capabilities</ows:Value>
        </ows:Parameter>
      </ows:Operation>
      <ows:Operation name="DescribeFeatureType">
        <ows:DCP>
          <ows:HTTP>
            <ows:Get xlink:href="https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?"; />
            <ows:Post xlink:href="https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022"; />
          </ows:HTTP>
        </ows:DCP>
        <ows:Parameter name="outputFormat">
          <ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.2.1</ows:Value>
        </ows:Parameter>
      </ows:Operation>
      <ows:Operation name="GetFeature">
        <ows:DCP>
          <ows:HTTP>
            <ows:Get xlink:href="https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022?"; />
            <ows:Post xlink:href="https://www.geobasisdaten.niedersachsen.de/doorman/noauth/WFS_boris_2022"; />
          </ows:HTTP>
        </ows:DCP>
        <ows:Parameter name="outputFormat">
          <ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.2.1</ows:Value>
        </ows:Parameter>
      </ows:Operation>
      <ows:Parameter name="srsName">
        <ows:Value>urn:ogc:def:crs:EPSG::25832</ows:Value>
        <ows:Value>urn:ogc:def:crs:EPSG::25833</ows:Value>
        <ows:Value>urn:ogc:def:crs:EPSG::31466</ows:Value>
        <ows:Value>urn:ogc:def:crs:EPSG::31467</ows:Value>
        <ows:Value>urn:ogc:def:crs:EPSG::31468</ows:Value>
        <ows:Value>urn:ogc:def:crs:EPSG::3857</ows:Value>
        <ows:Value>urn:ogc:def:crs:EPSG::4326</ows:Value>
      </ows:Parameter>
      <ows:Constraint name="SupportsSOAP">
        <ows:Value>false</ows:Value>
      </ows:Constraint>
    </ows:OperationsMetadata>
    <wfs:FeatureTypeList>
      <wfs:Operations />
      <wfs:FeatureType xmlns:adv="http://www.adv-online.de/namespaces/adv/gid/6.0";>
        <wfs:Name>adv:AP_PTO</wfs:Name>
        <wfs:Title>adv_AP_PTO</wfs:Title>
        <wfs:DefaultSRS>urn:ogc:def:crs:EPSG::25832</wfs:DefaultSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::25833</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31466</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31467</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31468</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::3857</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::4326</wfs:OtherSRS>
        <ows:WGS84BoundingBox>
          <ows:LowerCorner>6.52640537710899 51.197380590964</ows:LowerCorner>
          <ows:UpperCorner>11.778602087014 54.0327816786432</ows:UpperCorner>
        </ows:WGS84BoundingBox>
      </wfs:FeatureType>
      <wfs:FeatureType xmlns:boris="http://www.adv-online.de/namespaces/adv/boris/2.0";>
        <wfs:Name>boris:BR_BodenrichtwertLagetypisch</wfs:Name>
        <wfs:Title>boris_BR_BodenrichtwertLagetypisch</wfs:Title>
        <wfs:DefaultSRS>urn:ogc:def:crs:EPSG::25832</wfs:DefaultSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::25833</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31466</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31467</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31468</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::3857</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::4326</wfs:OtherSRS>
        <ows:WGS84BoundingBox>
          <ows:LowerCorner>6.52640537710899 51.197380590964</ows:LowerCorner>
          <ows:UpperCorner>11.778602087014 54.0327816786432</ows:UpperCorner>
        </ows:WGS84BoundingBox>
      </wfs:FeatureType>
      <wfs:FeatureType xmlns:boris="http://www.adv-online.de/namespaces/adv/boris/2.0";>
        <wfs:Name>boris:BR_BodenrichtwertZonal</wfs:Name>
        <wfs:Title>boris_BR_BodenrichtwertZonal</wfs:Title>
        <wfs:DefaultSRS>urn:ogc:def:crs:EPSG::25832</wfs:DefaultSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::25833</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31466</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31467</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31468</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::3857</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::4326</wfs:OtherSRS>
        <ows:WGS84BoundingBox>
          <ows:LowerCorner>6.52640537710899 51.197380590964</ows:LowerCorner>
          <ows:UpperCorner>11.778602087014 54.0327816786432</ows:UpperCorner>
        </ows:WGS84BoundingBox>
      </wfs:FeatureType>
      <wfs:FeatureType xmlns:boris="http://www.adv-online.de/namespaces/adv/boris/2.0";>
        <wfs:Name>boris:BR_UmrechnungstabelleDatei</wfs:Name>
        <wfs:Title>boris_BR_UmrechnungstabelleDatei</wfs:Title>
        <wfs:DefaultSRS>urn:ogc:def:crs:EPSG::25832</wfs:DefaultSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::25833</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31466</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31467</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31468</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::3857</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::4326</wfs:OtherSRS>
        <ows:WGS84BoundingBox>
          <ows:LowerCorner>6.52640537710899 51.197380590964</ows:LowerCorner>
          <ows:UpperCorner>11.778602087014 54.0327816786432</ows:UpperCorner>
        </ows:WGS84BoundingBox>
      </wfs:FeatureType>
      <wfs:FeatureType xmlns:boris="http://www.adv-online.de/namespaces/adv/boris/2.0";>
        <wfs:Name>boris:BR_UmrechnungstabelleWerte</wfs:Name>
        <wfs:Title>boris_BR_UmrechnungstabelleWerte</wfs:Title>
        <wfs:DefaultSRS>urn:ogc:def:crs:EPSG::25832</wfs:DefaultSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::25833</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31466</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31467</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31468</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::3857</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::4326</wfs:OtherSRS>
        <ows:WGS84BoundingBox>
          <ows:LowerCorner>6.52640537710899 51.197380590964</ows:LowerCorner>
          <ows:UpperCorner>11.778602087014 54.0327816786432</ows:UpperCorner>
        </ows:WGS84BoundingBox>
      </wfs:FeatureType>
      <wfs:FeatureType xmlns:boris="http://www.adv-online.de/namespaces/adv/boris/2.0";>
        <wfs:Name>boris:BR_Verfahren</wfs:Name>
        <wfs:Title>boris_BR_Verfahren</wfs:Title>
        <wfs:DefaultSRS>urn:ogc:def:crs:EPSG::25832</wfs:DefaultSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::25833</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31466</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31467</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::31468</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::3857</wfs:OtherSRS>
        <wfs:OtherSRS>urn:ogc:def:crs:EPSG::4326</wfs:OtherSRS>
        <ows:WGS84BoundingBox>
          <ows:LowerCorner>6.52640537710899 51.197380590964</ows:LowerCorner>
          <ows:UpperCorner>11.778602087014 54.0327816786432</ows:UpperCorner>
        </ows:WGS84BoundingBox>
      </wfs:FeatureType>
    </wfs:FeatureTypeList>
    <ogc:Filter_Capabilities>
      <ogc:Spatial_Capabilities>
        <ogc:GeometryOperands>
          <ogc:GeometryOperand>gml:Envelope</ogc:GeometryOperand>
          <ogc:GeometryOperand>gml:Point</ogc:GeometryOperand>
          <ogc:GeometryOperand>gml:LineString</ogc:GeometryOperand>
          <ogc:GeometryOperand>gml:Polygon</ogc:GeometryOperand>
          <ogc:GeometryOperand>gml:Arc</ogc:GeometryOperand>
          <ogc:GeometryOperand>gml:CubicSpline</ogc:GeometryOperand>
        </ogc:GeometryOperands>
        <ogc:SpatialOperators>
          <ogc:SpatialOperator name="BBOX" />
          <ogc:SpatialOperator name="Equals" />
          <ogc:SpatialOperator name="Disjoint" />
          <ogc:SpatialOperator name="Intersects" />
          <ogc:SpatialOperator name="Touches" />
          <ogc:SpatialOperator name="Crosses" />
          <ogc:SpatialOperator name="Within" />
          <ogc:SpatialOperator name="Contains" />
          <ogc:SpatialOperator name="Overlaps" />
          <ogc:SpatialOperator name="Beyond" />
          <ogc:SpatialOperator name="DWithin" />
        </ogc:SpatialOperators>
      </ogc:Spatial_Capabilities>
      <ogc:Scalar_Capabilities>
        <ogc:LogicalOperators />
        <ogc:ComparisonOperators>
          <ogc:ComparisonOperator>LessThan</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>GreaterThan</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>LessThanEqualTo</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>GreaterThanEqualTo</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>EqualTo</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>NotEqualTo</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>Like</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>Between</ogc:ComparisonOperator>
          <ogc:ComparisonOperator>NullCheck</ogc:ComparisonOperator>
        </ogc:ComparisonOperators>
        <ogc:ArithmeticOperators>
          <ogc:SimpleArithmetic />
        </ogc:ArithmeticOperators>
      </ogc:Scalar_Capabilities>
      <ogc:Id_Capabilities>
        <ogc:FID />
        <ogc:EID />
      </ogc:Id_Capabilities>
    </ogc:Filter_Capabilities>
  </wfs:WFS_Capabilities>
</OGRWFSDataSource>

Attachment: OpenPGP_0x667E0B7B73E250FB.asc
Description: OpenPGP public key


Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to