Skip to content
getgeolens.com

Create Feature

POST
/datasets/{dataset_id}/features/
curl --request POST \
--url https://example.com/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/features/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "geometry": { "geometries": [ { "coordinates": [ "example" ], "type": "Point" } ], "type": "GeometryCollection" }, "properties": {} }'

Insert a new GeoJSON feature into a dataset.

dataset_id
required
Dataset Id
string format: uuid
Media type application/json
FeatureCreate

GeoJSON-style feature for insertion.

object
geometry
required
Any of:
GeoJSONGeometryCollection

A GeoJSON GeometryCollection (RFC 7946 §3.1.8).

fix(#430 codex r9): carries geometries instead of coordinates, so it needs its own model — only generic-GEOMETRY datasets accept it on write (enforced in the service), and any stored collection must serialize back out on read.

Deliberately NON-recursive (codex r13, refuted): PostGIS cannot round-trip nested collections through the GeoJSON boundary in either direction — ST_GeomFromGeoJSON rejects them on write and ST_AsGeoJSON raises ‘GeoJson: geometry not supported’ on read — so a recursive model could never receive one and would only convert the write-side 422 into a raw database 500. The write schemas add a raw-payload guard for a clear 422.

object
geometries
required
Geometries
Array<object>
GeoJSONGeometry

A GeoJSON geometry object (RFC 7946).

object
coordinates
required
Coordinates
Array
type
required
Type
string
Allowed values: Point MultiPoint LineString MultiLineString Polygon MultiPolygon
type
required
Type
string
Allowed value: GeometryCollection
properties
Any of:
object
key
additional properties
any

Successful Response

GeoJSONFeature

A single GeoJSON Feature.

object
geometry
Any of:
GeoJSONGeometryCollection

A GeoJSON GeometryCollection (RFC 7946 §3.1.8).

fix(#430 codex r9): carries geometries instead of coordinates, so it needs its own model — only generic-GEOMETRY datasets accept it on write (enforced in the service), and any stored collection must serialize back out on read.

Deliberately NON-recursive (codex r13, refuted): PostGIS cannot round-trip nested collections through the GeoJSON boundary in either direction — ST_GeomFromGeoJSON rejects them on write and ST_AsGeoJSON raises ‘GeoJson: geometry not supported’ on read — so a recursive model could never receive one and would only convert the write-side 422 into a raw database 500. The write schemas add a raw-payload guard for a clear 422.

object
geometries
required
Geometries
Array<object>
GeoJSONGeometry

A GeoJSON geometry object (RFC 7946).

object
coordinates
required
Coordinates
Array
type
required
Type
string
Allowed values: Point MultiPoint LineString MultiLineString Polygon MultiPolygon
type
required
Type
string
Allowed value: GeometryCollection
id
required
Id
integer
properties
required
Properties
object
key
additional properties
any
type
Type
string
default: Feature
Allowed value: Feature
Example
{
"geometry": {
"geometries": [
{
"type": "Point"
}
],
"type": "GeometryCollection"
},
"type": "Feature"
}

Bad request — invalid payload

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks write access

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Conflict — resource state prevents the operation

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}