Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/VIDA-NYU/tile2net
Browse files Browse the repository at this point in the history
  • Loading branch information
Mary-h86 committed Dec 6, 2023
2 parents 0a6f1f1 + 0d577f6 commit 6d54c12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ src/*.ipynb
.idea
**/tileseg/config.py
src/*.py
src/tile2net/logger.py



Expand Down
3 changes: 2 additions & 1 deletion src/tile2net/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
logging.config.fileConfig
)
# todo: when release, set to USER
logger = logging.getLogger('debug')
# logger = logging.getLogger('debug')
logger = logging.getLogger('user')

# class TqdmLoggingHandler(logging.Handler):
# def __init__(self, level=logging.NOTSET):
Expand Down
3 changes: 3 additions & 0 deletions src/tile2net/raster/tile_utils/geodata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ def unary_multi(gdf: GeoDataFrame) -> GeoDataFrame:
# handles the errors with multipolygon
loc = ~gdf.is_valid.values
# logger.warning(f'Number of invalid geometries: {loc.sum()} out of {len(gdf)}')
count = loc.sum()
if count:
logger.warning(f'Number of invalid geometries: {count} out of {len(gdf)}')
gdf.geometry.loc[loc] = shapely.make_valid(gdf.geometry.loc[loc])
result = (
gdf
Expand Down

0 comments on commit 6d54c12

Please sign in to comment.