Transformation Pipelines
With GeoFlip API, user can also apply a series of transformations to geospatial data. The transformations include buffer
, clip
, erase
, and union
operations. The sample payload below demonstrates how to structure your input and configure the desired transformations.
Sample Payload with GeoJSON as Input
{
"input_geojson":{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
114.99613129776213,
-33.859519225850065
],
[
114.99949686696743,
-33.86220916993638
],
[
115.00559680322726,
-33.86004343997021
],
[
115.0048817441612,
-33.85595593539954
],
[
114.99756134180785,
-33.85448784508991
],
[
114.99613129776213,
-33.859519225850065
]
]
],
"type": "Polygon"
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
115.01207507962403,
-33.85738857042802
],
[
115.00774236899753,
-33.86220921304859
],
[
115.01060259361918,
-33.86678510823485
],
[
115.01518895809949,
-33.86615662604939
],
[
115.02061525766646,
-33.862977734307634
],
[
115.02090921536842,
-33.85927494028098
],
[
115.01762758433455,
-33.85588657488439
],
[
115.01207507962403,
-33.85738857042802
]
]
],
"type": "Polygon"
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
114.99659451330058,
-33.865003717859366
],
[
114.99334108357283,
-33.86621491927736
],
[
114.9949404685259,
-33.868903766064086
],
[
114.99881045036386,
-33.87131283956229
],
[
115.00601724490008,
-33.867728067661496
],
[
115.00420872774009,
-33.86451480335258
],
[
114.99659451330058,
-33.865003717859366
]
]
],
"type": "Polygon"
}
}
]
},
"output_format": "shp",
"output_crs": "EPSG:4326",
"transformations":[
{
"type":"buffer",
"distance": 100,
"units": "meters"
},
{
"type":"clip",
"clipping_geojson":{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
115.00121521372733,
-33.856853220096795
],
[
115.00121521372733,
-33.866565353453026
],
[
115.01315471132949,
-33.866565353453026
],
[
115.01315471132949,
-33.856853220096795
],
[
115.00121521372733,
-33.856853220096795
]
]
],
"type": "Polygon"
}
}
],
"bbox": [
114.992443628595,
-33.87205788335776,
115.02180720159141,
-33.8537424269262
]
}
},
{
"type":"erase",
"erasing_geojson":{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[
115.00055818149542,
-33.85763000305442
],
[
115.000118796604,
-33.85852202104468
],
[
115.00065590871407,
-33.858785587826944
],
[
115.00153481085249,
-33.85931270516249
],
[
115.0010465568896,
-33.8599005810478
],
[
115.00092457527643,
-33.86131961672926
],
[
114.99987458522537,
-33.864421117335155
],
[
115.0001190304153,
-33.86533320786453
],
[
115.00155931232695,
-33.865475099042236
],
[
115.0029996231874,
-33.865535890760185
],
[
115.00256033834717,
-33.8662857833484
],
[
115.00036371583423,
-33.86669097205334
],
[
115.00070576299566,
-33.8679270669914
],
[
115.00671017414857,
-33.86979206951076
],
[
115.0072228016532,
-33.86474544712347
],
[
115.01508336160595,
-33.867157522772196
],
[
115.0137652229862,
-33.86545487723542
],
[
115.01381377777739,
-33.85878578977273
],
[
115.00055818149542,
-33.85763000305442
]
]
],
"type": "Polygon"
}
}
]
}
},
{
"type":"buffer",
"distance": 300,
"units":"meters"
},
{
"type":"union"
}
]
}
Explanation of the Sample Transformation Flow
- Buffer Transformation
- Applies a buffer around the geometries in the
input_geojson
. - Parameters:
distance
: Buffer distance (e.g.,100
meters).units
: Units of the distance (meters
,kilometers
, etc.).
- Clip Transformation
- Clips the input geometries with a provided
clipping_geojson
. - Only the portions of geometries inside the clipping polygon are retained.
- Erase Transformation
- After the clipping operation, remaining polygons are then erased where the geometries overlapping with the
erasing_geojson
.
- Union Transformation
- Finally, the union operation merges all geometries into a single unified geometry for the output.
- Output
- The output format is specified as
shp
(shapefile), and the output CRS isEPSG:4326
. - The result includes all transformations applied in sequence to the input geometries.