API for viewing places on the map

1

I need an API that works like HERE Maps, which makes it easy to query through a REST service. With it I can for example identify stores within a certain range. But I came across the problem that it does not provide this information when for example, the stores are inside a mall.

Bing Maps has this information when accessed by the browser. But I still could not figure out how to do this through the API.

Does anyone know how to solve this?

    
asked by anonymous 16.05.2015 / 23:06

1 answer

1

Google Places has REST Services for place queries as well as other APIs such as JavaScript

It is possible to check by points (latitude and longitude), address and as you quoted, look for shops in determining radius (ie by specific types of establishments). Several types of places are supported and you can see the list of types at this link: types of places .

As an example, it follows an in-store query ( store ) consuming WS Places REST and returning JSON. I'll use the center point of Florianópolis ( lat=-27.6142358;lng=-48.4828247 ) returned by Google Maps and a radius of 200 meters.

The parameters will be:

location: -27.6142358,-48.4828247
radius: 200
language: pt-BR
type: store
key: {sua_api_key}

For information about the API key, see this link: Google API Key

With these parameters the resulting URL will be as follows:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-27.6142358,-48.4828247&radius=200&language=pt-BR&type=store&key={sua_api_key}

For this research the result was this:

{
   "html_attributions" : [],
   "results" : [
      {
         "geometry" : {
            "location" : {
               "lat" : -27.615584,
               "lng" : -48.484707
            }
         },
         "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/wine-71.png",
         "id" : "d4068353334ad7655800b0e4a7908e15b882a404",
         "name" : "ALE BEBIDAS",
         "opening_hours" : {
            "open_now" : true,
            "weekday_text" : []
         },
         "place_id" : "ChIJBxuO5lE5J5UR9u9xCVWhfEg",
         "reference" : "CmReAAAAOVtoo1S_NPy2AcKW4FcXqXVlCmUIuTIIccZP0F6qt8KDKqDHfRm7Ng8SeXRqsGPmo8e_846R-PRCe1KZyLkl9VZVsfIIMdoaIxG86BWH0KNLR8gzvUiUhdFxgbUHYB1pEhBzTzPE0vAr4w6uolz7dKSBGhRbzJls4F2xRH83i7ypdcvdRtXdvA",
         "scope" : "GOOGLE",
         "types" : [ "liquor_store", "store", "establishment" ],
         "vicinity" : "Rua Laurindo Januário da Silveira, 2452 - Lagoa da Conceição, Florianópolis"
      },
      {
         "geometry" : {
            "location" : {
               "lat" : -27.615853,
               "lng" : -48.484668
            }
         },
         "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/wine-71.png",
         "id" : "cdb56aaa10f3a9458d66db2cef5cc883ee197195",
         "name" : "Central de Bebidas Canto da Lagoa",
         "opening_hours" : {
            "open_now" : false,
            "weekday_text" : []
         },
         "place_id" : "ChIJJ2Ot6FE5J5URtqcR1cfFqFc",
         "reference" : "CoQBdAAAAEoaG4QA0oGjWHBMjj7OGoiP8SEtfZbDb8eKe1O-2csV3Kpx-zqZ83RdBvgZwvCj66_0_XDuNUmMMfEbjP2nDcM9FR5MxcUhVSKjc4b26N5hd3057Wf40B2uhE56l14QWo3RhfTnGxEs0KU_dWtlCE2xGaUyo0zW0EaG3NspmVNyEhA5iHD9_3ABWqupiCGDcciKGhS7bVKHoO1Im47kbn7yWyR0f_-c4g",
         "scope" : "GOOGLE",
         "types" : [ "liquor_store", "store", "establishment" ],
         "vicinity" : "Rua Laurindo Januário da Silveira, 2.460 - Lagoa da Conceição, Florianópolis"
      },
      {
         "geometry" : {
            "location" : {
               "lat" : -27.615299,
               "lng" : -48.484732
            }
         },
         "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
         "id" : "2e4c65a1d61c72d0b64b6044645c58f1a3f3e13d",
         "name" : "Hiper Bom",
         "place_id" : "ChIJa0_q4VE5J5UR3kiEd-J2FL4",
         "reference" : "CmRdAAAAKQgXto7LtfDAb7RbkWybZ5djSo_4hdr7Y5waV7uF3EuGPt1vE-n3pvFKhkeJAPy2WPoK-TMSGqQSw9oJ3sCCUGF4aQgA85BsBZup3qz10O7ack30cay0imQx7FCr02ITEhDuG3WwOOPnEhBCUMx2rlo6GhSkxbL6YMVwdmqOFLhMzs6PztikHA",
         "scope" : "GOOGLE",
         "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ],
         "vicinity" : "Rua Laurindo Januário da Silveira, 2420 - Lagoa da Conceição, Florianópolis"
      }
   ],
   "status" : "OK"
}

See this link the meaning of each returned attribute, in addition to what it can return.

I do not know Bing Maps very well, it is possible that it also has this service. I know there are public data for query by Bing Spatial Data Services . as for North America, through NAVTEQNA and Europe through NAVTEQEU . I do not know if there is anything in Brazil or other regions.

There are other services too, such as Foursquare that might offer search by radius as well, you can easily find other references on the Internet. These two are cited and the example of Google Places that I believe to be the most used.

    
17.05.2015 / 00:43