mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Store simplifed polygons in the SQLite database
This commit does two things: - uses our new polygon-simplifying library to process the polygons before storing them, rather than processing them in real time - stores only the polygons in the database, rather than the whole GeoJSON feature, because we don’t need any of the other information about the feature
This commit is contained in:
@@ -117,13 +117,13 @@ def test_has_polygons():
|
||||
def test_polygons_are_enclosed_unless_asked_not_to_be():
|
||||
england = broadcast_area_libraries.get('ctry19').get('ctry19-E92000001')
|
||||
|
||||
assert len(england.polygons) == len(england.unenclosed_polygons)
|
||||
assert len(england.polygons) == len(england.polygons.as_unenclosed_coordinate_pairs)
|
||||
|
||||
first_polygon = england.polygons[0]
|
||||
first_polygon = england.polygons[0].as_coordinate_pairs
|
||||
assert first_polygon[0] != first_polygon[1] != first_polygon[2]
|
||||
assert first_polygon[0] == first_polygon[-1]
|
||||
|
||||
first_polygon_unenclosed = england.unenclosed_polygons[0]
|
||||
first_polygon_unenclosed = england.polygons[0].as_unenclosed_coordinate_pairs
|
||||
assert first_polygon_unenclosed[0] == first_polygon[0]
|
||||
assert first_polygon_unenclosed[-1] != first_polygon[-1]
|
||||
assert first_polygon_unenclosed[-1] == first_polygon[-2]
|
||||
|
||||
Reference in New Issue
Block a user