Select to view content in your preferred language

Problems with WFS on ArcGIS Online

3116
16
Jump to solution
04-12-2023 02:20 AM
Fgarriga
Emerging Contributor

I have created a WFS service (points) with Geoserver. I'm having a problem uploading to ArcGIS online.
If I load a new element in ArcGIS, everything is correct, but adding the layer in Map Viewer does not work, only if from Map Viewer you load the WFS with the URL.
Another function that does not work is that if I want to zoom to an element from a list in a Dashboard application, the zoom to the element does not work for me.
Some clue?
Thank you

16 Replies
MirnaVuckovic-Pepeonik
Emerging Contributor

I also have an issue with projection. When I add WFS to Map Viewer using 'Add layer from URL,' there are no projection issues. However, when I add WFS as a new item - URL, and then open it in the map viewer, I encounter projection issues. It is important for us to be able to add WFS as an item on ArcGIS Online for the whole organization. Is there any clue to what would cause this problem?

0 Kudos
PeterHodkinson
Esri Contributor

Hi @MirnaVuckovic-Pepeonik I'm sorry to hear you're having these issues.

Are you able to share the URL for your WFS?

Is it possible that the projection of your basemap is different between these two workflows perhaps?

0 Kudos
MirnaVuckovic-Pepeonik
Emerging Contributor

Hi Peter,

I sent you WFS link to test it.

When I open map viewer and add layer from url, everything works fine:

MirnaVuckovicPepeonik_0-1711096429959.png

 

However, when I add url as a new item on AGOL and then open it in map viewer, projection is off.

MirnaVuckovicPepeonik_1-1711096611955.png

 

We need to be able to add url as a new item for publishing purposes on our ArcGIS HUB.

Thank you for your help.

Best regards,

Mirna

 

0 Kudos
PeterHodkinson
Esri Contributor

Sorry for the slow reply @MirnaVuckovic-Pepeonik, and thanks for sending the URL to test with.

 

Here is what I've found:

The capabilities document for your WFS lists EPSG 3765 as the default CRS - <wfs:DefaultCRS>urn:ogc:def:crs:EPSG::3765</wfs:DefaultCRS>

EPSG 4326 (WGS84) will be available by default too (see https://enterprise.arcgis.com/en/server/latest/publish-services/linux/wfs-services.htm#ESRI_SECTION1...)

Examining the web traffic while testing the two different workflows shows that when adding the layer within map viewer, the GetFeature requests specify that EPSG 3765 is the desired CRS for the features (SRSNAME=EPSG%3A3765 is appended as a request parameter). Features are returned correctly in this coordinate system and displayed in the right location.

When opening in map viewer from the content item, the requests instead specify EPSG 4326 as the desired CRS. The WFS does correctly return features in this coordinate system as per the request, but I believe that Map Viewer is for some reason interpreting the coordinates as though they were in EPSG 3765 - which results in them appearing elsewhere.

 

I'm not sure why the second workflow causes Map Viewer to request the features in EPSG 4326, or why it does not interpret the returned results as being in this coordinate system. It's possible either that this could be a Map Viewer defect or that adjusting the WFS configuration could help.

It may be best to contact your local Esri distributor for further technical support with this. If there is a defect at play, they will be able to get it logged for you. It might also be worth testing whether the same issue occurs if you set your organisation's default basemap to one which uses EPSG 3765? (https://doc.arcgis.com/en/arcgis-online/administer/configure-map.htm#ESRI_SECTION1_1224F13B9D2B451DB...)

 

I hope this is helpful

MirnaVuckovic-Pepeonik
Emerging Contributor

Hi Peter,

thank you for your time and reply. I will definitely contact our local distributor for further testing.

 

Best regards,

Mirna

0 Kudos
KimOllivier
Honored Contributor

I cannot get WFS to work correctly in AGOL by adding a feed as a FeatureLayer. It sort of works but ignores the layer selection and simply gets the first layer.

If I use a WebMap and add a layer with a source as WFS then the same dialogs appear and the layer selection does work to produce a map layer. Fine,  but it is not very useful because I cannot use Arcade on it. It is read-only. I can add a cql_filter with custom parameters. Finally I cannot export it to a FeatureLayer from the WebMap. It is slightly promising because it indicates that it might work if the bug when defining a FeatureLayer source is fixed.

I really need to copy the WFS layers into a proper FeatureLayer Collection. You CAN do this easily using Pro! Set up a new WFS server in ArcCatalog, including custom parameters as required, add the layers to the table of contents.

Turn off some fields, add more filters, rename layers, load metadata and edit, set up symbology. Change the download limits from 3000 to 100,000. Now just Share to AGOL! Any schema change or new data requires manually replacing the layer, watch out for caches.

Now I want to automate this with Python. Particularly in AGOL using a Notebook and a Task. Seems to be possible with the new Pandas SeDF (spatially enabled dataframe) in arcgis package. Not so fast!

Loading WFS features into Pandas sdf. 

This should be easy to do with python requests and geopandas. There are new functions in arcgis to translate from geopandas to sdf and from sdf to a FeatureLayer. You need to import geopandas so that you can read the WFS feed directly into a sdf data frame first. There is a posting noting that you cannot read a WFS feed directly into an Esri sedf.  Catch 22 - you cannot import geopandas in a AGOL notebook because it is a Docker instance started up each time. It can work from a Desktop because you can set up a venv that does have geopandas.

So how can I install geopandas in AGOL Notebook?

0 Kudos
KimOllivier
Honored Contributor

Still a problem for me at Sept 2024. Sort of works if you add a WFS source from the MapViewer, but not if you add it as a FeatureLayer. It ignores the layer dropdown list and just picks the first one.

0 Kudos