[mapserver-users] Mapserver URL request layer

Sander Pukk sander.pukk at gmail.com
Wed Feb 9 01:26:14 PST 2022


Hi there!

Trying to use a geojson output from API directly in Mapserver layer.
Geojson is per standard, 4326, but my Mapserver and OL (the client) is
configured to 3301.
We have hundreds of layers (mostly from Postgres) at the same time and the
system works.
No other direct API ones.

The current MAP file's WEB part looks like this:

  WEB
>       METADATA
>         "wfs_title"                     "title"
>         "wfs_enable_request"            "*"
>         "wms_enable_request"            "*"
>         "wfs_encoding"                  "UTF-8"
>         "wms_title"                     "title"
>         "wms_encoding"                  "UTF-8"
>         "wms_onlineresource"
>  "url/mapserv?map=/app/gis/infokihid/infolayers_other.map&"
>         "wfs_onlineresource"
>  "url/mapserv?map=/app/gis/infokihid/infolayers_other.map&"
>         "ows_srs"                            "EPSG:3301 EPSG:3857
> EPSG:4326"
>         "ows_enable_request"            "*"
>         "wfs_getfeature_formatlist"     "gml,geojson"
>         "wms_feature_info_mime_type"
>  "application/json,application/json;
> subtype=geojson,application/vnd.ogc.gml,text/plain"
>       END
>   END



>   PROJECTION
>       "init=epsg:3301"
>   END



And the layer:

    PROJECTION
>         "init=epsg:4326"
>     END
>
>     METADATA
>         "wfs_srs"               "EPSG:3301"
>         "gml_msGeometry_type" "line"

*         #"ows_extent" "40500 5993000 1064500 7017000" copy paste lon and
> lat from these 3301 coordinates from other layer's capabilites*
>         "ows_extent" "14.9318705986602 53.7681633673032 35.1060366818735
> 63.2747817924556"
>         "wfs_extent"        "14.9318705986602 53.7681633673032
> 35.1060366818735 63.2747817924556"
>         "wms_extent"        "14.9318705986602 53.7681633673032
> 35.1060366818735 63.2747817924556"
>         "ows_title" "road_restrictions"
>         "ows_abstract" "road_restrictions"
>         "ows_keywordlist" "road_restrictions"
>         "ows_include_items" "all"
>         "gml_include_items" "all"
>         "ows_featureid" "id"
>         "gml_exclude_items"         "edges,geometry"
>         "ows_exclude_items"         "edges,geometry"
>     END



 Couple of questions I have which I didnt really find answers for:


   1. Had issues with 4326 to 3301 transformation,the extent and all that.
   (OpenLayers could manage but QGIS couldnt). Previously only had ows_extent.
   Is ows_extent even a thing? This only shows wms_extent
   https://mapserver.org/ogc/wms_server.html#layer-object-metadata
   Should you use wfs_extent and wms_extent instead?
   2. My layer is doing an OGR connection directly to the API URL. Works
   fine. My question is, the API renews itself every 2 minutes (new data).
   How does Mapserver handle the request with that connection? I move the
   map (openlayers), there's a new Mapserver request - does Mapserver make a
   new request to the API endpoint and get a new json?
   Or is there some sort of cache?
   3. Am I missing something else from the Metadata that I should consider?


With kind regards,
Sander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20220209/02cd747c/attachment.html>


More information about the MapServer-users mailing list