Skip to content

Conversation

@charcey
Copy link
Contributor

@charcey charcey commented Nov 18, 2025

Proposed Changes:

For inclusion in changelog (if applicable):

  1. Python SDK and CLI now supports geometry_relation for catalog subscriptions.

New behavior:

planet subscriptions request-catalog \
    --item-types PSScene \
    --asset-types ortho_analytic_4b \
    --start-time 2021-03-01T00:00:00.0Z \
    --geometry "$geometry" \
    --geometry-relation intersects <-- now can supply geometry_relation of intersects (default), contains, within


from datetime import datetime
from planet.subscription_request import catalog_source

catalog_source = catalog_source(
    item_types=["PSScene"],
    asset_types=["ortho_analytic_4b"],
    start_time=datetime.fromisoformat("2024-11-05T00:00:00Z"),
    geometry={
        "coordinates": [
            [
                [139.56481933, 35.42374884],
                [140.10314941, 35.42374884],
                [140.10314941, 35.77102915],
                [139.56481933, 35.77102915],
                [139.56481933, 35.42374884],
            ]
        ],
        "type": "Polygon",
    },
    geometry_relation="intersects" # <-- now can supply geometry_relation of intersects (default), contains, within
)

PR Checklist:

  • This PR is as small and focused as possible
  • If this PR includes proposed changes for inclusion in the changelog, the title of this PR summarizes those changes and is ready for inclusion in the Changelog.
  • I have updated docstrings for function changes and docs in the 'docs' folder for user interface / behavior changes
  • This PR does not break any examples or I have updated them

(Optional) @mentions for Notifications:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the geometry_relation parameter to catalog subscriptions, allowing users to specify how subscription geometry relates to item geometry (intersects, contains, or within).

Key Changes

  • Added geometry_relation parameter to the catalog_source() function with support for three values: "intersects", "contains", and "within"
  • Added --geometry-relation CLI option to the request-catalog command
  • Added comprehensive test coverage for the new parameter in both unit and integration tests

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
planet/subscription_request.py Added geometry_relation parameter to catalog_source() function with type hints and documentation
planet/cli/subscriptions.py Added --geometry-relation CLI option with help text and parameter forwarding
tests/unit/test_subscription_request.py Added unit test for "contains" geometry relation
tests/integration/test_subscriptions_cli.py Added parameterized integration test covering all three geometry relation values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@charcey charcey merged commit 84944f6 into main Nov 19, 2025
16 of 27 checks passed
@charcey charcey deleted the cp/subs-geometry-relation branch November 19, 2025 17:18
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.

3 participants