Skip to content

Importing file into Datastore

Let’s say you have a geojson file and a PostGIS datastore, and you want to import the geojson file into the PostGIS datastore. You can do this by using the Kala Server’s import endpoint.

  1. Upload the file to the Kala Server using Filestore api
  2. Validate the geojson file to see geojson content
  3. Use the Kala Server’s import endpoint to import the file into the PostGIS datastore. For example we have an existing PostGIS datastore called postgis_sample
  • Endpoint: POST /api/data/datastore/postgis_sample/collections/import
  • Request Body:
{
"name": "submarinecable",
"type": "GEOJSON",
"location": "filestore:00_00__000"
}

Because geojson is a file format which has single collections called default, the output collection will be

  • Imported Collection Name: submarinecable_default
  • URL: /api/data/datastore/postgis_sample/collection/submarinecable_default