#gis #data #format #grid #reading-writing #isg #geodetic

libisg

Libraly reading/writing ISG 2.0 format

6 releases

0.2.5 Aug 16, 2024
0.2.4 Aug 1, 2024
0.2.3 Jul 29, 2024

#99 in Geospatial

Download history 1023/week @ 2024-07-27 63/week @ 2024-08-03 131/week @ 2024-08-10 51/week @ 2024-08-17 1/week @ 2024-08-24 1/week @ 2024-08-31 3/week @ 2024-09-14 31/week @ 2024-09-21 4/week @ 2024-09-28 30/week @ 2024-10-05 20/week @ 2024-10-12 2/week @ 2024-10-19 90/week @ 2024-10-26 3/week @ 2024-11-02 4/week @ 2024-11-09

99 downloads per month

MIT/Apache

120KB
3K SLoC

libisg

Crates.io Version GitHub Actions Workflow Status docs.rs Crates.io License

Library reading/writing the ISG 2.0-format.

use std::fs;

use libisg;
use libisg::{Data, DataBounds, ISG};

let s = fs::read_to_string("Example 1.isg").unwrap();

let isg = libisg::from_str(&s).unwrap();


let (a_max, b_max, delta_a, delta_b) = match isg.header.data_bounds {
    DataBounds::GridGeodetic { lat_max, lon_max, delta_lat, delta_lon, .. } => {
        (lat_max, lon_max, delta_lat, delta_lon)
    },
    _ => unimplemented!("`Example 1.isg` is grid geodetic"),
};

match &isg.data {
    Data::Grid(data) => {
        for (nrow, row) in data.iter().enumerate() {
            for (ncol, value) in row.iter().enumerate() {
                let a = a_max - delta_a * nrow;
                let b = b_max - delta_b * ncol;
                // do something
            }
        }
    }
    Data::Sparse(data) => {
        for row in data {
            let (a, b, value) = row;
            // do something
        }
    }
}

Features:

  • Support serialization/deserialization of ISG format
  • Support serde (feature serde required)

Licence

MIT or Apache-2.0

Reference

Specification: https://www.isgeoid.polimi.it/Geoid/format_specs.html

Dependencies

~160KB