[mapserver-users] Setting up a template for custom WFS GetFeature response

Seth G sethg at geographika.co.uk
Tue May 25 02:02:52 PDT 2021


Hi Marcin,

What does your GetFeature request look like?

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Tue, May 25, 2021, at 10:55 AM, Marcin Grudzień wrote:
> Hello,

>  

> I have been trying to set up INSPIRE WFS service publishing data in GML that validates against INSPIRE GML application schemas. To achieve that I use template-driven output, basically following https://mapserver.org/fr/output/template_output.html. However, I am not able to force MapServer to use my GetFeature response template. GetFeature response always returns “standard” MapServer GML, which of course, is not INSPIRE compliant. 

>  

> Below you can find my configuration details.

> I am using 7.6.3 version build on Ubuntu 20.04 LTR

> mapserv -v returns 

> MapServer version 7.6.3 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=POINT_Z_M SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

>  

> My mapfile looks like this

> MAP

> NAME "LandCover"

> STATUS ON

> EXTENT 160828.34326572 98928.8977745594 876029.97009323 796521.669409553

> UNITS meters

> SIZE 100 100

> MAXSIZE 4000

> FONTSET "/srv/Fonts/Fontset.txt"

> CONFIG "MS_ERRORFILE" "/srv/lc/error_lc_wfs.txt"

> DEBUG 5

> 

> PROJECTION

> "init=epsg:2180"

> 

> END

>  

> OUTPUTFORMAT

>             NAME "gml"

>             DRIVER "TEMPLATE"

>             #MIMETYPE "text/xml; subtype=gml/3.2.1"

>             FORMATOPTION "FILE=LC_template.gml"

> END

>  

> WEB

> METADATA

> "ows_inspire_capabilities" "url"

> "ows_languages" "pol,eng"       

> "ows_title" "Title PL"

> "ows_title.eng" "WFS service with INSPIRE Land Cover"

> "ows_abstract" "Abstract PL"

> "ows_abstract.eng" "WMS service publishes harmonised INSPIRE Land Cover data set derrived from BDOT10k as-is data set "

> "ows_fees" "Brak opłat"

> "ows_fees.eng" "No fee applies"

>  WFS_ONLINERESOURCE "http://localhost/cgi-bin/LC_WFS"

> "wfs_getfeature_formatlist" "gml"

> "wfs_inspire_metadataurl_href"    "someurl"

> "wfs_inspire_metadataurl_format"  "application/vnd.ogc.csw.GetRecordByIdResponse_xml"

>              

> "ows_inspire_dsid_code" "LC "

> "ows_inspire_dsid_ns" "LC.3.2"

>              

> "wfs_enable_request"           "*"

> "wfs_srs" "EPSG:2180 EPSG:4326 EPSG:3857 EPSG:4528"

> END

>  

> END #WEB

>  

> LAYER

>             NAME "LC.LandCoverUnit"

>             STATUS ON

>             CONNECTIONTYPE POSTGIS

>             CONNECTION "host=localhost dbname=postgis_db user=user password=password port=5432"

>             DATA "geom from bdot.landcoversurface using unique objectid using srid=2180"

>                         

>             PROJECTION

>                         "init=epsg:2180"

>             END

>  

>             TYPE POLYGON

>             PROCESSING "CLOSE_CONNECTION=DEFER"

>             TEMPLATE "LC_template.gml"

>             METADATA

>                         "ows_title.pol" "LC.LandCoverUnit"

>                         "ows_title.eng" "LC.LandCoverUnit"

>                         WFS_EXTENT "160828.34326572 98928.8977745594 876029.97009323 796521.669409553"

>                         "gml_include_items" "all" 

>                         "gml_featureid"     "objectid" 

>                         "wfs_getfeature_formatlist" "gml"

>                          "wfs_enable_request" "*"

>                         "wfs_connectiontimeout" "120"

>                         "wfs_maxfeatures"       "10000"

>                         "wfs_srs" "EPSG:2180 EPSG:4326 EPSG:3857 EPSG:4528"

>                         "wfs_metadataurl_href" "someurl"

>                         "wfs_inspire_metadataurl_format" "application/xml"

>                         "wfs_metadataurl_type" "TC211"

>               END #METADATA 

>  

> END #LAYER 

>  

> END #MAP

>  

> I tried different OUTPUTFORMAT configurations with different NAME, MIMETYPE parameter values. And nothing has worked.

> On the same machine, I successfully published WMS service returning HTML GetFeatureInfo response customized utilizing the very same template-driven output concept.

> I suspect that I may be missing something in the configuration file. I would be grateful for any suggestions.

>  

> Best regards,

> Marcin

>  

> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org <mailto:mapserver-users%40lists.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/20210525/41fcc396/attachment.htm>


More information about the MapServer-users mailing list