GeoJSON.jl icon indicating copy to clipboard operation
GeoJSON.jl copied to clipboard

Utilities for working with GeoJSON data in Julia

GeoJSON

CI codecov

Read GeoJSON files using JSON3.jl, and provide the Tables.jl interface.

This package is heavily inspired by, and borrows code from, JSONTables.jl, which does the same thing for the general JSON format. GeoJSON puts the geometry in a geometry column, and adds all properties in the columns individually.

Usage

julia> using GeoJSON, DataFrames

julia> jsonbytes = read("path/to/a.geojson");

julia> fc = GeoJSON.read(jsonbytes)
FeatureCollection with 171 Features

julia> first(fc)
Feature with geometry type Polygon and properties Symbol[:geometry, :timestamp, :version, :changeset, :user, :uid, :area, :highway, :type, :id]

# use the Tables interface to convert the format, extract data, or iterate over the rows
julia> df = DataFrame(fc)