MeridianMERIDIAN

GeoJSON Geometry

RFC 7946 GeoJSON object. Valid JSON containing a "type" key whose value is one of: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection, Feature, FeatureCollection.

GeoJSON Geometry

geography.format.geojson

RFC 7946 GeoJSON object. Valid JSON containing a "type" key whose value is one of: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection, Feature, FeatureCollection.

Domain
geography
Category
format
Casts to
VARCHAR
Scope
Universal

Try it

CLI
$ finetype infer -i "{"type": "Point", "coordinates": [125.6, 10.1]}"
→ geography.format.geojson

DuckDB

Detect
SELECT finetype('{"type": "Point", "coordinates": [125.6, 10.1]}');
-- → 'geography.format.geojson'
Cast expression
CAST({col} AS VARCHAR)
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS VARCHAR) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'geography.format.geojson';

JSON Schema

finetype schema geography.format.geojson
{
  "$id": "https://meridian.online/schemas/geography.format.geojson",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "RFC 7946 GeoJSON object. Valid JSON containing a \"type\" key whose value is one of: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection, Feature, FeatureCollection.",
  "examples": [
    "{\"type\": \"Point\", \"coordinates\": [125.6, 10.1]}",
    "{\"type\": \"LineString\", \"coordinates\": [[102.0, 0.0], [103.0, 1.0]]}",
    "{\"type\": \"Polygon\", \"coordinates\": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}",
    "{\"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [102.0, 0.5]}, \"properties\": {\"name\": \"example\"}}"
  ],
  "pattern": "^\\{\\s*\"type\"\\s*:\\s*\"(Point|LineString|Polygon|MultiPoint|MultiLineString|MultiPolygon|GeometryCollection|Feature|FeatureCollection)\"",
  "title": "GeoJSON Geometry",
  "type": "string",
  "x-finetype-broad-type": "VARCHAR",
  "x-finetype-transform": "CAST({col} AS VARCHAR)",
  "x-finetype-transform-ext": "ST_GeomFromGeoJSON({col})"
}

Examples

{"type": "Point", "coordinates": [125.6, 10.1]}{"type": "LineString", "coordinates": [[102.0, 0.0], [103.0, 1.0]]}{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}{"type": "Feature", "geometry": {"type": "Point", "coordinates": [102.0, 0.5]}, "properties": {"name": "example"}}

Type Registry