Open
Description
Describe the bug
In layers/_ogc/_service.py
, in the OGCCollectionClass, it checks the provided URL to ensure it has "ogcfeatureserver" in it and that it ends in a number. This invalidates a lot of servers that do work, such as the server provided by OGC itself.
In testing I have removed these assert statements (or run Python optimized with the -O flag), and was able to connect and pull data from servers that do not meet these URL requirements.
To Reproduce
from arcgis.layers import OGCFeatureService
feature_layer = OGCFeatureService("https://demo.ldproxy.net/daraa")
print(feature_layer.properties)
error:
Traceback (most recent call last):
File "[HIDDEN].py", line 3, in <module>
feature_layer = OGCFeatureService("https://demo.ldproxy.net/daraa")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[HIDDEN]/.venv/lib/python3.11/site-packages/arcgis/layers/_ogc/_service.py", line 227, in __init__
assert str(url).lower().endswith("ogcfeatureserver")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Expected behavior
It should connect to the server and be able to pull data. When run with python -O
, the beginning of the output is:
{'title': 'Daraa', 'description': 'This is a test dataset used in the Open Portrayal Framework thread in the OGC Testbed-15 as well as the OGC Vector Tiles Pilot Phase 2. The data is based on OpenStreetMap data from the region of Daraa, Syria, converted to the Topographic Data Store schema of NGA.', 'attribution': 'US National Geospatial Intelligence Agency (NGA)', 'extent':
Platform (please complete the following information):
- Python API Version 2.4.1