• Stars
    star
    222
  • Rank 179,123 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Library for serializing the GeoJSON vector GIS file format

geojson

Documentation

Library for serializing the GeoJSON vector GIS file format

Minimum Rust Version

This library requires a minimum Rust version of 1.34 (released April 11 2019)

Examples

Reading

use geojson::GeoJson;

let geojson_str = r#"
{
    "type": "Feature",
    "properties": {
        "name": "Firestone Grill"
    },
    "geometry": {
        "type": "Point",
        "coordinates": [-120.66029,35.2812]
    }
}
"#;

let geojson = geojson_str.parse::<GeoJson>().unwrap();

Writing

use geojson::{Feature, GeoJson, Geometry, Value, JsonObject, JsonValue};

let geometry = Geometry::new(
    Value::Point(vec![-120.66029,35.2812])
);

let mut properties = JsonObject::new();
properties.insert(
    String::from("name"),
    JsonValue::from("Firestone Grill"),
);

let geojson = GeoJson::Feature(Feature {
    bbox: None,
    geometry: Some(geometry),
    id: None,
    properties: Some(properties),
    foreign_members: None,
});

let geojson_string = geojson.to_string();

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

geo

Geospatial primitives and algorithms for Rust
Rust
1,247
star
2

rstar

R*-tree spatial index for the Rust ecosystem
Rust
384
star
3

geozero

Zero-Copy reading and writing of geospatial data.
Rust
355
star
4

gdal

Rust bindings for GDAL
Rust
342
star
5

proj

Rust bindings for the latest stable release of PROJ
Rust
131
star
6

geos

Rust bindings for GEOS
Rust
87
star
7

gpx

Rust read/write support for GPS Exchange Format (GPX)
Rust
84
star
8

geohash

Geohash for Rust
Rust
84
star
9

netcdf

High-level netCDF bindings for Rust
Rust
81
star
10

rinex

RINEX and GNSS data processing πŸ›°οΈ
Rust
80
star
11

geotiff

Reading GeoTIFFs in Rust, nothing else!
Rust
69
star
12

geocoding

Geocoding library for Rust.
Rust
63
star
13

robust

Robust predicates for computational geometry
Rust
51
star
14

wkt

Rust read/write support for well-known text (WKT)
Rust
43
star
15

geographiclib-rs

A port of geographiclib in Rust.
Rust
41
star
16

kml

Rust support for KML
Rust
27
star
17

polyline

Google Encoded Polyline encoding & decoding in Rust.
Rust
17
star
18

osm

OSM XML serialization and other OpenStreetMap utilities
Rust
16
star
19

transitfeed

Public transit serializer/deserializer and manipulation library for Rust
Rust
16
star
20

ogcapi

OGC API building blocks implemented in Rust
Rust
14
star
21

topojson

TopoJSON bindings and utilities for Rust
Rust
10
star
22

world-file

Rust read/write support for world files
Rust
7
star
23

shapefile

Rust read/write support for shapefiles
HTML
7
star
24

tilejson

Library for serializing the TileJSON file format
Rust
6
star
25

geos-sys

FFI bindings for libgeos
C++
5
star
26

geo-svg

A rust library to generate SVGs for geo-types
Rust
5
star
27

georust.org

georust.org
3
star
28

meta

The GeoRust Team repository for coordinating and discussing GeoRust projects
Shell
1
star
29

docker-images

Docker images used in the GeoRust ecosystem
Makefile
1
star