Skip to content

Commit

Permalink
Merge pull request #54 from OnroerendErfgoed/development
Browse files Browse the repository at this point in the history
Prepare release 0.2.0
  • Loading branch information
maarten-vermeyen authored Sep 3, 2024
2 parents c1148e8 + f24a046 commit ddb2734
Show file tree
Hide file tree
Showing 40 changed files with 8,919 additions and 1,649 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.1.0

- Initial version

# 0.2.0

- add GRB update detection functions and logic
- refactor loader code and other non generic parts ([#17](https://github.com/OnroerendErfgoed/brdr/issues/17), ([#7](https://github.com/OnroerendErfgoed/brdr/issues/7))
- add functionality to set a maximum feature size for input features (([#50](https://github.com/OnroerendErfgoed/brdr/issues/50))
- fix bug reulting from overlapping features in thematic layer ([#46](https://github.com/OnroerendErfgoed/brdr/issues/46))
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,32 @@ pip install brdr

``` python
from brdr.aligner import Aligner
from shapely import from_wkt
from brdr.enums import OpenbaarDomeinStrategy

#CREATE AN ALIGNER
aligner = Aligner(relevant_distance=1, od_strategy=OpenbaarDomeinStrategy.SNAP_SINGLE_SIDE,
threshold_overlap_percentage=50, crs='EPSG:31370')
#ADD A THEMATIC POLYGON TO THEMATIC DICTIONARY and LOAD into Aligner
thematic_dict= {"theme_id_1": from_wkt('POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))')}
aligner.load_thematic_data_dict(thematic_dict)
#ADD A REFERENCE POLYGON TO REFERENCE DICTIONARY and LOAD into Aligner
reference_dict = {"ref_id_1": from_wkt('POLYGON ((0 1, 0 10,8 10,10 1,0 1))')}
aligner.load_reference_data_dict(reference_dict)
#EXECUTE THE ALIGNMENT
result, result_diff, result_diff_plus, result_diff_min, relevant_intersection, relevant_diff = (
aligner.process_dict_thematic(relevant_distance=1))
#PRINT RESULTS IN WKT
print ('result: ' + result['theme_id_1'].wkt)
print ('added area: ' + result_diff_plus['theme_id_1'].wkt)
print ('removed area: ' + result_diff_min['theme_id_1'].wkt)
#SHOW RESULTING GEOMETRY AND CHANGES
from brdr.geometry_utils import geom_from_wkt
from brdr.loader import DictLoader

# CREATE AN ALIGNER
aligner = Aligner(
relevant_distance=1,
od_strategy=OpenbaarDomeinStrategy.SNAP_SINGLE_SIDE,
threshold_overlap_percentage=50,
crs="EPSG:31370",
)
# ADD A THEMATIC POLYGON TO THEMATIC DICTIONARY and LOAD into Aligner
thematic_dict = {"theme_id_1": geom_from_wkt("POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))")}
loader = DictLoader(thematic_dict)
aligner.load_thematic_data(loader)
# ADD A REFERENCE POLYGON TO REFERENCE DICTIONARY and LOAD into Aligner
reference_dict = {"ref_id_1": geom_from_wkt("POLYGON ((0 1, 0 10,8 10,10 1,0 1))")}
loader = DictLoader(reference_dict)
aligner.load_reference_data(loader)
# EXECUTE THE ALIGNMENT
process_result = aligner.process_dict_thematic(relevant_distance=1)
# PRINT RESULTS IN WKT
print("result: " + process_result["theme_id_1"]["result"].wkt)
print("added area: " + process_result["theme_id_1"]["result_diff_plus"].wkt)
print("removed area: " + process_result["theme_id_1"]["result_diff_min"].wkt)
# SHOW RESULTING GEOMETRY AND CHANGES
# from examples import show_map
# show_map(
# {aligner.relevant_distance:(result, result_diff, result_diff_plus, result_diff_min, relevant_intersection, relevant_diff)},
Expand Down
2 changes: 1 addition & 1 deletion brdr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
datefmt="%d-%b-%y %H:%M:%S",
)

__version__ = "0.1.1"
__version__ = "0.2.0"
Loading

0 comments on commit ddb2734

Please sign in to comment.