Skip to content

Commit

Permalink
updated deprectated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dieuska committed Jul 11, 2024
1 parent c71485a commit 059bc8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 6 additions & 2 deletions examples/example_131635.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from brdr.aligner import Aligner
from brdr.enums import GRBType
from brdr.loader import DictLoader, GRBActualLoader
from brdr.utils import get_oe_dict_by_ids
from examples import show_map

Expand All @@ -9,8 +11,10 @@
aligner = Aligner()
# Load thematic data & reference data
dict_theme = get_oe_dict_by_ids([131635])
aligner.load_thematic_data_dict(dict_theme)
aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000)
loader = DictLoader(dict_theme)
aligner.load_thematic_data(loader)
loader = GRBActualLoader(grb_type=GRBType.ADP, partition=1000, aligner=aligner)
aligner.load_reference_data(loader)

# RESULTS
rel_dist = 2
Expand Down
16 changes: 10 additions & 6 deletions examples/example_parcel_change_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from shapely.geometry import shape

from brdr.aligner import Aligner
from brdr.loader import GeoJsonLoader
from brdr.utils import get_collection
from brdr.utils import get_oe_geojson_by_bbox

Expand Down Expand Up @@ -61,10 +62,9 @@ def check_business_equality(base_formula, actual_formula):
# base_year
base_aligner = Aligner()
# Load the thematic data to evaluate
# base_aligner.load_thematic_data_file("testdata/theme_changetest.geojson",
# 'theme_identifier') base_aligner.load_thematic_data_file(
# "testdata/theme_leuven.geojson", 'aanduid_id')
base_aligner.load_thematic_data_geojson(get_oe_geojson_by_bbox(bbox), "aanduid_id")
loader = GeoJsonLoader(get_oe_geojson_by_bbox(bbox), "aanduid_id")
base_aligner.load_thematic_data(loader)

logging.info(
"Number of OE-thematic features loaded into base-aligner: "
+ str(len(base_aligner.dict_thematic))
Expand All @@ -78,7 +78,9 @@ def check_business_equality(base_formula, actual_formula):
)
collection = get_collection(ref_url, limit)

base_aligner.load_reference_data_geojson(collection, "CAPAKEY")
# base_aligner.load_reference_data_geojson(collection, "CAPAKEY")
loader = GeoJsonLoader(collection, "CAPAKEY")
base_aligner.load_reference_data(loader)

# SEARCH FOR CHANGED Parcels in specific timespan
# =================================================
Expand All @@ -98,6 +100,7 @@ def check_business_equality(base_formula, actual_formula):
+ "&bbox-crs=EPSG:31370&bbox="
+ bbox
)
print(adp_url)

collection = get_collection(adp_url, limit)
array_features = []
Expand Down Expand Up @@ -131,7 +134,8 @@ def check_business_equality(base_formula, actual_formula):
"limit=" + str(limit) + "&crs=" + crs + "&bbox-crs=EPSG:31370&bbox=" + bbox
)
collection = get_collection(actual_url, limit)
actual_aligner.load_reference_data_geojson(collection, "CAPAKEY")
loader = GeoJsonLoader(collection, "CAPAKEY")
actual_aligner.load_reference_data(loader)


# LOOP AND PROCESS ALL POSSIBLE AFFECTED FEATURES
Expand Down

0 comments on commit 059bc8f

Please sign in to comment.