GreenInfo-Network / nyc-crash-mapper

React Redux web application for viewing, filtering, & comparing trends of automobile collision data published by the NYPD.
http://www.crashmapper.org
MIT License
16 stars 4 forks source link

Geocoder tool #92

Open gregallensworth opened 6 years ago

gregallensworth commented 6 years ago

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 https://github.com/GreenInfo-Network/nyc-crash-mapper/pull/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.

clhenrick commented 6 years ago

@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.

gregallensworth commented 6 years ago

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.

clhenrick commented 6 years ago

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.

clhenrick commented 6 years ago

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.