GreenInfo-Network/nyc-crash-mapper

Geocoder tool

gregallensworth opened this issue · 4 comments

Client wants a simple address-search tool, which zooms the map and that's it.

Chris had some good work on something even more complex #81 This would do the geocode, then apply a filter to find crashes within a circle of that address. This need is significantly simpler, but the code in PR 81 may provide guidance as to UI and behavior.

@gregallensworth just FYI I was using Google Map's Geocoder and from what I hear their APIs are no longer "free" and require an API Key and credit card, but yes I believe the React Redux integration should be a good starting point. Maybe a good alternative Geocoder would be Mapbox's? But not sure if that means you have to also use a Mapbox Basemap...

FYI the NYC Planning Dept has it's own free geocoder, and the team at NYC Planning Labs has built an service for it that has auto-complete: http://geosearch-docs.planninglabs.nyc/

This last option might be worth using as certain NYC addresses are notoriously difficult to geocode, e.g. places in Queens that have 4 streets in the same 1 block radius that share the same name but differ in their suffix.

Yeah, the Google changeup is significant, for a large number of people. Our usual go-to when not using Google is Bing, as their TOU are very open: "must be used in a web map"

But, that's really good information that there exists a NYC-specific geocoder. Thank you for the tip here.

No problem, I went ahead and integrated it with an auto-suggest component in the branch clh/geocoding. It's data is stored in the redux state.search. The saved search result just needs to be piped down to the map component. Some more css & ux tweaking is probably warranted as well.

Update: over the weekend I got the selected geocode result to display on the map. We could either leave it at that or add the ability to filter by radius to the geocode result. I started working on the latter, probably won't be too much effort.