Skip to content

Report a pyproj CRS projection as a string - #17

Merged
cleemansen merged 1 commit into
mainfrom
feature/json-serializable-projection
Oct 7, 2026
Merged

cleemansen merged 1 commit into
mainfrom
feature/json-serializable-projection

Conversation

@cleemansen

Copy link
Copy Markdown
Contributor

A TrajectoryCollection built from a GeoDataFrame keeps a pyproj.CRS; one built from x/y keeps the string it was given. The analyzer put get_crs() into its result unchanged, json.dumps rejected the CRS, and the event handler's fail-safe wrote [] instead of the statistics. The traceback only reached the container log, which disappears with the execution pod.

projection now reports crs.srs for a CRS (e.g. 'EPSG:4326') and passes a string through unchanged, so results for existing pickles stay identical.

Impact

  • master: every [] python cargo result since 2026-09-23 (7 of 7) reproduces this TypeError with v2.2.0 and yields full statistics with this branch. One of them is an uncompressed pickle — the failure is not related to gzip.
  • develop: every Python App after move2_loc to MovingPandas, which builds its points as a GeoDataFrame since link-r-python v2.2.1 (#1419). The translator's own cargo result is affected as well.

A [] result for a moving_pandas_trajectory_collection output is always this fail-safe; a genuinely empty collection reports [{"n": ["empty-result"]}].

Test

The new test builds a collection from a GeoDataFrame, writes it as SDK v3 does (gzip), and runs the result through the same JSON encoding as the handler. Asserting projection == 'EPSG:4326' on the raw result would pass with the bug, because pyproj.CRS compares equal to its string.

  • red before the fix with the production error, green after: 10 tests, inside the v2.2.0 image's environment and via test/Dockerfile
  • end to end: main.py with the watchdog handler on the four develop outputs — [] before, full results after

After merge

Tag v2.2.1, then raise groundcontrol.pilot.base-image-name.cargo-agent.python in groundcontrol.

A TrajectoryCollection built from a GeoDataFrame keeps a pyproj CRS,
one built from x/y the string it was given. The analyzer passed the
CRS into its result, json.dumps rejected it, and the event handler's
fail-safe wrote `[]` instead of the statistics.

On master since 2026-09-23 for every App that hands on such a
collection; on develop for every Python App after `move2_loc to
MovingPandas`, which builds its points as a GeoDataFrame since
link-r-python v2.2.1. Not gzip: an uncompressed pickle fails alike.

The test applies the handler's JSON encoding. Comparing the CRS with
'EPSG:4326' would pass regardless, as pyproj.CRS equals its string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cleemansen cleemansen self-assigned this Oct 7, 2026
@cleemansen
cleemansen requested a review from annescharf October 7, 2026 09:08
@cleemansen
cleemansen merged commit 7a01542 into main Oct 7, 2026
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