Skip to content
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

vector_buffer not in line with official spec #247

Open
soxofaan opened this issue Jan 16, 2024 · 4 comments
Open

vector_buffer not in line with official spec #247

soxofaan opened this issue Jan 16, 2024 · 4 comments
Assignees

Comments

@soxofaan
Copy link
Member

soxofaan commented Jan 16, 2024

@non_standard_process(
ProcessSpec(id='vector_buffer', description="Add a buffer around a geometry.")
.param(name='geometry', description="Input geometry (GeoJSON object) to add buffer to.",
schema={"type": "object", "subtype": "geojson"}, required=True)
.param(name='distance', description="The size of the buffer. Can be negative to subtract the buffer",
schema={"type": "number"}, required=True)
.param(name='unit', description="The unit in which the distance is measured.",
schema={"type": "string", "enum": ["meter", "kilometer"]})
.returns(description="Output geometry (GeoJSON object) with the added or subtracted buffer",
schema={"type": "object", "subtype": "geojson"})
)
def vector_buffer(args: Dict, env: EvalEnv) -> dict:

uses arguments:

  • singular geometry (inline geojson)
  • distance (number)
  • unit (number, and required)

Current official spec: https://github.com/Open-EO/openeo-processes/blob/965bbaebd4d5984203a0437076c85a66a72a23e0/proposals/vector_buffer.json
specifies arguments:

  • plural geometries ("vector cube")
  • distance (number)

Note that this standard API is copied over to autogenerated helper in python client: https://github.com/Open-EO/openeo-python-client/blob/7ce92925dd9544ff116b14c0339de203f854ec27/openeo/processes.py#L5497

The difference in singular/plural and the unit argument (which is required but non-standard) make future proof usage problematic

@soxofaan
Copy link
Member Author

(reported by @StijnCaerts)

@JanssenBrm
Copy link

Is it possible that the current process also doesn't support processing Features? Whenever I try this, I get the following message: The value passed for parameter 'geometry' in process 'vector_buffer' is invalid: Invalid geometry type Feature.

It is a bit strange if this wouldn't be working as all other processes seem to be supporting features.

@soxofaan
Copy link
Member Author

indeed "Feature" support was missing from vector_buffer. Added it in b533a23

@jdries
Copy link
Contributor

jdries commented Feb 2, 2024

Added another commit to push this further in the direction of official spec, in a backwards compatible manner.

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

No branches or pull requests

3 participants