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

Moved expensive calc to where it will be needed #924

Merged
merged 1 commit into from
Jun 27, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ def get_valid_tiles_df(self, facets_df):
& ~facets_df['facet_value'].str.startswith(NULL_ISLAND_TILE_ROOT, na=False)
)
tiles_df = facets_df[valid_index].copy()
return tiles_df


def _distance_determine_aggregation_depth(self, tiles_df):
"""Uses distance between to recalibrate aggregation depth in tiles"""
if len(tiles_df.index) < 2:
return self.default_aggregation_depth

tiles_df['lon_lat'] = tiles_df['facet_value'].apply(
get_tile_lon_lat_coordinates
)
Expand All @@ -92,13 +100,6 @@ def get_valid_tiles_df(self, facets_df):
columns=['lon_lat'],
inplace=True
)
return tiles_df


def _distance_determine_aggregation_depth(self, tiles_df):
"""Uses distance between to recalibrate aggregation depth in tiles"""
if len(tiles_df.index) < 2:
return self.default_aggregation_depth

gm = GlobalMercator()
max_distance = gm.distance_on_unit_sphere(
Expand Down