esri_json

Crates.ioesri_json
lib.rsesri_json
version0.1.1
created_at2026-01-12 15:13:29.744043+00
updated_at2026-01-14 12:29:39.530746+00
descriptionSerializing and Deserializing Esri JSON using serde
homepage
repositoryhttps://github.com/cookiedan42/esri_json
max_upload_size
id2037983
size164,127
Daniel (cookiedan42)

documentation

README

esri_json

A crate for reading and writing Esri JSON

This crate provides representations of Esri JSON objects with serde::Deserialize and serde::Serialize trait implementations.

The primary purpose of this crate is to convert geospatial data processed with geo into Graphic objects for display in a WebScene component of an ArcGIS Maps SDK for JavaScript application.

Inspired by the serde_esri crate

Feature Overview

  1. Serialization and deserialization of Esri JSON objects
    • Basic Geometry types
    • Reading and writing a Graphic for display in a WebScene
  2. Geometry conversion between Esri JSON and geo_types
    • under the geo_type feature flag

Example

use esri_json::geometry::{Coord,CoordXy,Point};
use esri_json::js_sdk::graphics_layer;
use esri_json::webmap::esri_sms::*;
use serde_json::Map;

let geometry: Point<CoordXy> = Point::new(CoordXy::new(0.0, 0.0), None);

let sms = EsriSMS::default()
    .angle(1.0)
    .color(Color::Rgb(1, 1, 1))
    .outline(Outline::default())
    .size(1.0)
    .style(Style::esriSMSCircle)
    .xoffset(1.0)
    .yoffset(1.0);

let _g = graphics_layer::Graphic::<Point<CoordXy>>::new(geometry)
    .attributes(Map::new())
    .symbol(sms);

More examples are in the tests crate

Supported Esri Formats

Coordinate Formats

  1. XY
  2. XYZ
  3. XYM
  4. XYZM

Geometries

  1. Point
  2. MultiPoint
  3. Polyline
  4. Polygon

id field not supported


Spatial reference

fields are not validated


Graphic Types

Symbologies needed for visualizing supported Geometries can be serialized, deserialized and edited too

  • aggregateGeometries not supported

  • popupTemplate partially supported, only Title and Content are serialized as String

Symbology Types

Symbologies for Point,Polygon,Polyline,Multipoint Geometries are included
Symbologies are built up using the Builder pattern, starting from a ::default() method and adding fields one by one

License

Licensed under Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

Commit count: 5

cargo fmt