readGeoJson

Reads a GeoJSON file into a GeoDataFrame.

Each row in the resulting GeoDataFrame corresponds to a single Feature from the input file:

  • "geometry" value is stored in the geometry column.

  • "properties" are flattened into individual columns using their keys as column names.

  • "crs" is read as null if not specified (interpreted as WGS 84 by default).

Uses the GeoTools GeoJSON parser. Nested properties are not supported and parsed as LinkedHashMap<*, *>. According to the specification, the CRS in GeoJSON should be WGS 84; the deprecated "crs" field is used for now; if it is not present, it is read as null.

Return

a new GeoDataFrame with the data from the GeoJSON file

Parameters

path

a String path to GeoJSON file


Reads a GeoJSON file into a GeoDataFrame.

Each row in the resulting GeoDataFrame corresponds to a single Feature from the input file:

  • "geometry" value is stored in the geometry column.

  • "properties" are flattened into individual columns using their keys as column names.

  • "crs" is read as null if not specified (interpreted as WGS 84 by default).

Uses the GeoTools GeoJSON parser. Nested properties are not supported and parsed as LinkedHashMap<*, *>. According to the specification, the CRS in GeoJSON should be WGS 84; the deprecated "crs" field is used for now; if it is not present, it is read as null.

Return

a new GeoDataFrame with the data from the GeoJSON file

Parameters

url

a URL of GeoJSON file