gm3 icon indicating copy to clipboard operation
gm3 copied to clipboard

Allow WFS query return to be in EPSG:4326

Open brentfraser opened this issue 5 years ago • 7 comments

Currently the WFS server must return query info (feature geometry) in EPSG:3857 (I think). It should be possible to have GM request, and accept features returned in EPSG:4326, and re-project, and render them on the map.

Here's a data source: https://mrdata.usgs.gov/services/wfs/sgmc2?service=WFS&version=1.1.0&request=GetCapabilities&

brentfraser avatar Jun 09 '20 19:06 brentfraser

The the data web page: https://mrdata.usgs.gov/geology/state/state.php?state=MN (note there is an error in its WFS link)

brentfraser avatar Jun 09 '20 19:06 brentfraser

Note: MapServer can re-project a WFS on the fly.

klassenjs avatar Jun 09 '20 19:06 klassenjs

That's true. I was thinking more for servers I have no control over.

brentfraser avatar Jun 09 '20 20:06 brentfraser

And would rather not proxy the stream through my mapserver, although it's good to have the option.

brentfraser avatar Jun 09 '20 20:06 brentfraser

Might be addressed in #787

brentfraser avatar Jan 11 '23 17:01 brentfraser

Using the recent PR #787 I crafted a mapsource to test this issue (note the map-source attribute src-proj ):

    <map-source name="issue542"                    type="wfs" src-proj="EPSG:4326" title="Issue 542">
        <url>https://mrdata.usgs.gov/wfs/sgmc2</url>
        <param name="cross-origin" value="anonymous"/>
        <param name="typename" value="ms:Structure"/>
        <param name="srsname"  value="EPSG:4326"/>
        <layer name="Structure" >
            <style><![CDATA[
            {
                "circle-radius": 4,
                "circle-color": "#fec44f",
                "fill-color": "#fec44f",
                "circle-stroke-color": "#d95f0e",
                "line-color": "blue",
                "line-width": 2,
                "fill-opacity": 0.20,
                "line-opacity": 0.80,
                "text-field_COMMENTED-OUT": "{OWNER_NAME}",
                "text-color": "#000000"
            }
            ]]></style>
            <template name="identify" auto="true" />
        </layer>
    </map-source>

While the server now seems to respond with valid features in GML format, OL's loadfeatures doesn't return features. Am I missing some parameter?

FYI here's a sample URL sent by GeoMoose if you'd like to examine the result:

https://mrdata.usgs.gov/wfs/sgmc2?srsname=EPSG:4326&outputFormat=text/xml; subtype=gml/2.1.2&service=WFS&version=1.1.0&request=GetFeature&bbox=-10394257.459583912,5522710.745672788,-10346790.065018818,5579197.709575533,EPSG:3857&cross-origin=anonymous&typename=ms:Structure

brentfraser avatar Jan 31 '23 16:01 brentfraser

T'was a projection issue. Not sure if there were changes to how to specify this properly between OL3.x and now or if we were doing it wrong all along and things worked by accident. The latest changes in #787 should address the problem.

theduckylittle avatar Feb 19 '23 16:02 theduckylittle