ssb-sgis 1.1.0__tar.gz → 1.1.2__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.
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/PKG-INFO +1 -1
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/pyproject.toml +1 -1
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/__init__.py +2 -5
- ssb_sgis-1.1.2/src/sgis/conf.py +72 -0
- ssb_sgis-1.1.2/src/sgis/geopandas_tools/cleaning.py +740 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/duplicates.py +17 -3
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/helpers.py +22 -0
- ssb_sgis-1.1.2/src/sgis/io/__init__.py +6 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/io/dapla_functions.py +415 -74
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/explore.py +23 -5
- ssb_sgis-1.1.0/src/sgis/geopandas_tools/cleaning.py +0 -1734
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/LICENSE +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/README.md +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/debug_config.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/exceptions.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/__init__.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/bounds.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/buffer_dissolve_explode.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/centerlines.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/conversion.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/general.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/geocoding.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/geometry_types.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/neighbors.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/overlay.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/point_operations.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/polygon_operations.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/polygons_as_rings.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/geopandas_tools/sfilter.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/io/_is_dapla.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/io/opener.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/io/read_parquet.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/__init__.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/examine.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/httpserver.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/legend.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/map.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/maps.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/norge_i_bilder.json +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/thematicmap.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/tilesources.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/maps/wms.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/__init__.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/_get_route.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/_od_cost_matrix.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/_points.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/_service_area.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/closing_network_holes.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/cutting_lines.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/directednetwork.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/finding_isolated_networks.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/network.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/networkanalysis.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/networkanalysisrules.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/nodes.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/networkanalysis/traveling_salesman.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/parallel/parallel.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/py.typed +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/raster/__init__.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/raster/base.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/raster/image_collection.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/raster/indices.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/raster/regex.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/raster/sentinel_config.py +0 -0
- {ssb_sgis-1.1.0 → ssb_sgis-1.1.2}/src/sgis/raster/zonal.py +0 -0
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
config = {
|
|
2
|
-
"n_jobs": 1,
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
|
|
6
1
|
import sgis.raster.indices as indices
|
|
7
2
|
|
|
3
|
+
from .conf import config
|
|
8
4
|
from .geopandas_tools.bounds import Gridlooper
|
|
9
5
|
from .geopandas_tools.bounds import bounds_to_points
|
|
10
6
|
from .geopandas_tools.bounds import bounds_to_polygon
|
|
@@ -89,6 +85,7 @@ from .io.opener import opener
|
|
|
89
85
|
from .io.read_parquet import read_parquet_url
|
|
90
86
|
from .maps.examine import Examine
|
|
91
87
|
from .maps.explore import Explore
|
|
88
|
+
from .maps.explore import HtmlViewer
|
|
92
89
|
from .maps.httpserver import run_html_server
|
|
93
90
|
from .maps.legend import Legend
|
|
94
91
|
from .maps.maps import clipmap
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
try:
|
|
2
|
+
from gcsfs import GCSFileSystem
|
|
3
|
+
|
|
4
|
+
file_system = GCSFileSystem
|
|
5
|
+
except ImportError:
|
|
6
|
+
import datetime
|
|
7
|
+
import glob
|
|
8
|
+
import io
|
|
9
|
+
import os
|
|
10
|
+
import pathlib
|
|
11
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
class LocalFileSystem:
|
|
15
|
+
"""Mimicks GCS's FileSystem but using standard library (os, glob)."""
|
|
16
|
+
|
|
17
|
+
@staticmethod
|
|
18
|
+
def glob(
|
|
19
|
+
path: str,
|
|
20
|
+
detail: bool = False,
|
|
21
|
+
recursive: bool = True,
|
|
22
|
+
include_hidden: bool = True,
|
|
23
|
+
**kwargs,
|
|
24
|
+
) -> list[dict] | list[str]:
|
|
25
|
+
"""Like GCSFileSystem.glob."""
|
|
26
|
+
relevant_paths = glob.iglob(
|
|
27
|
+
path, recursive=recursive, include_hidden=include_hidden, **kwargs
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if not detail:
|
|
31
|
+
return list(relevant_paths)
|
|
32
|
+
with ThreadPoolExecutor() as executor:
|
|
33
|
+
return list(executor.map(get_file_info, relevant_paths))
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def ls(
|
|
37
|
+
cls, path: str, detail: bool = False, **kwargs
|
|
38
|
+
) -> list[dict] | list[str]:
|
|
39
|
+
"""Like GCSFileSystem.ls."""
|
|
40
|
+
return cls().glob(
|
|
41
|
+
str(pathlib.Path(path) / "**"), detail=detail, recursive=False, **kwargs
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
@staticmethod
|
|
45
|
+
def info(path) -> dict[str, Any]:
|
|
46
|
+
"""Like GCSFileSystem.info."""
|
|
47
|
+
return get_file_info(path)
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def open(path: str, *args, **kwargs) -> io.TextIOWrapper:
|
|
51
|
+
"""Built in open."""
|
|
52
|
+
return open(path, *args, **kwargs)
|
|
53
|
+
|
|
54
|
+
@staticmethod
|
|
55
|
+
def exists(path: str) -> bool:
|
|
56
|
+
"""os.path.exists."""
|
|
57
|
+
return os.path.exists(path)
|
|
58
|
+
|
|
59
|
+
def get_file_info(path) -> dict[str, str | float]:
|
|
60
|
+
return {
|
|
61
|
+
"updated": datetime.datetime.fromtimestamp(os.path.getmtime(path)),
|
|
62
|
+
"size": os.path.getsize(path),
|
|
63
|
+
"name": path,
|
|
64
|
+
"type": "directory" if os.path.isdir(path) else "file",
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
file_system = LocalFileSystem
|
|
68
|
+
|
|
69
|
+
config = {
|
|
70
|
+
"n_jobs": 1,
|
|
71
|
+
"file_system": file_system,
|
|
72
|
+
}
|