how to get latitude and longitude for particular landmark? - mapping

how to get latitude and longitude for particular landmark/business, i would like to get lat/long for specific address how to i do that? shall i use gps device to get the lat/long?

Very recently, two or three weeks ago, Google released a new API that lets you do just what you want.
This is how it works:
http://maps.google.com/maps/api/geocode/format?address=some_address&sensor=true_or_false
And here is an example:
http://maps.google.com/maps/api/geocode/xml?address=Lenox+Hill&sensor=false
The format can be JSON or XML.

You will need to use a Geolocation API (such as Google or Bing or Yahoo), and there might be others as well. But those are the "free" (with caveats) ones that come to mind.
Just remember they have rather strict Terms-of-use of how you can use their API, so be sure you are on the right side of the law.
http://msdn.microsoft.com/en-us/library/cc981067.aspx
http://code.google.com/apis/maps/documentation/

Can you elaborate a bit more on that? What type of application is that? What is the format of the landmark/business? Basically there are geo web services out there that do this kind of stuff...
Have a look at this for example:
http://www.geonames.org/maps/us-reverse-geocoder.html
http://www.geonames.org/export/ws-overview.html

Yahoo http://developer.yahoo.com/geo/geoplanet/guide/concepts.html
You can query for a free-form name such as address, etc, and it will return what is called a WOEID, then query the WOEID for its lat long.

Related

What are the solutions when geocoding a wrong or incomplete address?

My company gets the addresses the loading hubs for our freights every week. We need to geocode them into coordinates. But often the addresses either are incomplete or contain minor grammar mistakes, so it's impossible to input them for geocoding.
My question : when dealing with a list of wrong or incomplete addresses when geocoding, is there any general solution to solve the issue ?
If there are useful articles or resources about this topic, please let me know.
Thank you.
Geocoding / Autocomplete
According to the Geocoding Addresses Best Practices documentation:
"Geocoding is the process of converting addresses (like a street address) into geographic coordinates (latitude and longitude), which you can use to place markers on a map, or position the map."
"In general, use the Geocoding API when geocoding complete addresses (for example, “48 Pirrama Rd, Pyrmont, NSW, Australia”). Use the Places API Place Autocomplete service when geocoding ambiguous (incomplete) addresses."
The Place Autocomplete service returns place predictions according to your inputs. This would solve your problem of having wrongly spelled addresses.
How to get the coordinates after using Place Autocomplete?
example request for Place Autocomplete would look like this:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Paris&types=geocode&key=YOUR_API_KEY
The Place Autocomplete is able to return the address description together with its place_id. In this sample request, you are able to get "description": "Paris, France" with a "place_id": "ChIJD7fiBh9u5kcRYJSMaMOCCwQ".
Then you can use the Place ID of the predicted location to obtain the coordinates of that place by using Place Details request
You can request it like this:
https://maps.googleapis.com/maps/api/place/details/json?fields=geometry&place_id=ChIJD7fiBh9u5kcRYJSMaMOCCwQ&key=YOUR_API_KEY
We used here the fields=geometry to only return the coordinates of the location and as previously mentioned the Place ID we used is the one we had from the Autocomplete query.
The returned data will be the expected result according to your question. But feel free to comment if you need anything.
To read more about the fields parameter, refer to the Place Details documentation.
I hope this helps!

How can I search the channel in a specific country using the YouTube API 3.0?

I use the url to search channels in a specific country like this https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=8&order=viewCount&q=news&type=channel&regionCode=US&key=API-Key.
But when i changed the regionCode parameter to IT(italy) or any other one,the search result is always identical.So the search result is not changed with the regionCode.
How can I search the channel by country using the YouTube API 3.0,thanks.
I also try to search channel with the optional parameter regionCode, and it seems that this parameter is not to filter the results base on the country code of a Country. I found in this related SO question that the region parameter only applies to movie charts, and is not something that works as a parameter for general searches.
So the only possible parameter that I think you can use to filter the results of YouTube API in a specific country or place is by using the parameter location.
The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).
Hope it helps you.
There is no way to solve this problem. I tried location with locationRadius, but second parameter is limited to 1000km, so, I cant find all videos from Russian Federation or USA using that option and 1 api request.
Also, that api request performs slow for understandable reason.

How can I determine if a postal code is inside a defined area?

I’m building an ordering/delivery website for a restaurant with a PHP backend.
I’d like to determine if the delivery postal code (Canada) is within a predetermined delivery zone. The zone is oddly shaped around specific streets and neighborhood, so radius is not an option.
What is the best way to achieve this?
I assume Google Maps could help with that but I haven’t found any clear path yet.
You could use something like
if ($zip > 5600 && $zip < 6000) {
//do stuff
You have to map GIS data to your postal codes. Maybe such a mapping already exists and you "only" have to asked "Canada Post" for it (assuming a commercial project).

twitter search api no place returned

I am having a bit of trouble sifting through the twitter API. I am trying to search for tweets near a certain location and then see their exact (or approximate) geo coordinates. I understand the geo field is deprecated and now we are supposed to use the "place" field. Unfortunately when I use the following url: http://search.twitter.com/search.json?q=&geocode=30.1829,-97.832,10mi I get a bunch of responses with a location that matches the city of the geo coordinates, but geo: is null and there is no place field. Am I stuck with only having an accuracy up to city coordinates, or am I using the wrong search call?
Thanks in advance!
Remember, tweeting with a geo location is an opt-in process. Twitter will supply a feed from the area for all tweeters in that area, but only those who have opted to tweet their coordinates will show up with "geo" info.
Using q=here with your url it did return 1 tweet for me with "geo" info in this form (though likely it will have moved on down the timeline by the time you try...):
"geo":{"coordinates":[-33.9769,18.5080],"type":"Point"}
Every user has a user defined location set in their profile settings. Use this when users don't use geo-encoding.
You can obtain a list of all countries / states by country and do a simple clean-up operation on the dataset.
This gave me what I needed for location data and greatly enriched my output.

URL for multiple markers in Google Maps

In a desktop Qt application, I have some GPS coordinates that I'd like to show on a map. My plan is to construct an URL with the coordinates and let a web browser and Google maps or a similar service do the heavy lifting.
After reading some apparently reverse-engineered documentation at
mapki.com slash wiki slash Google_Map_Parameters
I can make it work for a single point, but what's the URL syntax for multiple points?
My best shot so far is to build a string such as this:
http://maps.google.com/?ie=UTF8&q=My+First+Point#59.591,17.82&q=My+Second+Point#59.592,17.82
but that will only show "My Second Point". Is there a better description of the syntax somewhere?
Replacing q= with markers= did not work and the "static map" suggestion below only complained about an incorrect API key.
for google maps static there is this URL:
http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=14&size=512x512&maptype=roadmap
&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318
&markers=color:red|label:C|40.718217,-73.998284&sensor=false&key=MAPS_API_KEY
Detailed version:
http://maps.google.com/maps/api/staticmap?
center=Brooklyn+Bridge,New+York,NY
&zoom=14
&size=512x512
&maptype=roadmap
&markers=color:blue|label:S|40.702147,-74.015794
&markers=color:green|label:G|40.711614,-74.012318
&markers=color:red|label:C|40.718217,-73.998284
&sensor=false
&key=MAPS_API_KEY
i am not sure if this syntax is also good for standard maps
http://staticmapmaker.com/ - very nice web tool for generating static map urls.
List of currently supported map services:
- Google
- Bing
- Yandex
- HERE
- Mapbox
- MapQuest
- CartoDB
p.s. I know this is an old question, but many still google for it.
Throwing parameters at maps.google.com only gets you one point.
As dusoft says, you could use Google Static maps.
Or, if you require dynamic maps, you could write your own public web page that uses Google Maps API and accepts a long list of parameters. Use your own web page in exactly the same way that you were intending to use maps.google.com web page, except that you get to design what you want the parameters to look like.
Perhaps something like this.
Several parameters (such as the markers and path parameters) take multiple locations. In those cases, the locations are separated by the pipe (|) character.
https://maps.googleapis.com/maps/api/staticmap?center=boca+raton,+fl+|+deerfied,+FL&zoom=12&scale=false&size=600x300&maptype=roadmap&sensor=false&key=API_KEY&format=png&visual_refresh=true&markers=size:mid%7Ccolor:red%7Cboca+raton,+fl+|+deerfied,+FL" alt="Google Map of boca raton, fl | deerfied, FL
I know that you specifically asked for Google Maps, however I came up with a solution using Bing Maps:
https://bing.com/maps/default.aspx?sp=point.48.858303_2.3499404_Eiffel%20Tower~point.48.8530067_2.3499404_Notre-Dame%20Cathedral~point.48.8605088_2.3376727_Louvre link
The sp parameter can define a list of points, polylines, polygons and addresses. Multiple objects are separated by ~.
The syntax for point is:
point.latitude_longitude_titleString_notesString_linkURL_photoURL
titleString is displayed in the map and notesString only when clicking on a point.
A Link with you coordinates would look like:
https://bing.com/maps/default.aspx?sp=point.59.591_17.82_P1~point.59.592_17.82_P2 link
I did some tests on how many of these points can be in a URL by generating a really long URL in the form of https://www.bing.com/maps?sp=point.10.000000_10.000000_0~point.10.000000_10.01_1~point.10.000000_10.02_2~point.10.000000_10.03_3... and it seems up to about 150 points are working.
Documentation:
Microsoft Documentation: Create a Custom Map URL

Resources