Alternative to Azure Maps spatial/pointInPolygon

Gareth Jayne 35 Reputation points
2025-10-16T08:57:41.0466667+00:00

Hi, we currently have a call to the Azure Maps sptial/pointInPolygon endpoint as part of a flow in Power Automate. The flow just needs to check whether set of co-ordinates is within a polygon we setup for a particular area:

User's image

I know this has now been removed but I can't see an alternative in the Azure Maps API documentation. Is there another way I can achieve the above?

Thanks in advance for any advice.

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

Answer accepted by question author
  1. Sridhar M 1,220 Reputation points Microsoft External Staff Moderator
    2025-10-16T09:21:10.63+00:00

    Hi Gareth Jayne,

    I understand you're looking for an alternative to the Azure Maps Spatial/pointInPolygon endpoint, which has now been deprecated. This endpoint previously enabled you to determine whether a set of coordinates falls within a predefined polygon capability your Power Automate flow relies on. Unfortunately, as of now, there is no direct replacement for this functionality in the current Azure Maps REST API documentation.

    Using Azure Maps Get Polygon API (with Custom Logic)

    One possible workaround is to use the Azure Maps Get Polygon API, which allows you to retrieve polygon geometry data for a given region. While this API doesn't perform point-in-polygon checks directly, you could extract the polygon coordinates and implement your own spatial logic either within an Azure Function, a custom connector, or an external service to determine whether a given point lies inside the polygon.

    Using Azure SQL or Cosmos DB for Spatial Queries

    Another robust approach is to utilize spatial capabilities offered by Azure SQL Database or Azure Cosmos DB. Both platforms support geospatial data types and queries, making them suitable for your use case.

    • Azure SQL Database allows the use of methods such as STWithin() or STIntersects() to determine whether a point lies inside a stored polygon.
    • Azure Cosmos DB supports GeoJSON format and similar spatial queries like ST_WITHIN, enabling efficient geographic computations in a NoSQL environment.

    The best solution depends on your architecture and how adaptable your Power Automate flow is. If you prefer to remain within the Azure Maps ecosystem, the Get Polygon + custom logic approach might work. if you're open to integrating a database or external service, Azure SQL or Cosmos DB provide more scalable and built-in geospatial functionality.

    References:

    https://free.blessedness.top/en-us/azure/azure-maps/migrate-geodata?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider

    https://free.blessedness.top/en-us/sql/relational-databases/spatial/spatial-data-sql-server?view=sql-server-ver17

    https://free.blessedness.top/en-us/azure/cosmos-db/nosql/query/geospatial?tabs=javascript

    if this answers your query, please do click Accept Answer and Yes for was this answer helpful.

    Thank you!

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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