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

Create bounding box area calculation process #301

Closed

Conversation

LukeParky
Copy link
Member

@LukeParky LukeParky commented Nov 25, 2024

DESCRIPTION OF PR:

MVP work for #256 but not enough to close to issue.

Polygon work would be better.
Could not display the bounding box polygon.

@caseyli92 use your best judgement if its best to merge this PR or complete and merge the polygon PR, or both

Developer Checklist

  • Make code change
  • Update tests
    • Update / create new tests
    • Ensure these tests have the expected behaviour
    • Test locally and ensure tests are passing
  • Update documentation
    • Readme
    • Docstrings
    • Comments
    • Wiki

Reviewer Checklist

  • Check new code for code smells
  • Check new tests
    • Ensure adequate coverage
    • Check for code smells within tests
  • Check if documentation needs updating
    • Readme
    • Docstrings
    • Comments
    • Wiki

@LukeParky LukeParky marked this pull request as ready for review November 25, 2024 00:34
@LukeParky LukeParky force-pushed the 256-Draw-Bounding-Box-Calculate-Area branch from 7030e40 to 275c5bd Compare November 25, 2024 04:27
Copy link
Member

@caseyli92 caseyli92 left a comment

Choose a reason for hiding this comment

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

Looks good.

Comment on lines +13 to +27
def __init__(self) -> None:
"""Define inputs and outputs of the WPS process, and assogm process handler."""
# Create bounding box WPS inputs.
inputs = [BoundingBoxInput('bboxin', 'box in', crss=['epsg:4326'])]
# Create area WPS outputs.
outputs = [LiteralOutput('area', 'Area', data_type='string')]

# Initialise the process.
super().__init__(
self._handler,
identifier='area',
title="Calculate the area of the polygon.",
inputs=inputs,
outputs=outputs,
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def __init__(self) -> None:
"""Define inputs and outputs of the WPS process, and assogm process handler."""
# Create bounding box WPS inputs.
inputs = [BoundingBoxInput('bboxin', 'box in', crss=['epsg:4326'])]
# Create area WPS outputs.
outputs = [LiteralOutput('area', 'Area', data_type='string')]
# Initialise the process.
super().__init__(
self._handler,
identifier='area',
title="Calculate the area of the polygon.",
inputs=inputs,
outputs=outputs,
)
def __init__(self) -> None:
"""Define inputs and outputs of the WPS process, and assogm process handler."""
# Create bounding box WPS inputs
inputs = [BoundingBoxInput('bboxin', 'box in', crss=['epsg:4326'])]
# Create area WPS outputs
outputs = [LiteralOutput('area', 'Area', data_type='string')]
# Initialise the process
super().__init__(
self._handler,
identifier='area',
title="Calculate the area of the polygon.",
inputs=inputs,
outputs=outputs,
)
Suggested change
def __init__(self) -> None:
"""Define inputs and outputs of the WPS process, and assogm process handler."""
# Create bounding box WPS inputs.
inputs = [BoundingBoxInput('bboxin', 'box in', crss=['epsg:4326'])]
# Create area WPS outputs.
outputs = [LiteralOutput('area', 'Area', data_type='string')]
# Initialise the process.
super().__init__(
self._handler,
identifier='area',
title="Calculate the area of the polygon.",
inputs=inputs,
outputs=outputs,
)
def __init__(self) -> None:
"""Define inputs and outputs of the WPS process, and assogm process handler."""
# Create bounding box WPS inputs.
inputs = [BoundingBoxInput('bboxin', 'box in', crss=['epsg:4326'])]
# Create area WPS outputs.
outputs = [LiteralOutput('area', 'Area', data_type='string')]
# Initialise the process.
super().__init__(
self._handler,
identifier='area',
title="Calculate the area of the polygon.",
inputs=inputs,
outputs=outputs,
)

Comment on lines +29 to +30
@staticmethod
def _handler(request: WPSRequest, response: ExecuteResponse) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@staticmethod
def _handler(request: WPSRequest, response: ExecuteResponse) -> None:
def _handler(self, request: WPSRequest, response: ExecuteResponse) -> None:

@LukeParky LukeParky closed this Nov 26, 2024
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