Skip to content

simplify geojson specified as geometry in catalog_source #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

jreiberkyle
Copy link
Contributor

Related Issue(s):

Closes #871

Proposed Changes:

For inclusion in changelog (if applicable):

  1. planet.subscription_request.catalog_source and planet subscriptions source-catalog now simplify geojson given in geometry parameter/option to just the geometry, the form required by the subscriptions api.

Not intended for changelog:

Diff of User Interface

Old behavior:

planet subscriptions request-catalog \
        --item-types PSScene \
        --asset-types ortho_analytic_8b_sr,ortho_udm2 \
        --geometry aoi.geojson \
        --start-time 2022-01-01 | jq

{
  "type": "catalog",
  "parameters": {
    "item_types": [
      "PSScene"
    ],
    "asset_types": [
      "ortho_analytic_8b_sr",
      "ortho_udm2"
    ],
    "geometry": {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "properties": {},
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  7.05322265625,
                  46.81509864599243
                ],
                [
                  7.580566406250001,
                  46.81509864599243
                ],
                [
                  7.580566406250001,
                  47.17477833929903
                ],
                [
                  7.05322265625,
                  47.17477833929903
                ],
                [
                  7.05322265625,
                  46.81509864599243
                ]
              ]
            ]
          }
        }
      ]
    },
    "start_time": "2022-01-01T00:00:00Z"
  }
}

New behavior:

planet subscriptions request-catalog \
        --item-types PSScene \
        --asset-types ortho_analytic_8b_sr,ortho_udm2 \
        --geometry aoi.geojson \
        --start-time 2022-01-01 | jq

{
  "type": "catalog",
  "parameters": {
    "item_types": [
      "PSScene"
    ],
    "asset_types": [
      "ortho_analytic_8b_sr",
      "ortho_udm2"
    ],
    "geometry": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            7.05322265625,
            46.81509864599243
          ],
          [
            7.580566406250001,
            46.81509864599243
          ],
          [
            7.580566406250001,
            47.17477833929903
          ],
          [
            7.05322265625,
            47.17477833929903
          ],
          [
            7.05322265625,
            46.81509864599243
          ]
        ]
      ]
    },
    "start_time": "2022-01-01T00:00:00Z"
  }
}

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

@kevinlacaille kevinlacaille left a comment

Choose a reason for hiding this comment

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

This all looks good to me, thanks for the quick and easy PR review!

Copy link
Contributor

Choose a reason for hiding this comment

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

Solid test!

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice and simple solution :)

@jreiberkyle jreiberkyle merged commit a55e851 into rc3dev-fixes Mar 21, 2023
@jreiberkyle jreiberkyle deleted the geom-871 branch March 22, 2023 18:47
@jreiberkyle jreiberkyle mentioned this pull request Apr 14, 2023
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