feat: Add support for BytesIO input in boundary processing #1
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
hotosm#204
This
PR
enhances the boundary processing functionality within theBaseMapper
class by introducing theextract_bbox
() method. This method facilitates the extraction of bounding boxes from both file inputs (JSON or GeoJSON) and BytesIO objects.. Additionally, themakeBbox()
method has been refactored 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 withBytesIO
input.Changes Made
extract_bbox()
method toBaseMapper
class to handle boundary processing logic and 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 purpose of this
PR
is to enhance the functionality and maintainability of boundary processing within theBaseMapper
class. By introducing reusable methods and comprehensive unit tests, the codebase becomes more modular, readable, and reliable.