3个版本 (重大更改)
0.3.0 | 2023年11月10日 |
---|---|
0.2.0 | 2023年11月10日 |
0.1.0 | 2023年11月7日 |
#184 在 地理空间
每月下载量 66
用于 proj4rs
4.5MB
43K SLoC
CRS(坐标参考系统)定义。
来源于 https://github.com/DanielJDufour/crs-csv.
示例
通过常量直接访问CRS定义
let def = crs_definitions::EPSG_4326;
assert_eq!(
def.proj4,
r#"+proj=longlat +datum=WGS84 +no_defs"#,
);
assert_eq!(
def.wkt,
r#"GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]"#,
);
通过EPSG代码查找CRS定义
let def = crs_definitions::from_code(4326);
assert_eq!(def, Some(crs_definitions::EPSG_4326));
通过常量EPSG代码查找CRS定义
const def: Def = crs_definitions::from_code_const::<4326>();
assert_eq!(def, crs_definitions::EPSG_4326);