We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently the profiles are computed for all grid cells in the bounding box of the geometry, see:
But as one can see a lot these cells may lie outside of the geometry, and do not need to be computed, see:
The text was updated successfully, but these errors were encountered:
Is this still an issue with WalkableAreas? Can you upload an example?
Sorry, something went wrong.
@schroedtert
What if we check cells within the walkable area?
def get_grid_cells( *, walkable_area: shapely.geometry.Polygon, grid_size: float ) -> Tuple[npt.NDArray[shapely.geometry.Polygon], int, int]: """Creates a list of square grid cells covering the geometry, considering only those cells whose centroids are within the walkable area.""" bounds = walkable_area.bounds min_x, min_y, max_x, max_y = bounds x_coords = np.arange(min_x, max_x + grid_size, grid_size) y_coords = np.arange(max_y, min_y - grid_size, -grid_size) grid_cells = [] for j in range(len(y_coords) - 1): for i in range(len(x_coords) - 1): grid_cell = shapely.geometry.box(x_coords[i], y_coords[j], x_coords[i + 1], y_coords[j + 1]) if walkable_area.contains(grid_cell.centroid): grid_cells.append(grid_cell) return np.array(grid_cells), len(y_coords) - 1, len(x_coords) - 1
No branches or pull requests
Currently the profiles are computed for all grid cells in the bounding box of the geometry, see:
But as one can see a lot these cells may lie outside of the geometry, and do not need to be computed, see:
The text was updated successfully, but these errors were encountered: