openforis-whisp 2.0.0b1__tar.gz → 2.0.0b3__tar.gz
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-2.0.0b1 → openforis_whisp-2.0.0b3}/PKG-INFO +1 -1
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/pyproject.toml +1 -1
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/__init__.py +2 -1
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/data_conversion.py +11 -0
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/datasets.py +207 -247
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/parameters/lookup_gee_datasets.csv +2 -5
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/risk.py +29 -29
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/stats.py +297 -47
- openforis_whisp-2.0.0b3/src/openforis_whisp/utils.py +487 -0
- openforis_whisp-2.0.0b1/src/openforis_whisp/parameters/__init__.py +0 -15
- openforis_whisp-2.0.0b1/src/openforis_whisp/utils.py +0 -194
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/LICENSE +0 -0
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/README.md +0 -0
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/logger.py +0 -0
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/parameters/config_runtime.py +0 -0
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/parameters/lookup_context_and_metadata.csv +0 -0
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/pd_schemas.py +0 -0
- {openforis_whisp-2.0.0b1 → openforis_whisp-2.0.0b3}/src/openforis_whisp/reformat.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: openforis-whisp
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.0b3
|
|
4
4
|
Summary: Whisp (What is in that plot) is an open-source solution which helps to produce relevant forest monitoring information and support compliance with deforestation-related regulations.
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: whisp,geospatial,data-processing
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "openforis-whisp"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.0b3"
|
|
8
8
|
description = "Whisp (What is in that plot) is an open-source solution which helps to produce relevant forest monitoring information and support compliance with deforestation-related regulations."
|
|
9
9
|
repository = "https://github.com/forestdatapartnership/whisp"
|
|
10
10
|
authors = ["Andy Arnell <andrew.arnell@fao.org>"]
|
|
@@ -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:
|