You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project that needs to get the BIN from a given address, and I noticed that if I give it an address in, say, Ohio, it will still spit out a result, vastly wrong as it may be.
Here's an example:
deflookup(address):
print(f"Address is {address}")
# Look up BIN in NYC Planning's Authoritative Searchquery_params= {
"text": address,
"size": 1,
}
nyc_planning_req=requests.get(f"https://geosearch.planninglabs.nyc/v2/search", params=query_params)
nyc_planning_resp=json.loads(nyc_planning_req.content.decode("utf-8"))
print(nyc_planning_resp)
iflen(nyc_planning_resp["features"]) ==0:
raiserequests.exceptions.HTTPError("Address not found.")
bin=nyc_planning_resp["features"][0]["properties"]["addendum"]["pad"]["bin"]
longitude, latitude=nyc_planning_resp["features"][0]["geometry"]["coordinates"]
print(bin, longitude, latitude)
I'm working on a project that needs to get the BIN from a given address, and I noticed that if I give it an address in, say, Ohio, it will still spit out a result, vastly wrong as it may be.
Here's an example:
I suppose it uses fuzzy search to give you the closest result, but the website autocomplete gives you nothing, which is arguably better:
https://geosearch.planninglabs.nyc/v2/autocomplete?text=1 Capitol Square, Columbus, OH 43215
Two workarounds that will probably work OK for my use case
autocomplete
API, possibly even in my frontend, instead of doing all the address validation in the backend.The text was updated successfully, but these errors were encountered: