Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve street search with Google Maps API #24

Open
philippelesaux opened this issue Feb 3, 2016 · 7 comments
Open

Improve street search with Google Maps API #24

philippelesaux opened this issue Feb 3, 2016 · 7 comments

Comments

@philippelesaux
Copy link
Collaborator

API: https://developers.google.com/maps/documentation/geocoding/intro

Use browser geolocation as well?
https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation

@yurykorzun
Copy link
Owner

Currently we are searching by street block and name in the database, we need to integrate with Google maps API and allow to enter free form street address (like in google maps) and get a specific coordinate. Next we need to find closest street segment to the returned coordinate.

@philippelesaux
Copy link
Collaborator Author

Looking into it a bit further, the first link I put up there wouldn't be enough to do what we want. This would be a better option, I believe.

https://developers.google.com/maps/documentation/javascript/places-autocomplete

We can use the Autocomplete (and pass it an option to only search Philly) to get the address, and then pull the street and house number from the autocompleted address (https://developers.google.com/maps/documentation/geocoding/intro#Types) and continue with Yury's algorithm.

@boutell
Copy link
Contributor

boutell commented Mar 9, 2016

Hi! Progress on this:

https://github.com/boutell/notinphilly/tree/google-autocomplete

For now I'm just implementing it in the start popup controller to prove the concept.

However, we're not at the finish line. It looks like the street numbers and street names reported by Google don't match what's in your database, so the API doesn't find anything. For instance, "South Galloway Street" (Google) does not match "GALLOWAY" (your data).

I haven't looked at your backend yet, so I don't know yet if I could address this just by passing lat and long coordinates instead, or if the issue is more fundamental.

Thoughts?

@boutell
Copy link
Contributor

boutell commented Mar 9, 2016

Much improved with my latest commit: I use regular expressions to clean up street names. However issues remain. "600 S 6th St" is sending me to someplace very different. I'm not sure how your existing data deals with streets that have distinct north and south addresses.

Actually I don't see most numbered streets in the database at all... not sure where to dig around that.

@yurykorzun
Copy link
Owner

@boutell Thanks for digging into that. It looks like street segment structure is far from being perfect, but i guess we need to figure out a way to work with coordinates. If we could find a closest street to a coordinate that Google api returns, that would be awesome.

@boutell
Copy link
Contributor

boutell commented Mar 9, 2016

Thanks Yury... any thoughts on my question about numbered streets being
mostly absent from the data (for instance, 6th street)?

One thought is to simplify this. You enter your address, and it's clear
from context what block you're on. We map that block, and we record that
block as covered, and on the main map we show all the blocks that are
covered with vectors.

But there's no actual need to have a database of every block that exists.
People live where they live and they aren't going to sign up to sweep 20
blocks from home anyway...

Just a thought!

On Wed, Mar 9, 2016 at 10:01 AM, Yury Korzun [email protected]
wrote:

@boutell https://github.com/boutell Thanks for digging into that. It
looks like street segment structure is far from being perfect, but i guess
we need to figure out a way to work with coordinates. If we could find a
closest street to a coordinate that Google api returns, that would be
awesome.


Reply to this email directly or view it on GitHub
#24 (comment)
.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@yurykorzun
Copy link
Owner

@boutell I guess that the option you suggested might work. And might be easier to build a map as people fill in the blanks. If I remember correctly, I used this as a datasource - https://www.opendataphilly.org/dataset/street-centerlines/resource/71f5a730-591c-43dc-a312-1c5a1da2da30. I developed the whole thing sporadically and I wasn't sure how it would look in the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants