Skip to content

Conversation

@maltehuebner
Copy link
Contributor

Summary

  • Fix POINT coordinate order from (latitude, longitude) to (longitude, latitude)

Problem

PostGIS expects POINT(longitude latitude) ([x y] convention), but the Station constructor wrote POINT(latitude longitude). The prePersist() lifecycle callback had the correct order, so persisted stations were fine — but adhoc Station objects (created in AdhocDataRetriever for real-time OWM data) were never persisted, so their coord field had swapped coordinates.

Test plan

  • Verify distance calculations for adhoc temperature data are correct
  • Verify existing persisted stations are unaffected (prePersist still applies)

🤖 Generated with Claude Code

PostGIS POINT geometry expects (longitude, latitude) but the
constructor wrote POINT(latitude, longitude). The prePersist()
lifecycle callback had the correct order, but the constructor did not.
This affected adhoc Station objects created in AdhocDataRetriever
which are never persisted and thus never corrected by prePersist().

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

1 participant