It is time go back to the basis. Extract data within a geographical area.

We assume that we have geolocalized data-points. We want to fetch all data-points within an area.
First, define an area, either in WKT or in GeoJSON.
You can use Wicket for WKT and GeoJSON.io for GeoJSON.
In this post, we will use a simple GeoJSON:
Filter with MAP
We will use the MAP framework and its mapper.geo.within function:
Going further
Discover the power of FETCH here and the MAP framework here.
GEO.JSON parameters define the precision you want.
Discover the easiest way to detect motion and to split a Geo Time Series accordingly. |
Going further
In the previous chapter, we fetch all data-points, and then we keep only those which are in our area. But we can improve this.
If our data-points are not moving, we can use another technique. A better alternative is to fetch only data points in the geographical area. To do so, we first need to compute an HHCODE from the location of the last known data-point and add it to an attribute. You have to execute this script once:
And then, you can fetch using this HHCODE
to only retrieve series which have data-points located in this area.
Going further
We used GEO.REGEXP, META, MAXOPS, SETATTRIBUTES and MACROMAPPER
But what if my data-points are moving? You can optimize your computation by using the spacio-temporal indexing technique.
Read more
Random Number Generation in WarpScript
Macro Value Encoder FTW
Mobilité et données : un train de retard pour la loi LOM

Senior Software Engineer