Closed jeafreezy closed 5 months ago
@jeafreezy thanks for your great contributions. I have just one general comment about security:
Agree; it makes sense to have the plugin in the codebase without having in default configuration.
Thank you both for the review and feedback. Please, how do you think I should go about this? I have a few ideas;
Kindly advise. Thank you.
Hi @jeafreezy, I believe the correct approach would be to omit the configuration entirely from the default pygeoapi configuration file, and instead, documenting the capacities of the Shapely Process Provider here / location in source code
Thank you @webb-ben . I will work on that
Not sure if we need need pytest to ensure function of the process capacities.
Apart from that, small changes to docs and a couple of files I am not sure need to be included in this PR, got my +1.
Thank you for reviewing my PR. I will address the issues.
Thank you for reviewing my PR @tomkralidis. I have addressed the issues to the best of my knowledge. Kindly let me know if there is anything else I missed. Thank you.
Thank you @jeafreezy for this valuable contribution!
Overview
This PR exposes some selected shapely functions as sample process. The selection cut across different operations in shapely. It uses the name of the category of that function as the namespace. E.g union operation under the set module is described as
set:union
. This is to avoid clashes with other functions.As mentioned in the issue, it accepts list of geometry inputs (WKT and/or GeoJSON geometry), performs the operation and returns the result in the specified output_format (optional).
The approach is describe in the image below:
Related issue / discussion
https://github.com/geopython/pygeoapi/issues/1439
Additional information
Todo/Idea/Challenge
Tests(units) - I didn't see any test for process in the codebase. I tried writing one, but I need to spend some more time to understand the test structure.
I am yet to figure out how to pass optional function parameters in the inputs. I am still confused on the data type to use in the metadata, especially since different functions require different parameters. e.g buffer operation requires distance. @tomkralidis and I discussed an alternative approach earlier today, which is using different classes for different functions. That could potentially solve this issue. But I didn't have much time to explore that. Although this may also lead to repetitive code. Since the idea is to have it as a sample, hopefully this current implementation is sufficient.
Idea: Perhaps in the future, it will be great to chain functions. E.g passing multiple operations like ['buffer', 'join'] can be interpreted as perfoming the buffer operation on the geometries, followed by the join operation before returning the result.
Dependency policy (RFC2)
Updates to public demo
Contributions and licensing
(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)