Skip to content

refactor(openrouteservice): isochrone file only - #528

Open
dre-raygun wants to merge 4 commits into
masterfrom
feat/527/isochrone-file-only
Open

dre-raygun wants to merge 4 commits into
masterfrom
feat/527/isochrone-file-only

Conversation

@dre-raygun

Copy link
Copy Markdown
Contributor

Closes #527

Author commitment

Before opening an integration PR, I confirm that:

  • I understand the third-party API areas I implemented.
  • I can explain every action, endpoint, permission, dependency, and important helper.
  • I used the documented Autohive SDK process and repository conventions.
  • I reviewed the generated or written code myself.
  • I removed dead code, generic boilerplate, hallucinated behavior, and unnecessary abstractions.
  • I tested the integration with meaningful mocked tests.
  • I included real API integration tests where safe and practical, or documented why not.
  • I ran local validation and fixed issues before requesting review.
  • I documented the integration clearly for users and future maintainers.

Summary

get_isochrone can return unsimplified drive-time polygons as a platform file only, so those rings do not enter the agent transcript. Callers that still want inline GeoJSON are unchanged.

Version 1.3.0. Additive: include_geojson defaults to true.

Behaviour

  • export_geojson=true and include_geojson=false: geojson is null, one file, plus a bands summary (no coordinates).
  • include_geojson=false without export: invalid_request on include_geojson, no HeiGIT call.
  • If file export fails in file-only mode: keep inline geojson and set message. Geometry is never dropped.
  • Every successful call includes bands: time_minutes, geometry_type, polygon_count, vertex_count, geodesic area_sq_km (holes subtracted; null if the calculation fails), bbox [west, south, east, north] (null if any vertex is unusable; planar WGS84).
  • Catchment pattern in the action description and README: export_geojson=true, include_geojson=false. Pass the file to the next action or script; read bands in context.

Tests

  1. Unit: file-only omits inline GeoJSON and matches the exported collection; invalid combo does not fetch; export fail-safe keeps geometry and pins message; default call still returns inline GeoJSON plus bands; MultiPolygon / hole counts; ~1 km² square near 41°S within ±2%; bbox is null on NaN or truncated vertices.
  2. Live: the existing export test now uses file-only (geojson null, bands present). The default live isochrone test asserts bands. Not run in this session (no OPENROUTESERVICE_API_KEY here). Skip unless that key is set.
  3. Local: validate_integration.py and check_code.py passed. Unit suite: 85 passed.

Review standard

Reviewers are expected to hold integration PRs to this charter.

A PR may be sent back even if CI passes when the author has not demonstrated API understanding, intentional scope, safe permissions, meaningful tests, maintainable Python, or adequate self-review.

The goal is not to slow down integration development. The goal is to decrease time to develop and maintenance by avoiding shipping code we do not understand, cannot maintain long term, or cannot safely stand behind.

If you are unsure about anything on the above to help you move forward in the integration, reach out to a peer to get clarity

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T21:13:04.836868Z 7460c98 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@teamcity-autohive-ai

teamcity-autohive-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Integration tests

✅ openrouteservice (8/8 tests pass)

Passed (8)
✅ test_geocodes_a_new_zealand_address
✅ test_geocode_response_shape
✅ test_returns_drive_time_geojson_for_auckland
✅ test_isochrone_response_shape
✅ test_export_geojson_is_a_platform_file_without_credentials
✅ test_returns_auckland_driving_pairs_with_ids
✅ test_disconnected_destination_is_null
✅ test_export_json_is_a_platform_file_without_credentials

View tests in TeamCity

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🔍 Integration Validation Results

Commit: 92c88f4d7e1e985a206bb52a0c07fd41b63b883c · fix(openrouteservice): wrap isochrone band area across the date line
Changed directories: openrouteservice

Check Result
Structure ✅ Passed
Code ✅ Passed
Tests ✅ Passed
README ✅ Passed
Version ✅ Passed
✅ Structure Check output
Validating 1 integration(s)...

============================================================
Integration: openrouteservice
============================================================

✅ Structure valid

============================================================
SUMMARY
============================================================
Integrations validated: 1
Total errors: 0
Total warnings: 0

✅ All validations passed!
✅ Code Check output
----------------------------------------
Checking: openrouteservice
----------------------------------------

🐍 Checking Python syntax...
   ✅ Syntax OK

📥 Checking imports...
   ✅ Imports OK

📄 Checking JSON files...
   ✅ JSON files OK

🔍 Linting with ruff...
   ✅ Lint OK

🎨 Checking formatting with ruff...
   ✅ Formatting OK

🔒 Scanning for security issues with bandit...
   ✅ Security OK
   Warnings:
     ⚠️ nosec encountered (B105) in openrouteservice/tests/conftest.py:15
     ⚠️ nosec encountered (B105) in openrouteservice/tests/test_openrouteservice_unit.py:899

🛡️ Checking dependencies for vulnerabilities with pip-audit...
   ✅ Dependencies OK

🔗 Checking config-code sync...
   ✅ Config-code sync OK

🔄 Checking fetch patterns...
   ✅ Fetch patterns OK

========================================
✅ CODE CHECK PASSED
========================================
✅ Tests Check output
Integration         Tests  Coverage        Status
-------------------------------------------------
openrouteservice    86/86       91%      ✅ Passed
-------------------------------------------------
Total               86/86            ✅ All passed

✅ Tests passed: openrouteservice
✅ README Check output
========================================
✅ README CHECK PASSED
========================================
✅ Version Check output
✅ openrouteservice: 1.2.0 → 1.3.0 (minor bump)

========================================
✅ VERSION CHECK PASSED
========================================

@autohive-ai autohive-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Result P1 P2 P3
Clean review 0 0 0

Clean review

Summary

Reviewed commit: 7460c98

No actionable issues found in the isochrone file-only output, band summaries, or associated schema and documentation changes.

For an explanation, reply under a comment with @autohiveai and your question.

Limitations

  • Tests were not run, as requested by the repository review settings.

Review powered by Autohive

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7460c98b90

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread openrouteservice/openrouteservice.py Outdated
p1 = coords[lower]
p2 = coords[middle]
p3 = coords[upper]
area += math.radians(p3[0] - p1[0]) * math.sin(math.radians(p2[1]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize longitude deltas before computing band areas

For an isochrone whose polygon crosses the antimeridian, GeoJSON will contain adjacent longitudes near 179.x and -179.x; this subtraction treats the short crossing as an approximately 360° arc and can inflate area_sq_km by orders of magnitude. Normalize each longitude delta into the [-180, 180] range before converting it to radians so the compact band summary remains accurate for valid locations near ±180°.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(openrouteservice): add file-only isochrones and bands summary

1 participant