Skip to content

invalid geometry entry created by planet subscriptions request-catalog #871

Closed
@jreiberkyle

Description

@jreiberkyle

Expected behavior

Geometry entry in source.json produced by this command should be just the geometry part of aoi.geojson, so "type": "Polygon" .

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

aoi.geojson:

{
  "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
            ]
          ]
        ]
      }
    }
  ]
}

Actual behavior (describe the problem)
source.json includes the entire featureclass.

source.json:

{
  "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"
  }
}

Ideas
This could probably be fixed by applying geojson.to_geometry() somewhere in the processing chain.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions