Skip to main content

API Overview

The Geoflip API provides a flexible, consistent structure for processing spatial data with customizable transformations and output formats. This section covers the key components of a typical API request to help developers understand the core concepts involved in interacting with Geoflip.

Payload Structure

Each Geoflip API request follows a standardized structure that includes:

  • Input Data:

    • Specifies the spatial data to be processed.
    • Supported data formats include GeoJSON, Shapefiles (SHP), DXF, and GPKG.
  • Transformations (Optional):

    • A list of operations, such as buffering, clipping, or erasing, that can be applied to the input data. These transformations enable developers to prepare data for specific analytical or display purposes.
  • Output Configuration:

    • Defines the format of the processed output, Geoflip currently supports: geojson, shp, dxf, or gpkg.
    • Optionally specifies the Coordinate Reference System (CRS) for the output data. This also allows for reprojection to different coordinate systems as needed.

The below is an example of a simple geojson route request payload:

https://api.geoflip.io/v1/transform/geojson example request
{
// The spatial data to process, required for GeoJSON route.
// Must follow the GeoJSON format for representing geographic features.
"input_geojson": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"id": 1, // Optional properties for the feature.
"group": "A" // Can be used to categorize or identify features.
},
"geometry": {
"type": "Polygon", // Type of geometry, in this case a Polygon.
"coordinates": [ // Coordinates for the polygon vertices in [longitude, latitude] pairs.
[
[-73.981, 40.768],
[-73.981, 40.769],
[-73.982, 40.769],
[-73.982, 40.768],
[-73.981, 40.768]
]
]
}
}
]
},

// Specifies the desired output format.
// Supported formats: "shp", "dxf", "geojson", "gpkg".
"output_format": "shp",

// Defines the Coordinate Reference System (CRS) for the output.
// Should be a valid EPSG code, e.g., "EPSG:4326".
// For available EPSG codes, refer to epsg.io.
"output_crs": "EPSG:4326",

// Optional: List of transformations to apply to the input data.
// Each transformation requires a "type" and, in some cases, additional parameters.
// Supported transformation types: "buffer", "clip", "union", "erase".
"transformations": [
{
"type": "buffer", // Adds a buffer zone around the input geometry.
"distance": 100, // Buffer distance in specified units.
"units": "meters" // Units for the buffer distance, e.g., "meters" or "kilometers".
},
{
"type": "union" // Merges overlapping features into a single feature.
}
]
}

Endpoints Organized by Input Type

Each endpoint is tailored to a specific type of spatial data input (referred to as readers) and may have unique requirements based on the input type for example:

  • GeoJSON: Can be sent directly as a JSON payload.
  • Shapefile (SHP): Needs to be zipped into a .zip file and sent as a multipart form request.
  • DXF: Requires input_crs to define the projection since DXF files do not contain projection information by default.

For more details and examples of each the geoflip supported input (reader) types, please refer to the Reader Section.

Configurations for Output and Transformations

Each endpoint includes a configuration section within the request payload, enabling you to define:

  • Output Format and CRS:

    • Specify the desired output format, such as GeoJSON or SHP, and the output CRS (e.g., "EPSG:4326").
  • List of Transformations:

    • Define transformations to apply to the data, with each transformation requiring a type (e.g., buffer or clip) and, if needed, additional parameters such as distance or clipping geometry.