From 0859f899c603797e7560706291e2c07724650622 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Sun, 19 Jan 2025 21:32:09 -0500 Subject: [PATCH] Fix GeoDataFrame append error (#1031) * Fix GeoDataFrame append error * Fix localtileserver colormap issue * Pin localtileserver version --- leafmap/common.py | 3 +++ leafmap/stac.py | 7 +++---- requirements_dev.txt | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/leafmap/common.py b/leafmap/common.py index 11ef636459..054dce9d91 100644 --- a/leafmap/common.py +++ b/leafmap/common.py @@ -2962,6 +2962,9 @@ def get_local_tile_layer( if isinstance(nodata, str): nodata = float(nodata) + if isinstance(colormap, str): + colormap = colormap.lower() + if quiet: output = widgets.Output() with output: diff --git a/leafmap/stac.py b/leafmap/stac.py index 0574033d3e..9d33025594 100644 --- a/leafmap/stac.py +++ b/leafmap/stac.py @@ -2,7 +2,7 @@ import pystac import requests from typing import Optional, Dict, List, Callable, Tuple, Union -from pandas import DataFrame +import pandas as pd class TitilerEndpoint: @@ -1509,7 +1509,7 @@ def stac_search_to_gdf(search, **kwargs): return gdf -def stac_search_to_df(search, **kwargs) -> DataFrame: +def stac_search_to_df(search, **kwargs) -> pd.DataFrame: """Convert STAC search result to a DataFrame. Args: @@ -1883,7 +1883,7 @@ def maxar_all_items( if child_id == child_ids[0]: gdf = items else: - gdf = gdf.append(items) + gdf = pd.concat([gdf, items], ignore_index=True) else: if child_id == child_ids[0]: items_all = items @@ -2175,7 +2175,6 @@ def oam_search( GeoDataFrame | list: If return_gdf is True, return a GeoDataFrame. Otherwise, return a list. """ - import pandas as pd from shapely.geometry import Polygon import geopandas as gpd diff --git a/requirements_dev.txt b/requirements_dev.txt index ca6fe92278..cf1d6099da 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -17,7 +17,7 @@ h5py jupyterlab>=3.0.0 keplergl laspy -localtileserver>=0.10.1 +localtileserver>=0.10.6 lonboard mapclassify>=2.4.0 maplibre