[MapServer-users] OGCAPI

Schroeter schroeter at netgis.de
Wed Apr 9 02:52:02 PDT 2025


Hi Jukka,

Thank you very much, that was the solution for QGIS.
I now also have an interim solution for performance.
I have exported the table as a geopackage and connected it, and lo and 
behold, everything runs very quickly:
https://kulturdb.de/cgi-bin/mapserv/kdb_ogcapi/ogcapi/collections/kdb_alle/items?f=json&limit=10000
Since my queries to the Postgis table also run very quickly via PHP, it 
can't really be the Postgis DB. Is the performance problem in MS with 
Postgis a bug?

Greetings

Sven Schröter

**************************************
NETGIS GbR
Benediktinerstr. 32a
54292 Trier
Tel.: 0651-1704731
Fax: 0651-1704733
schroeter at netgis.de
www.netgis.de



Am 09.04.2025 um 11:03 schrieb Rahkonen Jukka:
> The URL to use for the connection is the URL of the landing page
>
> https://kulturdb.de/cgi-bin/mapserv/kdb_ogcapi/ogcapi/
>
> That link opens as http on a browser but QGIS knows how to read the document as JSON.
>
> -Jukka Rahkonen-
>
> ________________________________________
> Lähettäjä: MapServer-users käyttäjän Schroeter via MapServer-users puolesta
> Lähetetty: Keskiviikko 9. huhtikuuta 2025 11.50
> Vastaanottaja:mapserver-users at lists.osgeo.org
> Aihe: Re: [MapServer-users] OGCAPI
>
>
> Hello Jörg,
>
> thanks for the answer, strangely enough Qgis (version 3.4) is still
> stubbornly trying to send me a WFS request. I have now also cleared the
> cache and explicitly set OGC-Api. The wrong request is always set in the
> diagnostic tools. Which url do you enter as the source in Qgis? Have you
> ever created a service with > 40,000 objects?
>
> Sven
>
>
>
>
>
> Am 09.04.2025 um 09:28 schrieb Jörg Thomsen (WhereGroup) via
> MapServer-users:
>> 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
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20250409/22414624/attachment.htm>


More information about the MapServer-users mailing list