camptocamp / docker-mapserver

https://hub.docker.com/r/camptocamp/mapserver/
BSD 2-Clause "Simplified" License
42 stars 30 forks source link

OGC API Bootstrap configuration issue? #780

Closed nmtoken closed 3 months ago

nmtoken commented 3 months ago

On my camptocamp docker, I've configured ogcapi. Home is

http://172.29.64.117:591/oga_one/ogcapi

This displays an html page as expected

Information about feature collections available from this server

http://172.29.64.117:591/oga_one/ogcapi/collections?f=html

HTML page is displayed, but links are incorrect

links like:

http://172.29.64.117:591/oga_one/ogcapi/collections/collections/GBR_BGS_625k_BA?

If you correct to http://172.29.64.117:591/oga_one/ogcapi/collections/GBR_BGS_625k_BA?f=html i.e. remove the extra collections/ you get an HTML page but in that page the links are incorrect, so the Items for this collection as HTML link becomes http://172.29.64.117:591/oga_one/ogcapi/collections/GBR_BGS_625k_BA/collections/GBR_BGS_625k_BA/items? i.e. repeats collections/GBR_BGS_625k_BA/

It appears that {{ template.api_root }} and {{ response.collection.id }} are not being set correctly somehow.

As way of expected behaviour I have a gisinternals MapServer 8.0.1 service with OGC API configured for the same data.:

Home

https://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Surface_Geology/ows/bbsp/ogcapi

Information about feature collections available from this server

https://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/ows/bbsp/ogcapi/collections?f=html

GBR BGS 1:625k Bedrock Age (feature collection)

https://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/ows/bbsp/ogcapi/collections/GBR_BGS_625k_BA?f=html

Items for this collection as HTML

https://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/ows/bbsp/ogcapi/collections/GBR_BGS_625k_BA/items?f=html

Am I misconfigured somehow, or is this an issue with the image

sbrunner commented 3 months ago

Yes, it's because you should set the MAPSERVER_BASE_PATH to oga_one. Is it solving your issue?

sbrunner commented 3 months ago

I improve the documentation here: #781

nmtoken commented 3 months ago

So my global map file (/etc/mapserver.conf) has:

MAPS
    oga_one "/etc/mapserver/apps/BGS_Bedrock_and_Superficial_Geology/1g.map"
    oga_hov "/etc/mapserver/apps/hover/hover.map"
END

and

OGCAPI_HTML_TEMPLATE_DIRECTORY "/usr/local/share/mapserver/ogcapi/templates/html-bootstrap4/"

How do I set MAPSERVER_BASE_PATH ?

If I set it to oga_one I assume it means that oga_hov ogcapi won't work.

nmtoken commented 3 months ago

My error (nothing to do with MAPSERVER_BASE_PATH)

I forgot to set oga_onlineresource in MAP > WEB > METADATA

Fixed with

"oga_onlineresource" "/oga_one/ogcapi"