Filter geo-temporal data by region

  1. Use strict or non-strict filtering

The following example uses the and queries data points within 200km of Cairo, Egypt:

Many functions in the Geo package filter data based on geographic region. Define a geographic region using one of the the following shapes:

Define a box-shaped region by specifying a record containing the following properties:

  • minLat: minimum latitude in decimal degrees (WGS 84) (Float)
  • maxLat: maximum latitude in decimal degrees (WGS 84) (Float)
  • minLon: minimum longitude in decimal degrees (WGS 84) (Float)
Example box-shaped region

Define a circular region by specifying a record containing the following properties:

  • lat: latitude of the circle center in decimal degrees (WGS 84) (Float)
  • lon: longitude of the circle center in decimal degrees (WGS 84) (Float)
  • radius: radius of the circle in kilometers (km) (Float)
Example circular region
  • points: points that define the custom polygon (Array of records)

    Define each point with a record containing the following properties:

Example polygonal region

Strict and non-strict filtering

In most cases, the specified geographic region does not perfectly align with S2 grid cells.

  • Non-strict filtering returns points that may be outside of the specified region but inside S2 grid cells partially covered by the region.
  • Strict filtering returns only points inside the specified region.

Strict filtering is less performant, but more accurate than non-strict filtering.

Strict filtering

Non-strict filtering

Filter by region - 图2