I am attempting to filter a ARCGIS REST MapServer layer by specifying a bounding box from a GeoDataFrame, once I was successful but not anymore.
I can filter the layer service by specifying/filtering with a column value, like:
rest_service_url = "https://srv.doris.at/arcgis/rest/services/Basisdaten/Basisdaten_Spezial/MapServer/3/query?"
params = {
#"geometryType": "esriGeometryEnvelope",
"where": "OBJECTID=7066",
"outFields": "*",
"f": "pjson"
}
response = requests.get(rest_service_url, params=params)
# Check if the request was successful (HTTP status code 200)
if response.status_code == 200:
data = response.json()
print(data)
but when I try to filter by bounding box (I repeat, I managed it once, but idk why it doesn't work anymore):
bbox = map_bbox[1].geometry.total_bounds
# Define the bounding box extent
extent = f"{bbox[0]},{bbox[1]},{bbox[2]},{bbox[3]}"
params = {
"geometry": extent, # Bounding box extent
"geometryType": "esriGeometryEnvelope",
"spatialRel": "esriSpatialRelIntersects",
"outFields": "*",
"f": "pjson"
}
I've checked everything in detail, including the bounding box. The bounding box is in EPSG:31255, same as the service is:
print(extent)
'44801.24375471848,343279.68052187003,47325.0478822446,345798.64210799057'