none
GeoDataAPIManager.getBoundary not given boundary RRS feed

  • Question

  • 1. I have used the GeoDataAPIManager.getBoundary of V8 for drawing ploygon of cities. we use locations latitude and longitude to draw polygons.

    Example :

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
                    credentials: 'user credentials',
                    center: new Microsoft.Maps.Location(47.614, -122.165),
                    zoom: 11
                });

                var loc1 = new Microsoft.Maps.Location(30.77222, -93.01972);
                var loc2 = new Microsoft.Maps.Location(41.53619, -111.30830);
                var loc3 = new Microsoft.Maps.Location(35.53934, -79.18541);
                
                var locColl = [];
                locColl.push(loc1);
                locColl.push(loc2);
                locColl.push(loc3);
               
                var geoDataRequestOptions = {
                    entityType: 'PopulatedPlace',
                    getAllPolygons: true
                };
                Microsoft.Maps.loadModule('Microsoft.Maps.SpatialDataService', function () {
                    //Use the GeoData API manager to get the boundary
                    Microsoft.Maps.SpatialDataService.GeoDataAPIManager.getBoundary(locColl, geoDataRequestOptions, map, function (data) {
                        if (data.results && data.results.length > 0) {
                            map.entities.push(data.results[0].Polygons);
                        }
                    });
                });

    Here, we not get any polygon for city region. All three location return no results in data.

    if we change geoDataRequestOptions option to AdminDivision1 or CountryRegion it working fine.


    Wednesday, March 22, 2017 6:35 AM

Answers

  • Rather simple explanation, none of those locations are within the boundary of any cities. Note that city boundaries are often isolated and not connected. There is a lot of area around them that are not part of a city boundary.

    [Blog] [twitter] [LinkedIn]

    Thursday, March 23, 2017 1:47 AM
  • No, the only way to determine this would be to go through and request every possible city. It would take a long time to generate this and new cities are added all the time.

    [Blog] [twitter] [LinkedIn]

    Monday, March 27, 2017 2:26 PM

All replies

  • Rather simple explanation, none of those locations are within the boundary of any cities. Note that city boundaries are often isolated and not connected. There is a lot of area around them that are not part of a city boundary.

    [Blog] [twitter] [LinkedIn]

    Thursday, March 23, 2017 1:47 AM
  • Ricky Could you please share the map of world where cities are plotted and similar for postal code, county, country,postal code areas and state.

    Sorry for the inconvenience but wanted to make sure that what are the areas that are not covered in respective region type.

    Thank you for your help in advance.

    Monday, March 27, 2017 5:43 AM
  • No, the only way to determine this would be to go through and request every possible city. It would take a long time to generate this and new cities are added all the time.

    [Blog] [twitter] [LinkedIn]

    Monday, March 27, 2017 2:26 PM