Skip to main content
  • Type: list<number>
  • Default: null
  • Scope: search
The insidePolygon parameter restricts search results to records located within one or more geographic polygons. Each polygon is defined by a series of latitude/longitude points (lat1, lng1, lat2, lng2, …), with at least 3 points (6 values). You can specify:
  • A single polygon as a flat list of numbers
  • Multiple polygons as a list of such lists

Usage

  • Minimum of 3 coordinate pairs (6 values) per polygon
  • Up to 10,000 coordinate pairs supported per request
  • If both insidePolygon and insideBoundingBox are specified, only insideBoundingBox is applied
  • aroundLatLng and aroundLatLngViaIP will be ignored if used with insidePolygon.
  • To match all records within the polygon, send an empty query ("")
  • Avoid polygons that cross the 180th meridian

Examples

Current API clients

Search inside a single polygon

index.Search(new Query("query")
{
    InsidePolygon = new List>
    {
        new List
        {
            46.650828100116044f,
            7.123046875f,
            45.17210966999772f,
            1.009765625f,
            49.62625916704081f,
            4.6181640625f
        }
    }
});

Search inside multiple polygons

index.Search(new Query("query")
{
    InsidePolygon = new List>
    {
        new List
        {
            46.650828100116044f,
            7.123046875f,
            45.17210966999772f,
            1.009765625f,
            49.62625916704081f,
            4.6181640625f
        },
        new List
        {
            49.62625916704081f,
            4.6181640625f,
            47.715070300900194f,
            0.482421875f,
            45.17210966999772f,
            1.009765625f,
            50.62626704081f,
            4.6181640625f
        }
    }
});

Search inside a single polygon

index.Search(new Query("query")
{
    InsidePolygon = new List>
    {
        new List
        {
            46.650828100116044f,
            7.123046875f,
            45.17210966999772f,
            1.009765625f,
            49.62625916704081f,
            4.6181640625f
        }
    }
});

Search inside multiple polygons

index.Search(new Query("query")
{
    InsidePolygon = new List>
    {
        new List
        {
            46.650828100116044f,
            7.123046875f,
            45.17210966999772f,
            1.009765625f,
            49.62625916704081f,
            4.6181640625f
        },
        new List
        {
            49.62625916704081f,
            4.6181640625f,
            47.715070300900194f,
            0.482421875f,
            45.17210966999772f,
            1.009765625f,
            50.62626704081f,
            4.6181640625f
        }
    }
});
I