Filter shapes from a collection based on a specific shape.

Balasaheb Molawade 136 Reputation points
2024-12-19T11:56:11.7733333+00:00

Hi,

We are using Bing map API to plot the boundaries on map. We store postal codes of the US and plot them on a map. Since there are numerous postal codes in the US, plotting all of them takes time. We wanted a way to filter and display postal code boundaries for a specific state. We store postal codes boundaries as latitude/longitude strings, fetch them, create polygons, and then plot them on the map. Is there a way to filter postal code boundaries based on a specified shape or boundary.

Thanks!

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
764 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. IoTGirl 3,221 Reputation points Microsoft Employee
    2024-12-20T13:30:36.8366667+00:00

    Hi Balasaheb, It is against the Bing Maps Terms of use (Tou) to store the results from the boundary query so I will assume that you are getting these from a different source. Only geocoding results are allowed to be stored under Microsoft Maps terms for both Azure and Bing Maps for Enterprise products. To the general question of how to identify if a point is within a polygon, that is a simple geometric problem. You can use a geocapable database such as postgres or tsql to do the calculations for you. Basically take the state polygon and use that as a fence to find all artifacts with points within that state polygon. Sincerely, IoTGirl

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.