According to the Layer Schema GDAL docs GDAL Driver does the following:
OGR needs a fixed schema per layer, but OGC API - Features Core doesn’t impose fixed schema. So the driver will retrieve the first page of features (10 features) and establish a schema from this
Is there any way of how to prevent this behaviour from happening?
How our system is set up:
WebClient ---> MapServer (WMS) ---> OGC Features API server
The web client fires a GetMap
request to the MapServer(v8) in a form like this:
http://our.mapserver.domain/cgi-bin/mapserv?map=/etc/mapserver/playground/mapFile.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=25.15879999999999939,55.32805299999999704,25.30794399999999911,55.46175600000000117&CRS=EPSG:4326&WIDTH=728&HEIGHT=811&LAYERS=SOME_LAYER&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE&datetime=2025-02-02T17:46:06Z
MapServer then contacts our "OGC Features API enabled" backend. And here's the problem
Why does it fire the first request (without) bbox and then continues with pagination? The wireshark sniffing may give a better overview. You can see how nicely it automatically increments the offset
Our goal is to get rid of this first request without bbox and start immediately with page 1
What we have tried so far is the IGNORE_SCHEMA
flag set to NO in the mapfile
LAYER
CONNECTIONTYPE OGR
TYPE polygon
CONNECTIONOPTIONS
"PAGE_SIZE" "100"
"IGNORE_SCHEMA" "NO"
END
END
and we hoped it will download the schema in a separate call so it will not be forced to fire this establishment query. The schema was downloaded but it didn't prevent the MapServer (GDAL respectively) from firing this unwanted initial request