Skip to content

Conversation

@KrausMatthias
Copy link
Contributor

@KrausMatthias KrausMatthias commented May 12, 2025

  • I agree to follow the project's code of conduct.
  • I added an entry to the project's change log file if knowledge of this change could be valuable to users.
    • Usually called CHANGES.md or CHANGELOG.md
    • Prefix changelog entries for breaking changes with "BREAKING: "

First stab at implementing MovingFeatures, starting with Primitive Temporal Geometry.

Would be happy about early feedback :)

@KrausMatthias
Copy link
Contributor Author

I'm not yet sure if it's worth it to convert from columnar representations in TemporalPrimitiveGeometry for datetimes, coordinates and orientations to row-based representation, mainly to enforce same length arrays.
This is mostly inspired by geojson::Geometry.

@KrausMatthias
Copy link
Contributor Author

I'm also still unsure on how to correctly represent Crs and Trs which appear to differ from other OGC API Specs

@b4l
Copy link
Member

b4l commented May 17, 2025

Hi @KrausMatthias, thanks for the contribution!

I'm not yet sure if it's worth it to convert from columnar representations in TemporalPrimitiveGeometry for datetimes, coordinates and orientations to row-based representation, mainly to enforce same length arrays.

I would prefer some other way to avoid writing too much custom serialization code.

I'm also still unsure on how to correctly represent Crs and Trs which appear to differ from other OGC API Specs

We probably have to define an explicit Crs and Trs struct for this.

@KrausMatthias
Copy link
Contributor Author

Thanks for the feedback :)

I'm now using serde(try_from ) to check for same length Vecs, which is much less complex, but slightly ugly, maybe I can come up with a nicer name than "SameLengthDateTimeCoordinatesVecs" 😄

  • TODO: Check for correct length of orientations in case of base representation

@b4l
Copy link
Member

b4l commented May 18, 2025

I'm now using serde(try_from ) to check for same length Vecs, which is much less complex, but slightly ugly, maybe I can come up with a nicer name than "SameLengthDateTimeCoordinatesVecs" 😄

I prefer this mouthful given how much code is saved. It is debatable whether we even want to enforce it. Obviously, it is an improvement, however, there is generally no validation done regarding the values of types. For example, we do not check whether a certain CRS code actually exists. Also, not sure if this should be part of the serialization or an additional layer/function. Though this is something for another time, let's keep it as is for now.

@KrausMatthias KrausMatthias force-pushed the feature/movingfeatures branch from a8bdbf6 to 8a02b9f Compare May 19, 2025 19:10
@KrausMatthias
Copy link
Contributor Author

KrausMatthias commented May 23, 2025

It is debatable whether we even want to enforce it. Obviously, it is an improvement, however, there is generally no validation done regarding the values of types. For example, we do not check whether a certain CRS code actually exists. Also, not sure if this should be part of the serialization or an additional layer/function. Though this is something for another time, let's keep it as is for now.

I think there is a difference between CRS codes and same length vecs, as we don't know which projections the application will support, but for mismatched datetimes/coordinates vecs we do know it's not possible to reliably construct a trajectory from that (besides this constraint is explicitly stated in the spec).

So I would prefer to keep validation.


I've now also started adding temporal properties, but I'm not very happy about that so far as it's a painful mix of almost equivalent types. I will try to clear this up a bit in another commit.

@KrausMatthias KrausMatthias force-pushed the feature/movingfeatures branch from e6d0f95 to 9364110 Compare May 25, 2025 14:59
@KrausMatthias
Copy link
Contributor Author

I've now added the transactions traits to ogcapi-drivers and created a minimal blanket implementation based on the FeatureTransactions for testing. The idea is to first get a spike done in ogcapi-services for some client side testing before adding a proper implementation in postgres. I guess for S3 it might already be good enough.

@KrausMatthias KrausMatthias force-pushed the feature/movingfeatures branch from 59e6440 to 9882cfd Compare May 27, 2025 18:36
@b4l
Copy link
Member

b4l commented Jun 15, 2025

I've now added the transactions traits to ogcapi-drivers and created a minimal blanket implementation based on the FeatureTransactions for testing. The idea is to first get a spike done in ogcapi-services for some client side testing before adding a proper implementation in postgres. I guess for S3 it might already be good enough.

@KrausMatthias that's great! Indeed, the services are intended mainly for testing. The current S3 backend is due for some revamping. I intend to rework it with the object store crate at some point if time allows. Anyways, how about landing the types and dealing with outstanding issues in a follow pr?

@KrausMatthias
Copy link
Contributor Author

KrausMatthias commented Jun 17, 2025

I still want to cleanup some details about the types, but I guess then they are ready.

  • Keep enforcing same length date / coordinate vecs?
    • Implement this for all places where columnar representation is used
    • Add some methods to make usage more convenient

    I'd be strongly in favor of that, as non same length would result in broken data

  • Keep enforcing >=2 geometries in TemporalComplexGeometry (requirement in the Spec)?

    I guess I would skip that, as TemporalComplexGeometry with no or only one Geometry would be equivalent to just no temporal geometry or TemporalPrimitiveGeometry semantically and not broken data

  • Should time in Feature be Vec<Vec<Option<DateTime>> or rather [Option<DateTime>]?

Unrelated question, why do we enforce Utc and not just any Timezone (As long as we have a timezone)? Is this required in the spec somewhere?

@b4l
Copy link
Member

b4l commented Jun 17, 2025

* [ ]  Keep enforcing same length date / coordinate vecs?

This could maybe be simplified by custom serialization on the struct/enum, mimicking what serde is doing, and then just add a test on the respective attributes to check for the same length.

* [ ]  Keep enforcing >=2 geometries in TemporalComplexGeometry (requirement in the Spec)?
  > I guess I would skip that, as TemporalComplexGeometry with no or only one Geometry would be equivalent to just no temporal geometry or TemporalPrimitiveGeometry semantically and not broken data

Up to you, I am not familiar enough to assess the implications.

* [ ]  Should time in Feature be Vec<Vec<Option<DateTime>> or rather [Option<DateTime>]?

From a quick look, I would assume Vec<[Option<DateTime>; 2]>, but could be wrong.

Unrelated question, why do we enforce Utc and not just any Timezone (As long as we have a timezone)? Is this required in the spec somewhere?

Honestly, I do not recall anymore. Probably some (draft) specifications emphasized it. Just take what you think is most appropriate for Moving Features. We can revise this at some point, hopefully based on OGC consolidation work and not ours.

@KrausMatthias KrausMatthias marked this pull request as ready for review September 1, 2025 10:18
@KrausMatthias KrausMatthias requested a review from b4l September 1, 2025 10:18
@KrausMatthias
Copy link
Contributor Author

Thanks for your patience, I finally found the time to pick this up again

@b4l
Copy link
Member

b4l commented Sep 1, 2025

Thanks for your patience, I finally found the time to pick this up again

No problem, happy to review it tomorrow. It's already past midnight here.

Copy link
Member

@b4l b4l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor remarks, otherwise looks good!

@b4l
Copy link
Member

b4l commented Nov 22, 2025

Hi @KrausMatthias, I would like to merge this. From my side, there is only one question open: whether we should always error on mismatching vec length. Do you have any preference for this? I am leaning towards failing fast and always enforcing it.

@KrausMatthias
Copy link
Contributor Author

I agree, I would also go for failing fast

@b4l b4l assigned b4l and unassigned b4l Nov 30, 2025
@b4l b4l self-requested a review November 30, 2025 13:50
@b4l
Copy link
Member

b4l commented Nov 30, 2025

@KrausMatthias Thanks for keeping at it, I think it's a great addition!

@b4l b4l merged commit d93d874 into georust:main Nov 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants