[mapserver-users] map server WFS with GML input

Lime, Steve D (MNIT) steve.lime at state.mn.us
Thu May 16 14:25:28 PDT 2019


Hi Leigh: Welcome! MapServer by default won't expose any attributes unless you explicitly tell it to. Look at the gml_include_items and gml_exclude_items layer metadata on this page:


  https://mapserver.org/ogc/wfs_server.html

--Steve
________________________________
From: mapserver-users <mapserver-users-bounces at lists.osgeo.org> on behalf of Leigh Porter <leigh at bowline.tech>
Sent: Thursday, May 16, 2019 2:24:59 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] map server WFS with GML input


Hey All!

I just joined the list. I have used mapserver for a while and just started with WFS.


I’m serving WFS requests from a GML input file. Input is like this:

<gml:featureMember>
    <ogr:2019_03_avon_and_somerset_street fid="2019_03_avon_and_somerset_street.0">
      <ogr:geometryProperty><gml:Point><gml:coordinates>-3.187863,54.948226</gml:coordinates></gml:Point></ogr:geometryProperty>
      <ogr:Crime_ID>f2964c095957f50f54b16d18c71be4a1f09f55e7f321edac3f38b469877e7fc5</ogr:Crime_ID>
      <ogr:Month>2019-03</ogr:Month>
      <ogr:Reported_by>Avon and Somerset Constabulary</ogr:Reported_by>
      <ogr:Falls_within>Avon and Somerset Constabulary</ogr:Falls_within>
      <ogr:Location>On or near Field View</ogr:Location>
      <ogr:LSOA_code>E01019107</ogr:LSOA_code>
      <ogr:LSOA_name>Allerdale 002B</ogr:LSOA_name>
      <ogr:Crime_type>Other theft</ogr:Crime_type>
      <ogr:Last_outcome_category>Under investigation</ogr:Last_outcome_category>
      <ogr:Context></ogr:Context>
    </ogr:2019_03_avon_and_somerset_street>
  </gml:featureMember>

But the output doesn’t include any of the other feature attributes (such as Crime_ID).

<wfs:member>
    <ms:sas-avon>
        <gml:boundedBy>
            <gml:Envelope
                srsName="urn:ogc:def:crs:EPSG::4326">
                <gml:lowerCorner>
                    50.948685 -2.807610
                    </gml:lowerCorner>
                <gml:upperCorner>
                    50.948685 -2.807610
                    </gml:upperCorner>
                </gml:Envelope>
            </gml:boundedBy>
        <ms:msGeometry>
            <gml:Point
                gml:id=".1"
                srsName="urn:ogc:def:crs:EPSG::4326">
                <gml:pos>
                    50.948685 -2.807610
                    </gml:pos>
                </gml:Point>
            </ms:msGeometry>
        </ms:sas-avon>
    </wfs:member>

The mapfile looks like this:

   LAYER
                NAME street-avon
                TYPE POINT
                STATUS DEFAULT
                CONNECTIONTYPE OGR
                CONNECTION "/vsicurl/http://127.0.0.1/2019-03-avon-and-somerset-street.csv.gml<https://gcc01.safelinks.protection.outlook.com/?url=http%3A%2F%2F127.0.0.1%2F2019-03-avon-and-somerset-street.csv.gml&data=02%7C01%7Csteve.lime%40state.mn.us%7Ca92d943d4bf845ef1e0408d6da39b088%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636936338652704394&sdata=a3ZII6DKApIQr3tv8bubzPS8dU9wwmqstKsCKoH69%2BI%3D&reserved=0>"
                CLASS
                        STYLE
                                COLOR 0 255 0
                                SYMBOL 'circle'
                                SIZE 6
                        END
                END
        END


I don’t think I need to add anything to the apple for the feature attributes to be included in the WFS output, or do I?


Thanks!
Leigh


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20190516/73e3a88f/attachment.htm>


More information about the MapServer-users mailing list