python-osw-validation 0.4.5__py3-none-any.whl → 0.5.0__py3-none-any.whl
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.
- python_osw_validation/__init__.py +96 -43
- python_osw_validation/config.py +1 -1
- python_osw_validation/helpers.py +25 -11
- python_osw_validation/version.py +1 -1
- {python_osw_validation-0.4.5.dist-info → python_osw_validation-0.5.0.dist-info}/METADATA +8 -6
- {python_osw_validation-0.4.5.dist-info → python_osw_validation-0.5.0.dist-info}/RECORD +9 -9
- {python_osw_validation-0.4.5.dist-info → python_osw_validation-0.5.0.dist-info}/WHEEL +0 -0
- {python_osw_validation-0.4.5.dist-info → python_osw_validation-0.5.0.dist-info}/licenses/LICENSE +0 -0
- {python_osw_validation-0.4.5.dist-info → python_osw_validation-0.5.0.dist-info}/top_level.txt +0 -0
|
@@ -21,7 +21,7 @@ from .helpers import (
|
|
|
21
21
|
_feature_index_from_error,
|
|
22
22
|
_pretty_message,
|
|
23
23
|
_read_geojson_without_ext,
|
|
24
|
-
|
|
24
|
+
_geojson_features_exceeding_coordinate_precision,
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
SCHEMA_PATH = os.path.join(os.path.dirname(__file__), 'schema')
|
|
@@ -34,9 +34,13 @@ DEFAULT_DATASET_SCHEMAS = {
|
|
|
34
34
|
"zones": os.path.join(SCHEMA_PATH, 'opensidewalks.zones.schema-0.3.json'),
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
37
|
+
COORDINATE_PRECISION_REMEDY = (
|
|
38
|
+
"Reduce them to at most {limit} decimal places; "
|
|
39
|
+
"you can use the OSW data wizard tool to clean this up."
|
|
40
|
+
)
|
|
41
|
+
NULLISH_VALUE_REMEDY = (
|
|
42
|
+
"Null/NaN placeholders are not allowed; provide a valid value or remove this "
|
|
43
|
+
"property. You can use the OSW data wizard tool to clean this up."
|
|
40
44
|
)
|
|
41
45
|
MAX_GEOMETRY_VERTICES = DEFAULT_MAX_GEOMETRY_VERTICES
|
|
42
46
|
VERTEX_LIMIT_DATASETS = frozenset({"edges", "lines", "polygons", "zones"})
|
|
@@ -48,18 +52,16 @@ class ValidationResult:
|
|
|
48
52
|
* `errors`: high-level, human-readable strings (legacy behavior).
|
|
49
53
|
* `issues`: per-feature schema problems (former `fixme`), each item:
|
|
50
54
|
{ 'filename': str, 'feature_index': Optional[int], 'error_message': List[str] }
|
|
51
|
-
* `warnings`: non-blocking validation warning string.
|
|
52
55
|
"""
|
|
53
56
|
|
|
54
57
|
def __init__(self, is_valid: bool, errors: Optional[List[str]] = None,
|
|
55
|
-
issues: Optional[List[Dict[str, Any]]] = None
|
|
58
|
+
issues: Optional[List[Dict[str, Any]]] = None):
|
|
56
59
|
self.is_valid = is_valid
|
|
57
60
|
if len(errors) == 0:
|
|
58
61
|
self.errors = None
|
|
59
62
|
else:
|
|
60
63
|
self.errors = errors
|
|
61
64
|
self.issues = issues
|
|
62
|
-
self.warnings = warnings
|
|
63
65
|
|
|
64
66
|
|
|
65
67
|
class OSWValidation:
|
|
@@ -85,7 +87,8 @@ class OSWValidation:
|
|
|
85
87
|
self.errors: List[str] = []
|
|
86
88
|
# per-feature schema issues (formerly `fixme`)
|
|
87
89
|
self.issues: List[Dict[str, Any]] = []
|
|
88
|
-
|
|
90
|
+
# dataset key ('edges') -> the GeoJSON filename it was read from
|
|
91
|
+
self.dataset_filenames: Dict[str, str] = {}
|
|
89
92
|
if config is not None and not isinstance(config, ValidationConfig):
|
|
90
93
|
raise TypeError("config must be a ValidationConfig instance.")
|
|
91
94
|
self.config = config or ValidationConfig()
|
|
@@ -115,30 +118,63 @@ class OSWValidation:
|
|
|
115
118
|
'error_message': message,
|
|
116
119
|
})
|
|
117
120
|
|
|
118
|
-
def
|
|
119
|
-
"""
|
|
121
|
+
def _dataset_filename(self, dataset_name: Optional[str]) -> Optional[str]:
|
|
122
|
+
"""Resolve a dataset key to the file it was read from.
|
|
123
|
+
|
|
124
|
+
Errors always name a real file ('opensidewalks.edges.geojson'), never the
|
|
125
|
+
internal dataset key ('edges'). Names that are already filenames, such as
|
|
126
|
+
external extensions, pass through unchanged.
|
|
127
|
+
"""
|
|
128
|
+
if dataset_name is None:
|
|
129
|
+
return None
|
|
130
|
+
return self.dataset_filenames.get(dataset_name, dataset_name)
|
|
131
|
+
|
|
132
|
+
def _check_coordinate_precision(self, file_paths, max_errors: int = 20) -> bool:
|
|
133
|
+
"""Log an error per feature whose coordinates exceed the precision limit.
|
|
134
|
+
|
|
135
|
+
Returns True when every file is within the limit.
|
|
136
|
+
"""
|
|
137
|
+
is_valid = True
|
|
120
138
|
for file_path in file_paths:
|
|
139
|
+
filename = os.path.basename(str(file_path))
|
|
121
140
|
try:
|
|
122
|
-
|
|
141
|
+
offending = _geojson_features_exceeding_coordinate_precision(
|
|
123
142
|
str(file_path),
|
|
124
143
|
self.config.coordinate_precision,
|
|
125
|
-
)
|
|
126
|
-
self.warnings = (
|
|
127
|
-
"Input dataset contains coordinates with more than "
|
|
128
|
-
f"{self.config.coordinate_precision} decimal places."
|
|
129
|
-
)
|
|
130
|
-
return
|
|
144
|
+
)
|
|
131
145
|
except (OSError, json.JSONDecodeError, TypeError, ValueError):
|
|
132
146
|
# Existing parsing and schema validation own all functional errors.
|
|
133
147
|
continue
|
|
148
|
+
for feature_index in offending:
|
|
149
|
+
is_valid = False
|
|
150
|
+
location = (
|
|
151
|
+
f"Feature {feature_index} in '{filename}'"
|
|
152
|
+
if feature_index is not None
|
|
153
|
+
else f"'{filename}'"
|
|
154
|
+
)
|
|
155
|
+
self.log_errors(
|
|
156
|
+
message=(
|
|
157
|
+
f"{location} contains coordinates with more than "
|
|
158
|
+
f"{self.config.coordinate_precision} decimal places. "
|
|
159
|
+
+ COORDINATE_PRECISION_REMEDY.format(
|
|
160
|
+
limit=self.config.coordinate_precision
|
|
161
|
+
)
|
|
162
|
+
),
|
|
163
|
+
filename=filename,
|
|
164
|
+
feature_index=feature_index,
|
|
165
|
+
)
|
|
166
|
+
if len(self.errors) >= max_errors:
|
|
167
|
+
return False
|
|
168
|
+
return is_valid
|
|
134
169
|
|
|
135
170
|
# add this small helper inside OSWValidation (near other helpers)
|
|
136
171
|
def _get_colset(self, gdf: Optional[gpd.GeoDataFrame], col: str, filekey: str) -> set:
|
|
137
172
|
"""Return set of a column if present; else log and return empty set."""
|
|
138
173
|
if gdf is None:
|
|
139
174
|
return set()
|
|
175
|
+
filename = self._dataset_filename(filekey)
|
|
140
176
|
if col not in gdf.columns:
|
|
141
|
-
self.log_errors(f"Missing required column '{col}' in {
|
|
177
|
+
self.log_errors(f"Missing required column '{col}' in {filename}.", filename, None)
|
|
142
178
|
return set()
|
|
143
179
|
try:
|
|
144
180
|
return set(gdf[col].dropna())
|
|
@@ -147,7 +183,7 @@ class OSWValidation:
|
|
|
147
183
|
try:
|
|
148
184
|
return set(map(str, gdf[col].dropna()))
|
|
149
185
|
except Exception:
|
|
150
|
-
self.log_errors(f"Could not create set for column '{col}' in {
|
|
186
|
+
self.log_errors(f"Could not create set for column '{col}' in {filename}.", filename, None)
|
|
151
187
|
return set()
|
|
152
188
|
|
|
153
189
|
# ----------------------------
|
|
@@ -217,7 +253,7 @@ class OSWValidation:
|
|
|
217
253
|
f"start coordinate {edge_start} does not match "
|
|
218
254
|
f"node id '{u_id}' coordinate {node_coord} (_u_id mismatch)."
|
|
219
255
|
),
|
|
220
|
-
filename='edges',
|
|
256
|
+
filename=self._dataset_filename('edges'),
|
|
221
257
|
feature_index=feat_idx,
|
|
222
258
|
)
|
|
223
259
|
|
|
@@ -239,7 +275,7 @@ class OSWValidation:
|
|
|
239
275
|
f"end coordinate {edge_end} does not match "
|
|
240
276
|
f"node id '{v_id}' coordinate {node_coord} (_v_id mismatch)."
|
|
241
277
|
),
|
|
242
|
-
filename='edges',
|
|
278
|
+
filename=self._dataset_filename('edges'),
|
|
243
279
|
feature_index=feat_idx,
|
|
244
280
|
)
|
|
245
281
|
|
|
@@ -294,7 +330,7 @@ class OSWValidation:
|
|
|
294
330
|
f"node id '{w_id}' coordinate {node_coord} is not a vertex "
|
|
295
331
|
f"of the zone polygon geometry (_w_id coordinate mismatch)."
|
|
296
332
|
),
|
|
297
|
-
filename='zones',
|
|
333
|
+
filename=self._dataset_filename('zones'),
|
|
298
334
|
feature_index=feat_idx,
|
|
299
335
|
)
|
|
300
336
|
|
|
@@ -340,12 +376,13 @@ class OSWValidation:
|
|
|
340
376
|
feature_id = row.get('_id', feature_index)
|
|
341
377
|
if self._is_nullish_value(feature_id):
|
|
342
378
|
feature_id = feature_index
|
|
379
|
+
filename = self._dataset_filename(dataset_name)
|
|
343
380
|
self.log_errors(
|
|
344
381
|
message=(
|
|
345
|
-
f"Feature '{feature_id}' in '{
|
|
382
|
+
f"Feature '{feature_id}' in '{filename}' contains {vertex_count} geometry vertices. "
|
|
346
383
|
f"Maximum allowed is {self.config.max_geometry_vertices}."
|
|
347
384
|
),
|
|
348
|
-
filename=
|
|
385
|
+
filename=filename,
|
|
349
386
|
feature_index=feature_index,
|
|
350
387
|
)
|
|
351
388
|
|
|
@@ -406,12 +443,13 @@ class OSWValidation:
|
|
|
406
443
|
feature_id = row.get('_id', feature_index)
|
|
407
444
|
if self._is_nullish_value(feature_id):
|
|
408
445
|
feature_id = feature_index
|
|
446
|
+
filename = self._dataset_filename(dataset_name)
|
|
409
447
|
self.log_errors(
|
|
410
448
|
message=(
|
|
411
|
-
f"Feature '{feature_id}' in '{
|
|
449
|
+
f"Feature '{feature_id}' in '{filename}' has {geometry_problem} geometry "
|
|
412
450
|
"because all coordinates are identical."
|
|
413
451
|
),
|
|
414
|
-
filename=
|
|
452
|
+
filename=filename,
|
|
415
453
|
feature_index=feature_index,
|
|
416
454
|
)
|
|
417
455
|
|
|
@@ -548,7 +586,7 @@ class OSWValidation:
|
|
|
548
586
|
final_errors = self.errors if errors is None else errors
|
|
549
587
|
final_errors = (final_errors or [])[:max_errors]
|
|
550
588
|
final_issues = (self.issues or [])[:max_errors]
|
|
551
|
-
return ValidationResult(is_valid, final_errors, final_issues
|
|
589
|
+
return ValidationResult(is_valid, final_errors, final_issues)
|
|
552
590
|
|
|
553
591
|
zip_handler = None
|
|
554
592
|
OSW_DATASET: Dict[str, Optional[gpd.GeoDataFrame]] = {}
|
|
@@ -577,10 +615,21 @@ class OSWValidation:
|
|
|
577
615
|
)
|
|
578
616
|
return _finalize(False)
|
|
579
617
|
|
|
580
|
-
|
|
618
|
+
# Remember which file each dataset key came from, so every error can
|
|
619
|
+
# name a real file instead of the internal key.
|
|
620
|
+
self.dataset_filenames = {}
|
|
621
|
+
for file in getattr(validator, 'files', []) or []:
|
|
622
|
+
basename = os.path.basename(str(file))
|
|
623
|
+
dataset_key = dataset_key_for_filename(basename)
|
|
624
|
+
if dataset_key:
|
|
625
|
+
self.dataset_filenames[dataset_key] = basename
|
|
626
|
+
|
|
627
|
+
if not self._check_coordinate_precision(
|
|
581
628
|
list(getattr(validator, 'files', []) or [])
|
|
582
|
-
+ list(getattr(validator, 'externalExtensions', []) or [])
|
|
583
|
-
|
|
629
|
+
+ list(getattr(validator, 'externalExtensions', []) or []),
|
|
630
|
+
max_errors=max_errors,
|
|
631
|
+
):
|
|
632
|
+
return _finalize(False)
|
|
584
633
|
|
|
585
634
|
# Per-file schema validation → populate self.issues (fixme-like)
|
|
586
635
|
for file in validator.files:
|
|
@@ -616,14 +665,15 @@ class OSWValidation:
|
|
|
616
665
|
if not is_valid:
|
|
617
666
|
total_duplicates = len(duplicates)
|
|
618
667
|
displayed = ', '.join(map(str, duplicates[:max_errors]))
|
|
668
|
+
filename = self._dataset_filename(osw_file)
|
|
619
669
|
if total_duplicates > max_errors:
|
|
620
|
-
message = (f"Duplicate _id's found in {
|
|
670
|
+
message = (f"Duplicate _id's found in {filename}: showing first {max_errors} "
|
|
621
671
|
f"of {total_duplicates} duplicates: {displayed}")
|
|
622
672
|
else:
|
|
623
|
-
message = f"Duplicate _id's found in {
|
|
673
|
+
message = f"Duplicate _id's found in {filename}: {displayed}"
|
|
624
674
|
self.log_errors(
|
|
625
675
|
message=message,
|
|
626
|
-
filename=
|
|
676
|
+
filename=filename,
|
|
627
677
|
feature_index=None
|
|
628
678
|
)
|
|
629
679
|
|
|
@@ -646,7 +696,12 @@ class OSWValidation:
|
|
|
646
696
|
for item in (sub if isinstance(sub, (list, tuple)) else [sub])
|
|
647
697
|
)
|
|
648
698
|
else:
|
|
649
|
-
self.
|
|
699
|
+
zones_filename = self._dataset_filename('zones')
|
|
700
|
+
self.log_errors(
|
|
701
|
+
f"Missing required column '_w_id' in {zones_filename}.",
|
|
702
|
+
zones_filename,
|
|
703
|
+
None,
|
|
704
|
+
)
|
|
650
705
|
node_ids_zones_w = set()
|
|
651
706
|
else:
|
|
652
707
|
node_ids_zones_w = set()
|
|
@@ -663,7 +718,7 @@ class OSWValidation:
|
|
|
663
718
|
message=(f"All _u_id's in edges should be part of _id's mentioned in nodes. "
|
|
664
719
|
f"Showing {max_errors if num_unmatched > max_errors else 'all'} out of {num_unmatched} "
|
|
665
720
|
f"unmatched _u_id's: {displayed_unmatched}"),
|
|
666
|
-
filename='
|
|
721
|
+
filename=self._dataset_filename('edges'),
|
|
667
722
|
feature_index=None
|
|
668
723
|
)
|
|
669
724
|
|
|
@@ -678,7 +733,7 @@ class OSWValidation:
|
|
|
678
733
|
message=(f"All _v_id's in edges should be part of _id's mentioned in nodes. "
|
|
679
734
|
f"Showing {max_errors if num_unmatched > max_errors else 'all'} out of {num_unmatched} "
|
|
680
735
|
f"unmatched _v_id's: {displayed_unmatched}"),
|
|
681
|
-
filename='
|
|
736
|
+
filename=self._dataset_filename('edges'),
|
|
682
737
|
feature_index=None
|
|
683
738
|
)
|
|
684
739
|
|
|
@@ -693,7 +748,7 @@ class OSWValidation:
|
|
|
693
748
|
message=(f"All _w_id's in zones should be part of _id's mentioned in nodes. "
|
|
694
749
|
f"Showing {max_errors if num_unmatched > max_errors else 'all'} out of {num_unmatched} "
|
|
695
750
|
f"unmatched _w_id's: {displayed_unmatched}"),
|
|
696
|
-
filename='
|
|
751
|
+
filename=self._dataset_filename('zones'),
|
|
697
752
|
feature_index=None
|
|
698
753
|
)
|
|
699
754
|
|
|
@@ -731,8 +786,9 @@ class OSWValidation:
|
|
|
731
786
|
displayed_invalid = ', '.join(map(str, invalid_ids[:limit]))
|
|
732
787
|
self.log_errors(
|
|
733
788
|
message=(f"Showing {max_errors if num_invalid > max_errors else 'all'} out of {num_invalid} "
|
|
734
|
-
f"invalid {osw_file}
|
|
735
|
-
|
|
789
|
+
f"invalid geometries in {self._dataset_filename(osw_file)}, "
|
|
790
|
+
f"id's of invalid geometries: {displayed_invalid}"),
|
|
791
|
+
filename=self._dataset_filename(osw_file),
|
|
736
792
|
feature_index=None
|
|
737
793
|
)
|
|
738
794
|
|
|
@@ -886,10 +942,7 @@ class OSWValidation:
|
|
|
886
942
|
return False
|
|
887
943
|
found_nullish = True
|
|
888
944
|
rendered = f'"{bad_value}"' if isinstance(bad_value, str) else str(bad_value)
|
|
889
|
-
msg =
|
|
890
|
-
f"Invalid value at '{path}': {rendered}. "
|
|
891
|
-
f"Null/NaN placeholders are not allowed; provide a valid value or remove this property."
|
|
892
|
-
)
|
|
945
|
+
msg = f"Invalid value at '{path}': {rendered}. {NULLISH_VALUE_REMEDY}"
|
|
893
946
|
self.errors.append(f"Validation error: {msg}")
|
|
894
947
|
self.issues.append({
|
|
895
948
|
"filename": filename,
|
python_osw_validation/config.py
CHANGED
python_osw_validation/helpers.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import re
|
|
3
3
|
from decimal import Decimal
|
|
4
|
-
from typing import Any, Optional
|
|
4
|
+
from typing import Any, List, Optional
|
|
5
5
|
|
|
6
6
|
import geopandas as gpd
|
|
7
7
|
|
|
@@ -28,25 +28,39 @@ def _geometry_exceeds_coordinate_precision(geometry: Any, max_decimal_places: in
|
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def
|
|
32
|
-
|
|
31
|
+
def _geojson_features_exceeding_coordinate_precision(
|
|
32
|
+
file_path: str, max_decimal_places: int = 7
|
|
33
|
+
) -> List[Optional[int]]:
|
|
34
|
+
"""Return feature indices whose coordinates exceed the decimal-place limit.
|
|
35
|
+
|
|
36
|
+
A single-`Feature` or bare-geometry document has no feature index, so it is
|
|
37
|
+
reported as `None` when it violates the limit.
|
|
38
|
+
"""
|
|
33
39
|
with open(file_path, 'r', encoding='utf-8') as file:
|
|
34
40
|
data = json.load(file, parse_float=Decimal)
|
|
35
41
|
|
|
36
42
|
if not isinstance(data, dict):
|
|
37
|
-
return
|
|
43
|
+
return []
|
|
38
44
|
if data.get("type") == "FeatureCollection":
|
|
39
45
|
features = data.get("features", [])
|
|
40
46
|
if not isinstance(features, list):
|
|
41
|
-
return
|
|
42
|
-
return
|
|
43
|
-
|
|
47
|
+
return []
|
|
48
|
+
return [
|
|
49
|
+
index
|
|
50
|
+
for index, feature in enumerate(features)
|
|
51
|
+
if isinstance(feature, dict)
|
|
44
52
|
and _geometry_exceeds_coordinate_precision(feature.get("geometry"), max_decimal_places)
|
|
45
|
-
|
|
46
|
-
)
|
|
53
|
+
]
|
|
47
54
|
if data.get("type") == "Feature":
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
geometry = data.get("geometry")
|
|
56
|
+
else:
|
|
57
|
+
geometry = data
|
|
58
|
+
return [None] if _geometry_exceeds_coordinate_precision(geometry, max_decimal_places) else []
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _geojson_file_has_excess_coordinate_precision(file_path: str, max_decimal_places: int = 7) -> bool:
|
|
62
|
+
"""Return whether serialized GeoJSON coordinates exceed the decimal-place limit."""
|
|
63
|
+
return bool(_geojson_features_exceeding_coordinate_precision(file_path, max_decimal_places))
|
|
50
64
|
|
|
51
65
|
|
|
52
66
|
def _read_geojson_without_ext(file_path: str) -> gpd.GeoDataFrame:
|
python_osw_validation/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.
|
|
1
|
+
__version__ = '0.5.0'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python_osw_validation
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Python library for OSW validation
|
|
5
5
|
Home-page: https://github.com/TaskarCenterAtUW/TDEI-python-lib-osw-validation
|
|
6
6
|
Author: Sujata Misra
|
|
@@ -70,7 +70,6 @@ result = validator.validate()
|
|
|
70
70
|
print(result.is_valid)
|
|
71
71
|
print(result.errors) # returns up to the first 20 high-level errors by default
|
|
72
72
|
print(result.issues) # detailed per-feature issues, capped to first 20 by default
|
|
73
|
-
print(result.warnings) # non-blocking coordinate precision warning, or an empty string
|
|
74
73
|
|
|
75
74
|
result = validator.validate(max_errors=10)
|
|
76
75
|
print(result.is_valid)
|
|
@@ -89,7 +88,7 @@ from python_osw_validation import OSWValidation, ValidationConfig
|
|
|
89
88
|
config = ValidationConfig(
|
|
90
89
|
max_geometry_vertices=3000,
|
|
91
90
|
coordinate_precision=8,
|
|
92
|
-
allow_zero_length_lines=
|
|
91
|
+
allow_zero_length_lines=False,
|
|
93
92
|
)
|
|
94
93
|
|
|
95
94
|
validator = OSWValidation(
|
|
@@ -102,8 +101,8 @@ result = validator.validate()
|
|
|
102
101
|
| Setting | Default | Meaning |
|
|
103
102
|
|---------|---------|---------|
|
|
104
103
|
| `max_geometry_vertices` | `2000` | Maximum allowed vertices for edges, lines, polygons, and zones. Must be an integer greater than zero. |
|
|
105
|
-
| `coordinate_precision` | `7` | Maximum coordinate decimal places
|
|
106
|
-
| `allow_zero_length_lines` | `
|
|
104
|
+
| `coordinate_precision` | `7` | Maximum coordinate decimal places allowed. Features exceeding it fail validation. Must be a non-negative integer. |
|
|
105
|
+
| `allow_zero_length_lines` | `True` | Allows collapsed `LineString` geometries in edges, lines, and external line data. Set to `False` to reject them. |
|
|
107
106
|
|
|
108
107
|
Allowing zero-length lines does not bypass `_u_id`/`_v_id` existence or exact
|
|
109
108
|
node-coordinate checks. Zero-area polygons and zones, collapsed `MultiLineString`
|
|
@@ -113,8 +112,11 @@ geometries, and line geometries in point datasets remain invalid.
|
|
|
113
112
|
|
|
114
113
|
- `errors`: high-level validation messages, capped by `max_errors` (default `20`).
|
|
115
114
|
- `issues`: detailed per-feature validation issues, also capped by `max_errors`.
|
|
115
|
+
- Coordinates carrying more than `coordinate_precision` decimal places fail validation before schema checks, one error per offending feature, and the message names the fix:
|
|
116
|
+
- `Feature 12 in 'osw.edges.geojson' contains coordinates with more than 7 decimal places. Reduce them to at most 7 decimal places; you can use the OSW data wizard tool to clean this up.`
|
|
117
|
+
- `issues[].filename` is always the GeoJSON file the problem was found in, never an internal dataset key.
|
|
116
118
|
- If actual null or numeric NaN values are found in `ext:*` extension properties, validation fails early before schema checks with actionable messages such as:
|
|
117
|
-
- `Invalid value at 'ext:metadata.score': nan. Null/NaN placeholders are not allowed; provide a valid value or remove this property.`
|
|
119
|
+
- `Invalid value at 'ext:metadata.score': nan. Null/NaN placeholders are not allowed; provide a valid value or remove this property. You can use the OSW data wizard tool to clean this up.`
|
|
118
120
|
- For enum validation, long allowed-value lists are summarized as:
|
|
119
121
|
- first 5 values joined by `|`
|
|
120
122
|
- followed by `| and N more` when applicable.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
python_osw_validation/__init__.py,sha256=
|
|
2
|
-
python_osw_validation/config.py,sha256=
|
|
1
|
+
python_osw_validation/__init__.py,sha256=oa0KQNuAP5GRZYS63DvV5D_csltBrCq6kNu4WRh_kGM,43928
|
|
2
|
+
python_osw_validation/config.py,sha256=NFxqenwuSeQgAW-QIXCTRZV2Bf5OavBtUOr3ZHtSTcw,1260
|
|
3
3
|
python_osw_validation/extracted_data_validator.py,sha256=ry5M6XO-fwijVc1XCIAMmfeR3n45V-NkSWPuJNF6vJ4,6949
|
|
4
4
|
python_osw_validation/geometry_mapping_validator.py,sha256=KscmfgSwTiXbf8IPx-RXuTIXPYY4PHDwvBeb2WmhpVA,14137
|
|
5
|
-
python_osw_validation/helpers.py,sha256=
|
|
6
|
-
python_osw_validation/version.py,sha256=
|
|
5
|
+
python_osw_validation/helpers.py,sha256=oiKqlGEVJVT5Zcws7h09zdLQOSJx1Vc-DqSu7bCedsA,11546
|
|
6
|
+
python_osw_validation/version.py,sha256=0PaI2eSOCp5kkNcpKpUSbLHf66rL9xQzFpYyLGpEtyM,22
|
|
7
7
|
python_osw_validation/zipfile_handler.py,sha256=jXnP-8O5AAOBapuNF3-XdFVM1MHiPaWpl_wlbX-aqhY,2631
|
|
8
8
|
python_osw_validation/schema/opensidewalks.edges.schema-0.3.json,sha256=yE4K97WEdQBMHlVo5k9uheJ8TzHE6Tfupekxq_uv5Bk,78976
|
|
9
9
|
python_osw_validation/schema/opensidewalks.lines.schema-0.3.json,sha256=AlZuNu4dxEvnnqamHoogg9Y0yZMEyUtB0r854SF0xYo,9326
|
|
@@ -12,8 +12,8 @@ python_osw_validation/schema/opensidewalks.points.schema-0.3.json,sha256=hx5L1Fv
|
|
|
12
12
|
python_osw_validation/schema/opensidewalks.polygons.schema-0.3.json,sha256=VzDpHv1ZVT42cAk9n3gsFZjS7WcflQzSbjN-aNIVTYM,16286
|
|
13
13
|
python_osw_validation/schema/opensidewalks.schema-0.3.json,sha256=vyyGzPpqLxr1e5wFfNKzlA1sr6tmhHKM7ntaTk8z5k8,278489
|
|
14
14
|
python_osw_validation/schema/opensidewalks.zones.schema-0.3.json,sha256=j4vjO5JR5LrRieEhoqOl1ftqwEiU7xggAz__s6LQI38,10548
|
|
15
|
-
python_osw_validation-0.
|
|
16
|
-
python_osw_validation-0.
|
|
17
|
-
python_osw_validation-0.
|
|
18
|
-
python_osw_validation-0.
|
|
19
|
-
python_osw_validation-0.
|
|
15
|
+
python_osw_validation-0.5.0.dist-info/licenses/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
|
|
16
|
+
python_osw_validation-0.5.0.dist-info/METADATA,sha256=lZmfZqN9l09dPus89VwLASjuVPWH94gCYqjWkEXPH5Y,8542
|
|
17
|
+
python_osw_validation-0.5.0.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
18
|
+
python_osw_validation-0.5.0.dist-info/top_level.txt,sha256=GE81UPcDHEffJCxYu3M_iPz3Dt-O3axB73R5SLm_Veo,22
|
|
19
|
+
python_osw_validation-0.5.0.dist-info/RECORD,,
|
|
File without changes
|
{python_osw_validation-0.4.5.dist-info → python_osw_validation-0.5.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{python_osw_validation-0.4.5.dist-info → python_osw_validation-0.5.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|