-
Notifications
You must be signed in to change notification settings - Fork 12
Implement the MovingFeatures Spec #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,160
−2
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
daca1fd
Implement Temporal Primitive Geometry for MovingFeatures
KrausMatthias 4f7d540
Implement CRS and TRS for Moving Features
KrausMatthias 00ecbf5
Use serde(try_from ...) instead of custom deserialization for tempora…
KrausMatthias 4a0c5de
Inline AnglesType and ScaleType in Orientation
KrausMatthias 9719dd4
Used adjacent tags for Trs and Crs
KrausMatthias 33a09b2
Implement TemporalGeometry and TemporalComplexGeometry
KrausMatthias 61a1b48
Add moving features property types
KrausMatthias 99072bf
Refactor and comment temporal properties
KrausMatthias 2b3e9d2
Some doc comment fixes
KrausMatthias 98064b0
Add test to temporal properties and fix some bugs
KrausMatthias d5200aa
Integrate with moving features with collection, feature collection an…
KrausMatthias 83f77ec
Add traits for moving features transactions to drivers
KrausMatthias c4a7978
Add a blanket implementation of moving feature geometry transactions …
KrausMatthias a32f31c
Drop unnecessary complexity on ItemType for MovingFeatures
KrausMatthias 06b2067
Add convenience method to SameLengthDateTimeCoordinatesVec
KrausMatthias 4b94480
Somehow serde(rename = camelCase) does not work here, resort to serde…
KrausMatthias ad6aaca
Add accessors to SameLengthCoordinatesVec
KrausMatthias ed998a5
Add into_inner to Prisms
KrausMatthias d60220c
Drop enforcment of Prisms having >= 1 geometry
KrausMatthias 5b11edd
Implement same length checks at ser/de for datetime aligned types
KrausMatthias 93d6eb0
Drop foreign members for temporal primitive geometry as it can't be f…
KrausMatthias 7c5938c
Enforce Same Length DateTimeCoords and add convenience functions
KrausMatthias 53c1f80
Fix time type in feature
KrausMatthias 14b4f0c
Add utoipa support
KrausMatthias 7e70a76
Move moving features driver to separate PR #27
KrausMatthias ad4edea
Add movingfeatures to changelog
KrausMatthias 49f3c10
Add serde(default)
KrausMatthias 940321e
When CRS or TRS are missing use the default spatial or temporal CRS
KrausMatthias 2b9ca5e
Address some todos and propositions
b4l b4e6a1f
Merge `main`
b4l 774456c
Fix typo
KrausMatthias 980dc25
Merge branch 'main' into feature/movingfeatures
b4l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| use std::str::FromStr; | ||
|
|
||
| use serde::{Deserialize, Serialize}; | ||
| use utoipa::ToSchema; | ||
|
|
||
| use crate::common; | ||
|
|
||
| /// MF-JSON uses a CRS as described in in (GeoJSON:2008)[https://geojson.org/geojson-spec#coordinate-reference-system-objects] | ||
| /// See (7.2.3 CoordinateReferenceSystem Object)[https://docs.ogc.org/is/19-045r3/19-045r3.html#crs] | ||
| /// See (6. Overview of Moving features JSON Encodings)[https://docs.ogc.org/is/19-045r3/19-045r3.html#_overview_of_moving_features_json_encodings_informative] | ||
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, ToSchema)] | ||
| #[serde(tag = "type", content = "properties")] | ||
| pub enum Crs { | ||
| /// A Named CRS object indicates a coordinate reference system by name. In this case, the value of its "type" member | ||
| /// is the string "Name". The value of its "properties" member is a JSON object containing a "name" member whose | ||
| /// value is a string identifying a coordinate reference system (not JSON null value). The value of "href" and "type" | ||
| /// is a JSON null value. This standard recommends an EPSG[3] code as the value of "name", such as "EPSG::4326." | ||
| /// | ||
| /// See (7.2.3.1 Named CRS)[https://docs.ogc.org/is/19-045r3/19-045r3.html#_7_2_3_1_named_crs] | ||
| Name { name: String }, | ||
| /// A linked CRS object has one required member "href" and one optional member "type". The value of the required "href" | ||
| /// member is a dereferenceable URI. The value of the optional "type" member is a string that hints at the format used | ||
| /// to represent CRS parameters at the provided URI. Suggested values are: "Proj4", "OGCWKT", "ESRIWKT", but others can | ||
| /// be used. | ||
| /// | ||
| /// See (7.2.3.2. Linked CRS)[https://docs.ogc.org/is/19-045r3/19-045r3.html#_7_2_3_2_linked_crs] | ||
| Link { | ||
| r#type: Option<String>, | ||
| href: String, | ||
| }, | ||
| } | ||
|
|
||
| impl Default for Crs { | ||
| fn default() -> Self { | ||
| Self::Name { | ||
| name: common::Crs::default().to_urn(), | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl TryFrom<Crs> for common::Crs { | ||
| type Error = String; | ||
|
|
||
| fn try_from(value: Crs) -> Result<Self, Self::Error> { | ||
| match value { | ||
| // TODO this might not work for names like "EPSG:4326" | ||
| Crs::Name { name } => Self::from_str(name.as_str()), | ||
| Crs::Link { href, .. } => Self::from_str(href.as_str()), | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl From<common::Crs> for Crs { | ||
| fn from(value: common::Crs) -> Self { | ||
| Self::Name { | ||
| name: value.to_urn(), | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
|
|
||
| use super::*; | ||
|
|
||
| #[test] | ||
| fn serde_json() { | ||
| // TODO this contradicts example from https://developer.ogc.org/api/movingfeatures/index.html#tag/MovingFeatures/operation/retrieveMovingFeatures | ||
| // Example from https://docs.ogc.org/is/19-045r3/19-045r3.html#_7_2_3_1_named_crs | ||
| let trs: Crs = serde_json::from_str( | ||
| r#" | ||
| { | ||
| "type": "Name", | ||
| "properties": { | ||
| "name": "urn:ogc:def:crs:OGC:1.3:CRS84" | ||
| } | ||
| } | ||
| "#, | ||
| ) | ||
| .expect("Failed to parse Crs"); | ||
| let expected_trs = Crs::default(); | ||
| assert_eq!(trs, expected_trs); | ||
| } | ||
|
|
||
| #[test] | ||
| fn into_common_crs() { | ||
| // assert_eq!(common::Crs::try_from(Crs::default()).unwrap(), common::Crs::default()); | ||
| assert_eq!(common::Crs::default(), Crs::default().try_into().unwrap()); | ||
|
|
||
| // assert_eq!(Crs::from(common::Crs::default()), Crs::default()); | ||
| assert_eq!(Crs::default(), common::Crs::default().into()); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.