openforis-whisp 2.0.0b1__py3-none-any.whl → 2.0.0b3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openforis_whisp/__init__.py +2 -1
- openforis_whisp/data_conversion.py +11 -0
- openforis_whisp/datasets.py +207 -247
- openforis_whisp/parameters/lookup_gee_datasets.csv +2 -5
- openforis_whisp/risk.py +29 -29
- openforis_whisp/stats.py +297 -47
- openforis_whisp/utils.py +298 -5
- {openforis_whisp-2.0.0b1.dist-info → openforis_whisp-2.0.0b3.dist-info}/METADATA +1 -1
- openforis_whisp-2.0.0b3.dist-info/RECORD +16 -0
- openforis_whisp/parameters/__init__.py +0 -15
- openforis_whisp-2.0.0b1.dist-info/RECORD +0 -17
- {openforis_whisp-2.0.0b1.dist-info → openforis_whisp-2.0.0b3.dist-info}/LICENSE +0 -0
- {openforis_whisp-2.0.0b1.dist-info → openforis_whisp-2.0.0b3.dist-info}/WHEEL +0 -0
openforis_whisp/__init__.py
CHANGED
|
@@ -43,6 +43,7 @@ from openforis_whisp.stats import (
|
|
|
43
43
|
whisp_formatted_stats_ee_to_geojson,
|
|
44
44
|
whisp_formatted_stats_geojson_to_df,
|
|
45
45
|
whisp_formatted_stats_geojson_to_geojson,
|
|
46
|
+
set_point_geometry_area_to_zero,
|
|
46
47
|
convert_iso3_to_iso2,
|
|
47
48
|
)
|
|
48
49
|
|
|
@@ -71,4 +72,4 @@ from openforis_whisp.data_conversion import (
|
|
|
71
72
|
|
|
72
73
|
from openforis_whisp.risk import whisp_risk, detect_unit_type
|
|
73
74
|
|
|
74
|
-
from openforis_whisp.utils import get_example_data_path
|
|
75
|
+
from openforis_whisp.utils import get_example_data_path, generate_test_polygons
|
|
@@ -42,6 +42,17 @@ def convert_geojson_to_ee(
|
|
|
42
42
|
# Use GeoPandas to read the file and handle CRS
|
|
43
43
|
gdf = gpd.read_file(file_path)
|
|
44
44
|
|
|
45
|
+
# NEW: Handle problematic data types before JSON conversion
|
|
46
|
+
for col in gdf.columns:
|
|
47
|
+
if col != gdf.geometry.name: # Skip geometry column
|
|
48
|
+
# Handle datetime/timestamp columns
|
|
49
|
+
if pd.api.types.is_datetime64_any_dtype(gdf[col]):
|
|
50
|
+
gdf[col] = gdf[col].dt.strftime("%Y-%m-%d %H:%M:%S").fillna("")
|
|
51
|
+
# Handle other problematic types
|
|
52
|
+
elif gdf[col].dtype == "object":
|
|
53
|
+
# Convert any remaining non-serializable objects to strings
|
|
54
|
+
gdf[col] = gdf[col].astype(str)
|
|
55
|
+
|
|
45
56
|
# Check and convert CRS if needed
|
|
46
57
|
if enforce_wgs84:
|
|
47
58
|
if gdf.crs is None:
|