def test_requestless_limits(): gdf = LimitsGeoDataFrame().to_data_frame([ FeatureBuilder() .set_id(ID) .set_name(FOUND_NAME) .set_limit(make_limit_rect()) ]) assert_names(gdf, 0, FOUND_NAME, FOUND_NAME)
def test_requestless_centroids(): gdf = CentroidsGeoDataFrame().to_data_frame([ FeatureBuilder() .set_id(ID) .set_name(FOUND_NAME) .set_centroid(make_centroid_point()) ]) assert_names(gdf, 0, FOUND_NAME, FOUND_NAME)
def test_requestless_boundaries(): gdf = BoundariesGeoDataFrame().to_data_frame([ FeatureBuilder() .set_id(ID) .set_name(FOUND_NAME) .set_boundary(make_single_point_boundary()) # dummy geometry to not fail on None property ]) assert_names(gdf, 0, FOUND_NAME, FOUND_NAME)
def assert_geo_limit(limit: GeoDataFrame, index: int, name=NAME, found_name=FOUND_NAME): assert isinstance(limit, GeoDataFrame) assert_names(limit, index, name, found_name) bounds = limit.geometry[index].bounds assert GEO_RECT_MIN_LON == bounds[0] assert GEO_RECT_MIN_LAT == bounds[1] assert GEO_RECT_MAX_LON == bounds[2] assert GEO_RECT_MAX_LAT == bounds[3]
def assert_geo_multiboundary(boundary: GeoDataFrame, index: int, multipolygon: GJMultipolygon, name=NAME, found_name=FOUND_NAME): assert isinstance(boundary, GeoDataFrame) assert_names(boundary, index, name, found_name) assert_geo_multipolygon(boundary.geometry[index], multipolygon)
def assert_geo_centroid(centroid: GeoDataFrame, index: int, name=NAME, found_name=FOUND_NAME, lon=CENTROID_LON, lat=CENTROID_LAT): assert isinstance(centroid, GeoDataFrame) assert_names(centroid, index, name, found_name) assert lon == centroid.geometry[index].x assert lat == centroid.geometry[index].y