I am attempting to determine if a U.S. address is within city limits or not. (Another example is if an address resides within a particular county or not).
For example, we are creating a website allowing a city to sell its pet licenses. If, for example, the address is for W. Lafayette, Indiana, but the home is just outside of the established city limits, we want our website to be able to notify the user that they do not need to buy a pet license (otherwise when the city sees it, they need to refund that money to the pet owner).
Google Maps obviously knows city boundaries. For example, when you view W. Lafayette, IN, on the map you can see a red line and light red shading showing the city limits: (example)
My question: how do I determine if an address is contained within that bordered area? (I'm hoping for perhaps the ability to send lat/lng to an API to determine if it is contained within that region... or some other ideas as to how to do this?)
Side note: postal code is not enough. There are many instances where an address can have a city, state, zip that is the same whether the home is in or out of city limits.
Thank you.
Tom
Related
The dutch zip-codes and addresses are administered by a government agency called "kadaster".
They make this data available in something called the "BAG".
I would like to know how and how-quickly new zip-codes are available in the Here Location Service.
Is there a resource with more details on this?
Autocomplete API enables searching using free text address and provide zip-code and street details can come, when the address matches. Please refer example adds geocoding autocompletion to an HTML text box. Start typing in the text-box below to see the responses returned. Markers are also added to a map to show the suggested locations. Clicking on a map marker will move the map and display more information about the selected location.
I have a CSV list of university names around the world - about 13,000 university names. I'm looking for a way to pull the addresses of these universities. Google Maps API / Google Places API looks promising, but requires lat/long to map the locations.
End game is to mark to each school as a 1 if the school is in the US, and 0 if the school is outside of the US.
Any thoughts on how to search these colleges in maps and pull out the addresses - or at least the country?
Example:
is there nothing else in the csv, only the names? that's going to make it hard, i'd bet the names aren't always unique in the world.
you could write something that had different passes at biting the apple - for instance, if the university has a state name in it, check those off as 1's - then find another logic to use to take "another bit" until the apple is gone.
On top of #WEBjuju's answer, since you only want to mark if the school is in US, or outside of US, you can use the "country" type in Place Types in the Google Places API, by setting the option as country='us'.
https://developers.google.com/places/supported_types?csw=1#table2
You may also want to cross check with this list of schools.
https://www.4icu.org/reviews/index2.htm
https://en.wikipedia.org/wiki/Lists_of_universities_and_colleges_by_country
I am developing a website in ASP.NET in which I need accurate coordinates of properties and populate their markers on Google Maps. I read the Google Maps API documentation and it doesn't accept business names or house numbers. So if I add 5 properties on Moseley Road with postal code WR2 6NJ, they all receive the same coordinates at the beginning of the road, where as they're all separate properties with separate coordinates, for example: Arthur Amos Associates Ltd, Moseley Farms etc.
How can I increase the accuracy so each address gets it's own coordinates? I tried the ROOFTOP and street_address parameters but they didn't help. Do I need to get Google Maps API for Work to get this level of accuracy?
Thanks.
I am trying to geocode NYC high schools by using the Maps Geocoding API and the unique BN code assigned to each high school. For example, typing K733 into Google Maps results in a marker on MESA Charter High School in Brooklyn, NY. However, when I use the API url like so:
https://maps.googleapis.com/maps/api/geocode/json?address=K733
I keep getting "ZERO_RESULTS". I've also tried using the Places API and I've gotten the same results. Can anyone point me in the right direction? Is it even possible to pull this information from Google Maps?
It not possible to use unique BN codes for Maps Geocoding API because the address component requires postal address
address — The street address that you want to geocode, in the format
used by the national postal service of the country concerned.
Additional address elements such as business names and unit, suite or
floor numbers should be avoided. Please refer to the FAQ for
additional guidance.
I am writing an application which requires to put a marker on a street within one city. I've added an input for searching this particular street (to simplify the process and not have to drag and locate the street manually).
So, entering "[Street name], [City]" works as expected and locates the street perfectly. However enetering only "[Street name]" centers map on the street but in another city.
Is there a way to tell Geocoder to search in a particular city?
In the end I can manually add ", [City]" to the request but I'm wondering if it's possible through the API.
You can tell the geocoder to bias towards a particular area:
https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingViewports
Note: this is not entirely foolproof: it biases, it doesn't restrict. So if you look for "Downing Street" in a tiny village it may well find Downing Street in London anyway.
The only foolproof way is to force the city into the address.