def get_sampling_geometry(self, tile_info): tile_geometry = Geometry(tile_info['geometry'], crs=self.area_of_interest.crs) utm_crs = ShOgcSampling.get_crs(tile_info) tile_geometry = tile_geometry.transform(utm_crs) utm_aoi_geometry = self.area_of_interest.transform(utm_crs) # Warning: This intersection can be too small for sampling, that is why __next__ method is retrying the process return Geometry( tile_geometry.geometry.intersection(utm_aoi_geometry.geometry), utm_crs)
def plot_batch_splitter(splitter: BatchSplitter): """ Plots tiles and area geometry from a splitter class """ gdf = gpd.GeoDataFrame(dict( status=[info['status'] for info in splitter.get_info_list()], geometry=splitter.get_bbox_list()), crs=CRS.WGS84.pyproj_crs()) ax = gdf.plot(column='status', legend=True, figsize=(10, 10)) geometry = Geometry(splitter.get_area_shape(), splitter.crs) geometry = geometry.transform(CRS.WGS84) area_series = gpd.GeoSeries([geometry.geometry], crs=geometry.crs.pyproj_crs()) area_series.plot(ax=ax, facecolor='none', edgecolor='black')