Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow WFS query return to be in EPSG:4326 #542

Open
brentfraser opened this issue Jun 9, 2020 · 7 comments
Open

Allow WFS query return to be in EPSG:4326 #542

brentfraser opened this issue Jun 9, 2020 · 7 comments

Comments

@brentfraser
Copy link
Contributor

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
Copy link
Contributor Author

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

@klassenjs
Copy link
Member

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

@brentfraser
Copy link
Contributor Author

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

@brentfraser
Copy link
Contributor Author

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

@brentfraser
Copy link
Contributor Author

Might be addressed in #787

@theduckylittle theduckylittle added this to the 3.11.0 milestone Jan 15, 2023
@brentfraser
Copy link
Contributor Author

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

@theduckylittle
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants