feat: Add support for BytesIO input in boundary processing #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description
This
PR
enhances the boundary processing functionality within theBaseMapper
class by introducing the extract_bbox() method. This method facilitates the extraction of bounding boxes from both file inputs (JSON or GeoJSON) andBytesIO
objects.. Additionally, themakeBbox()
method has beenrefactored
to compute bounding boxes, enhancing the functionality of boundary extraction. A new unit test,test_create_with_byteio()
, has been implemented to verify the correctness of boundary processing when provided with BytesIO input.Changes Made
extract_bbox()
method toBaseMapper
class to handle boundary processing logic and for code reusability.makeBbox()
method to compute bounding boxes for boundary extraction.test_create_with_byteio()
unit test to verify boundary processing with BytesIO input.Purpose
The primary purpose of this PR is to enable
BytesIO
input for boundary processing within the BaseMapper class and enhance testing capabilities accordingly. By allowing BytesIO input, users can provide boundary data in-memory, increasing flexibility in data handling. Additionally, the inclusion of a dedicated unit test ensures that boundary processing with BytesIO input is validated, contributing to the overall reliability and robustness of the codebase.