mapreader 1.0.7__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mapreader-1.0.7 → mapreader-1.1.0}/PKG-INFO +1 -1
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/_version.py +3 -3
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/annotate/annotator.py +3 -9
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/load/geo_utils.py +30 -29
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader.egg-info/PKG-INFO +1 -1
- {mapreader-1.0.7 → mapreader-1.1.0}/LICENSE +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/README.md +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/__init__.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/annotate/__init__.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/annotate/utils.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/classify/__init__.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/classify/classifier.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/classify/classifier_context.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/classify/custom_models.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/classify/datasets.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/classify/load_annotations.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/download/__init__.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/download/data_structures.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/download/downloader.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/download/downloader_utils.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/download/sheet_downloader.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/download/tile_loading.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/download/tile_merging.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/load/__init__.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/load/images.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/load/loader.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/process/__init__.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/process/process.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/utils/__init__.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/utils/compute_and_save_stats.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader/utils/slice_parallel.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader.egg-info/SOURCES.txt +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader.egg-info/dependency_links.txt +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader.egg-info/entry_points.txt +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader.egg-info/not-zip-safe +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader.egg-info/requires.txt +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/mapreader.egg-info/top_level.txt +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/setup.cfg +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/setup.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/tests/test_annotator.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/tests/test_geo_pipeline.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/tests/test_import.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/tests/test_sheet_downloader.py +0 -0
- {mapreader-1.0.7 → mapreader-1.1.0}/versioneer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mapreader
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A computer vision pipeline for the semantic exploration of maps/images at scale
|
|
5
5
|
Home-page: https://github.com/Living-with-machines/MapReader
|
|
6
6
|
Download-URL: https://github.com/Living-with-machines/MapReader/archive/refs/heads/main.zip
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2023-12-
|
|
11
|
+
"date": "2023-12-14T11:30:18+0000",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "1.0
|
|
14
|
+
"full-revisionid": "8eda75e8ddc1b4d5bb22cc2fcf5ebc0954947d71",
|
|
15
|
+
"version": "1.1.0"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -290,7 +290,6 @@ class Annotator(pd.DataFrame):
|
|
|
290
290
|
self.buttons_per_row = kwargs.get("buttons_per_row", None)
|
|
291
291
|
self._min_values = kwargs.get("min_values", {})
|
|
292
292
|
self._max_values = kwargs.get("max_values", {}) # pixel_bounds = x0, y0, x1, y1
|
|
293
|
-
self._filter_for = kwargs.get("filter_for", {})
|
|
294
293
|
|
|
295
294
|
self.patch_width, self.patch_height = self.get_patch_size()
|
|
296
295
|
|
|
@@ -475,14 +474,9 @@ class Annotator(pd.DataFrame):
|
|
|
475
474
|
if row.label is not None:
|
|
476
475
|
return False
|
|
477
476
|
|
|
478
|
-
test =
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
+ [
|
|
482
|
-
row[col] == filter_for
|
|
483
|
-
for col, filter_for in self._filter_for.items()
|
|
484
|
-
]
|
|
485
|
-
)
|
|
477
|
+
test = [
|
|
478
|
+
row[col] >= min_value for col, min_value in self._min_values.items()
|
|
479
|
+
] + [row[col] <= max_value for col, max_value in self._max_values.items()]
|
|
486
480
|
|
|
487
481
|
if not all(test):
|
|
488
482
|
return False
|
|
@@ -70,36 +70,37 @@ def reproject_geo_info(image_path, target_crs="EPSG:4326", calc_size_in_m=False)
|
|
|
70
70
|
height, width, _ = tiff_shape
|
|
71
71
|
|
|
72
72
|
# Calculate the size of image in meters
|
|
73
|
-
if calc_size_in_m
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
if calc_size_in_m:
|
|
74
|
+
if calc_size_in_m in ["geodesic", "gd"]:
|
|
75
|
+
bottom = geodesic((ymin, xmin), (ymin, xmax)).meters
|
|
76
|
+
right = geodesic((ymin, xmax), (ymax, xmax)).meters
|
|
77
|
+
top = geodesic((ymax, xmax), (ymax, xmin)).meters
|
|
78
|
+
left = geodesic((ymax, xmin), (ymin, xmin)).meters
|
|
79
|
+
|
|
80
|
+
elif calc_size_in_m in ["gc", "great-circle", "great_circle"]:
|
|
81
|
+
bottom = great_circle((ymin, xmin), (ymin, xmax)).meters
|
|
82
|
+
right = great_circle((ymin, xmax), (ymax, xmax)).meters
|
|
83
|
+
top = great_circle((ymax, xmax), (ymax, xmin)).meters
|
|
84
|
+
left = great_circle((ymax, xmin), (ymin, xmin)).meters
|
|
85
|
+
|
|
86
|
+
else:
|
|
87
|
+
raise NotImplementedError(
|
|
88
|
+
f'[ERROR] ``calc_size_in_m`` must be one of "great-circle", "great_circle", "gc", "geodesic" or "gd", not: {calc_size_in_m}'
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
size_in_m = (left, bottom, right, top) # anticlockwise order
|
|
92
|
+
|
|
93
|
+
mean_pixel_height = np.mean([right / height, left / height])
|
|
94
|
+
mean_pixel_width = np.mean([bottom / width, top / width])
|
|
95
|
+
|
|
96
|
+
print(
|
|
97
|
+
f"[INFO] Size in meters of left/bottom/right/top: {left:.2f}/{bottom:.2f}/{right:.2f}/{top:.2f}"
|
|
91
98
|
)
|
|
99
|
+
print(
|
|
100
|
+
f"Each pixel is ~{mean_pixel_height:.3f} X {mean_pixel_width:.3f} meters (height x width)."
|
|
101
|
+
) # noqa
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
mean_pixel_height = np.mean([right / height, left / height])
|
|
96
|
-
mean_pixel_width = np.mean([bottom / width, top / width])
|
|
97
|
-
|
|
98
|
-
print(
|
|
99
|
-
f"[INFO] Size in meters of left/bottom/right/top: {left:.2f}/{bottom:.2f}/{right:.2f}/{top:.2f}"
|
|
100
|
-
)
|
|
101
|
-
print(
|
|
102
|
-
f"Each pixel is ~{mean_pixel_height:.3f} X {mean_pixel_width:.3f} meters (height x width)."
|
|
103
|
-
) # noqa
|
|
103
|
+
else:
|
|
104
|
+
size_in_m = None
|
|
104
105
|
|
|
105
106
|
return tiff_shape, tiff_proj, target_crs, coord, size_in_m
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mapreader
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A computer vision pipeline for the semantic exploration of maps/images at scale
|
|
5
5
|
Home-page: https://github.com/Living-with-machines/MapReader
|
|
6
6
|
Download-URL: https://github.com/Living-with-machines/MapReader/archive/refs/heads/main.zip
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|