[MapServer-users] OGCAPI
Jörg Thomsen (WhereGroup)
joerg.thomsen at wheregroup.com
Wed Apr 9 00:28:37 PDT 2025
Hello Sven,
somehow qgis tried to use a wfs-request. I had to configure your service
explizit as OGC-Api (not "Maximum") and delete the cache in QGIS. Now I
can use both collections.
The kdb_alle works not for all items, I have tried up to 10.000 (in QGIS
with checkbox 'only load items i curent mapxtent'.
https://kulturdb.de/cgi-bin/mapserv/kdb_ogcapi/ogcapi/collections/kdb_alle/items?f=json&limit=10000
Don't know what ist happening, perhaps the MapServer log can tell you more.
Jörg
Am 08.04.25 um 17:56 schrieb Schroeter via MapServer-users:
> Hi all,
>
> I am currently testing the ogcapi function in the current Mapserver 8.4
> and already have an example online:
> https://kulturdb.de/cgi-bin/mapserv/kdb_ogcapi/ogcapi/collections?f=html
> In the first collection, all objects (approx. 48,000 point objects from
> a Postgis DB) are queried. Unfortunately extremely slow.
> If I query all objects via a WMS, they come very quickly, it should not
> be due to the DB or the connection, everything is cleanly indexed etc.:
> https://kulturdb.de/cgi-bin/mapserv?map=kdb&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=49.49%2C6.0739%2C50.4%2C7.296&CRS=EPSG%3A4326&WIDTH=762&HEIGHT=588&LAYERS=kdb_alle&STYLES=&FORMAT=image%2Fpng
>
> With the second collection with only 333 objects, it works quite well:
> https://kulturdb.de/cgi-bin/mapserv/kdb_ogcapi/ogcapi/collections/kdb_brunnen/items?f=html
>
> Here is the map file for it
>
> MAP
> NAME "kdb_trier"
> STATUS ON
> SIZE 400 400
> EXTENT 6.074 49.492 7.296 50.435
> UNITS METERS
>
> PROJECTION
> "init=epsg:4326"
> END
>
> WEB
> METADATA
> # OGC API Features Konfiguration
> "ows_enable_request" "*"
> "ows_getfeatureinfo_formatlist"
> "text/plain,text/html,application/json,application/vnd.ogc.gml,gml"
> "oga_onlineresource"
> "https://kulturdb.de/cgi-bin/mapserv/kdb_ogcapi/ogcapi"
> "oga_title" "KDB Trier"
> "oga_abstract" "Objekte der
> Kulturdatenbank der Region Trier"
> "oga_srs" "EPSG:25832 EPSG:4326
> EPSG:3857"
> "oga_html_template_directory"
> "/var/www/html/ogcapi/templates/html-bootstrap4/"
> "oga_extent" "6.074 49.492 7.296 50.435"
> "oga_use_default_extent_for_getfeature" "true"
> "oga_limit_default" "10"
> "oga_limit_max" "500"
> "oga_paging" "true"
> "oga_paging_linkheader" "true"
> "gml_include_items" "all"
> "gml_featureid" "lfdnr"
> END
>
> TEMPLATE "/var/www/mapserver/template/dummy.html"
>
> END
>
> OUTPUTFORMAT
> NAME "png"
> DRIVER AGG/PNG
> MIMETYPE "image/png"
> IMAGEMODE RGB
> EXTENSION "png"
> FORMATOPTION "GAMMA=0.75"
> END
>
> OUTPUTFORMAT
> NAME "application/json"
> DRIVER "OGR/GEOJSON"
> MIMETYPE "application/json"
> FORMATOPTION "FORM=SIMPLE"
> FORMATOPTION "STORAGE=memory"
> END
>
> SYMBOL
> NAME "circle"
> TYPE ELLIPSE
> POINTS
> 1 1
> END
> FILLED TRUE
> END
>
> LAYER
> NAME "kdb_alle"
> TYPE POINT
> STATUS ON
> INCLUDE "_connection_kdb.inc"
> DATA "the_geom FROM kdb_kultur_ogr USING UNIQUE lfdnr"
> PROJECTION
> "init=epsg:4326"
> END
>
> METADATA
>
> # OGC API Features Metadaten
> "oga_title" "KDB Trier - alle Objekte"
> "oga_description" "Alle Objekte der
> Kulturdatenbank der Region Trier"
> "oga_id_field" "lfdnr"
> "oga_queryable" "true"
> "oga_extent" "6.074 49.492 7.296 50.435"
> "ows_title" "KDB Trier - alle Objekte"
> "ows_abstract" "Alle Objekte der
> Kulturdatenbank der Region Trier"
> "oga_extent" "6.074 49.492 7.296 50.435"
> "oga_use_default_extent_for_getfeature" "true"
> "oga_limit_default" "10"
> "oga_limit_max" "500"
> "oga_paging" "true"
> "oga_paging_linkheader" "true"
> "gml_include_items" "all"
> "gml_featureid" "lfdnr"
>
> END
>
> TEMPLATE "/var/www/mapserver/template/dummy.html"
>
> CLASS
> NAME "KDB"
> STYLE
> SYMBOL "circle"
> SIZE 6
> COLOR 255 0 0
> OUTLINECOLOR 255 255 255
> END
> END
> END # LAYER
>
>
> LAYER
> NAME "kdb_brunnen"
> TYPE POINT
> STATUS ON
> INCLUDE "_connection_kdb.inc"
> DATA "the_geom FROM (SELECT * FROM kdb_kultur_ogr WHERE b_kateg =
> 'Brunnen') AS foo USING UNIQUE lfdnr"
> PROJECTION
> "init=epsg:4326"
> END
>
> METADATA
>
> # OGC API Features Metadaten
> "oga_title" "KDB Trier - Brunnen"
> "oga_description" "Brunnen Objekte der
> Kulturdatenbank der Region Trier"
> "oga_id_field" "lfdnr"
> "oga_queryable" "true"
> "oga_extent" "6.074 49.492 7.296
> 50.435"
> "ows_title" "KDB Trier - Brunnen"
> "ows_abstract" "Brunnen Objekte der
> Kulturdatenbank der Region Trier"
> "oga_extent" "6.074 49.492 7.296 50.435"
> "oga_use_default_extent_for_getfeature" "true"
> "oga_limit_default" "10"
> "oga_limit_max" "500"
> "oga_paging" "true"
> "oga_paging_linkheader" "true"
> "gml_include_items" "all"
> "gml_featureid" "lfdnr"
>
> END
>
> TEMPLATE "/var/www/mapserver/template/dummy.html"
>
> CLASS
> NAME "KDB"
> STYLE
> SYMBOL "circle"
> SIZE 6
> COLOR 255 0 0
> OUTLINECOLOR 255 255 255
> END
> END
> END # LAYER
>
>
> END # MAP
>
> THE MS Version:
> MapServer version 8.4.0 PROJ version 9.1 GDAL version 3.6 OUTPUT=PNG
> OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
> SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
> SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
> SUPPORTS=SOS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=FASTCGI
> SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR
> INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF
>
> 1. How can I speed up the display for the first collection?
> 2. the collections are not recognised in QGIS, What ist wrong?
>
> Thanx
> Sven
>
>
>
>
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
--
Viele Grüße,
Jörg Thomsen
****************************************
WhereGroup Shorts 2025 - am 15. Mai
Im Fokus: PostgreSQL & PostGIS
Online als Zoom-Meeting
https://wheregroup-shorts.de
****************************************
Jörg Thomsen
WhereGroup GmbH
Bundesallee 23
10717 Berlin
Germany
Tel: +49 (0)30 / 5130 278 74
Fax: +49 (0)30 / 5130 278 11
joerg.thomsen at wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
More information about the MapServer-users
mailing list