Skip to content
New issue

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

Check geom_coverage and print a message if None #1695

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cartoframes/data/observatory/catalog/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from shapely import wkb

from ....utils.utils import check_package
from ....utils.logger import log


def variable_describe(data):
Expand Down Expand Up @@ -101,10 +102,13 @@ def geom_coverage(geography_id):
from ....viz import Map, Layer

geography = Geography.get(geography_id)
geom_coverage = wkb.loads(geography.geom_coverage, hex=True)
geom_coverage_gdf = gpd.GeoDataFrame({'geometry': [geom_coverage]}, geometry='geometry')

return Map(Layer(geom_coverage_gdf))
if geography.geom_coverage:
geom_coverage = wkb.loads(geography.geom_coverage, hex=True)
geom_coverage_gdf = gpd.GeoDataFrame({'geometry': [geom_coverage]}, geometry='geometry')
return Map(Layer(geom_coverage_gdf))
else:
log.info('Geometry coverage not available')


def histogram(data):
Expand Down