Skip to main content

GeoJSON

A GeoJSON file, or any vector file DuckDB spatial reads (shapefile, GeoPackage…), as rows: features has one row per feature with its geometry; polygons, lines and points have one row per vertex, ready for a layer; all has every vertex row with a kind column. Wire a table with a geom column into in to read its geometry instead of a file.

Syntax​

{ "id": "n1", "op": "geojson", "name": "geojson", "x": 0, "y": 0, "params": {} }

An edge into it ends at "targetPort": "in"; one out of it starts at "sourcePort": "all".

Inputs​

PortTypeTakes
intableoptional

Parameters​

ParameterKindDefaultChoices
urlurl""

Outputs​

PortType
alltable
polygonstable
linestable
pointstable
featurestable

Remarks​

A URL ending in .shp reads a shapefile, which is several files side by side. The node also fetches the .shx (the index), .dbf (the attributes, which become columns), .prj (the projection) and .cpg (the text encoding) from beside it. The .shx is required. Without a .dbf the features have geometry and no columns; without a .cpg, GDAL takes the text encoding from the .dbf header.

Details​

  • Category: Data
  • Operator: geojson

Older projects​

Projects saved before documents used operator classes. These convert to geojson when they open: A5LayerOp, FileOp, GeoJsonLayerOp, GeohashLayerOp, H3ClusterLayerOp, H3HexagonLayerOp, KmlToGeoJsonOp, PathLayerOp, PolygonLayerOp, QuadkeyLayerOp, S2LayerOp, ShapefileOp, SolidPolygonLayerOp.