https://github.com/nmandery/eo-identifiers
Parsers for naming conventions of earth observation products and datasets
https://github.com/nmandery/eo-identifiers
earth-observation parser satellite
Last synced: 10 months ago
JSON representation
Parsers for naming conventions of earth observation products and datasets
- Host: GitHub
- URL: https://github.com/nmandery/eo-identifiers
- Owner: nmandery
- License: mit
- Created: 2022-11-16T19:10:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-28T20:06:34.000Z (over 3 years ago)
- Last Synced: 2025-01-01T04:32:27.765Z (over 1 year ago)
- Topics: earth-observation, parser, satellite
- Language: Rust
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
Parsers for naming conventions of earth observation products and datasets
[](https://crates.io/crates/eo-identifiers)
[](https://docs.rs/eo-identifiers)

[](https://deps.rs/repo/github/nmandery/eo-identifiers)
```rust
use eo_identifiers::Identifier;
use eo_identifiers::identifiers::sentinel2::ProductLevel;
use std::str::FromStr;
use chrono::{NaiveDate, NaiveDateTime, NaiveTime};
fn example() {
let ident = Identifier::from_str("S2A_MSIL1C_20170105T013442_N0204_R031_T53NMJ_20170105T013443")
.unwrap();
if let Identifier::Sentinel2Product(product) = ident {
assert_eq!(product.product_level, ProductLevel::L1C);
assert_eq!(
product.start_datetime,
NaiveDateTime::new(
NaiveDate::from_ymd_opt(2017, 1, 5).unwrap(),
NaiveTime::from_hms_opt(1, 34, 42).unwrap()
)
);
assert_eq!(product.relative_orbit_number, 31);
}
else {
unreachable!();
}
}
```
This crate is at an early stage. There are lots of parser missing - pull requests are welcome.