Overpy Python RemoteDisconnected: Remote end closed connection without response

25 Views Asked by At

When performing a Overpass API query through Python's overpy library, I experience an error:

RemoteDisconnected: Remote end closed connection without response

I suspect that this is an timeout issue since the error persists after exceeding exactly 60 seconds of query being run. I could not find any timeout resolving issue for overpy. e.g. for Overpass it can be controlled by setting a timeout like :

import overpass
api = overpass.API(timeout=500)

How to reproduce the error:

query_populated = f"""
[timeout:120]; # This is the only timeout I found for overpy but it doesn't work
area["name"="VAE"]->.boundaryArea;
    (
    nwr[building][name="BICO DRILLING TOOLS FZE"];
nwr[building][name="DSI FZE"];
nwr[building][name="ADRIANA HOLDING COMPANY LIMITED"];
nwr[building][name="Schoeller-Bleckmann Oilfield Equipment Middle East FZE"];
>;
    );
    out geom;
"""

def query_osm(query):
    
    api = overpy.Overpass()
    
    result = api.query(query)
    
    return result

result = query_osm(query_populated)

0

There are 0 best solutions below