none
Partitioning of Polygons RRS feed

  • Question

  • Hi,

    I am developing one feature, where I have set of polygons say 30 polygons and I want to equally divide these polygons into 5 bunches as each bunch should have 6 polygons. However the created bunch of polygons should be contiguous and compact. Could you please help me how can I achieve the same in Bing Maps.

    Thanks!

    Wednesday, June 12, 2019 8:58 AM

All replies

  • Hi Vikas,

    Take a look at https://docs.microsoft.com/en-us/bingmaps/v8-web-control/map-control-api/layer-class as I believe it is designed for what you want to do.

    The Layer class makes it easy to organize groups of data by storing them in separate layers on the map. Grouping your data into layers provides a number of benefits such as the ability to hide or attach events to all IPrimitiveshapes in a layer with a single line of code, while also providing a performance benefit over manually looping through each shape and performing these tasks.

    Sincerely,

    IoTGirl

    Wednesday, June 12, 2019 3:50 PM
    Owner
  • Hi,

    I have a collection of US states polygons as below:

    I want to divide these polygons into 5 groups. What should be the base/logic to decide which states should be grouped together in order to get 5 contiguous and compact group of states in Bing maps? For an instance I have grouped together the states in order to get 5 groups. The final groups should be contiguous and compact as shown below:

    :

    Thanks!

    Friday, June 21, 2019 7:18 AM
  • Hi Vikas,

    You should choose the polygons you want in each group and create a layer with those polygons.  So in your case 5 layers.

    There is a sample that uses multiple layers at https://bingmapsv8samples.azurewebsites.net/#Configuration%20Map%20Layer%20Menu. You can type "Layer" in the text box at the top of the left menu to find other layering samples.

    Sincerely,

    IoTGirl

    Friday, June 21, 2019 3:45 PM
    Owner
  • The main requirement here is to decide how to choose the polygons? What should be the logic based on which we can choose the polygons in order to make groups.


    Monday, June 24, 2019 11:51 AM
  • Hi Vikas,

    Only you can decide the priority for your application.  Not sure what you are looking for from us here as we have already given you the "How", only you can know the why.

    Sincerely,

    IoTGirl

    Monday, June 24, 2019 6:09 PM
    Owner