geofast 0.2.0__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.
- geofast/__init__.py +145 -0
- geofast/cache.py +651 -0
- geofast/cli.py +153 -0
- geofast/core.py +167 -0
- geofast/cuda_kernels.py +422 -0
- geofast/executor.py +326 -0
- geofast/formats.py +958 -0
- geofast/geo_ops.py +703 -0
- geofast/parallel.py +391 -0
- geofast/primitives.py +471 -0
- geofast/spatial_index.py +416 -0
- geofast/utils.py +229 -0
- geofast-0.2.0.dist-info/METADATA +324 -0
- geofast-0.2.0.dist-info/RECORD +18 -0
- geofast-0.2.0.dist-info/WHEEL +5 -0
- geofast-0.2.0.dist-info/entry_points.txt +2 -0
- geofast-0.2.0.dist-info/licenses/LICENSE +21 -0
- geofast-0.2.0.dist-info/top_level.txt +1 -0
geofast/__init__.py
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GeoFast - High-performance geospatial processing framework
|
|
3
|
+
Supports CPU parallel, GPU (CUDA), Numba JIT, and hybrid execution
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .core import process, Backend, GeoFastConfig, get_config, set_config
|
|
7
|
+
from .core import cpu, parallel, gpu, numba_jit, hybrid, auto # Shorthand decorators
|
|
8
|
+
from .executor import GeoFastExecutor
|
|
9
|
+
from .utils import detect_backends, get_optimal_backend, print_system_info
|
|
10
|
+
|
|
11
|
+
# Numba JIT primitives
|
|
12
|
+
from .primitives import (
|
|
13
|
+
point_in_polygon, points_in_polygon_batch,
|
|
14
|
+
haversine_scalar, haversine_batch, haversine_matrix,
|
|
15
|
+
douglas_peucker, douglas_peucker_mask,
|
|
16
|
+
lat_lon_to_hex, lat_lon_to_hex_batch, hex_to_lat_lon,
|
|
17
|
+
hex_round, hex_neighbors, line_to_hex_cells, polygon_to_hex_cells,
|
|
18
|
+
bbox_intersects, point_in_bbox, points_in_bbox_batch,
|
|
19
|
+
NUMBA_AVAILABLE
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Spatial indexing
|
|
23
|
+
from .spatial_index import (
|
|
24
|
+
SpatialIndex, HexGridIndex, PointIndex
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# GPU kernels
|
|
28
|
+
from .cuda_kernels import (
|
|
29
|
+
hex_keys_gpu, haversine_gpu, haversine_matrix_gpu,
|
|
30
|
+
hex_keys_auto, haversine_auto,
|
|
31
|
+
gpu_available, get_gpu_info,
|
|
32
|
+
NUMBA_CUDA_AVAILABLE, CUPY_AVAILABLE
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# Parallel processing with shared memory
|
|
36
|
+
from .parallel import (
|
|
37
|
+
SharedNumpyArray, SharedArrayContext, get_shared_array,
|
|
38
|
+
parallel_map, parallel_starmap, parallel_chunks, parallel_apply_shared,
|
|
39
|
+
batch_iterator, process_in_batches,
|
|
40
|
+
parallel_map_threads, parallel_io,
|
|
41
|
+
reduce_lists, reduce_sets, reduce_dicts, reduce_arrays
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Vectorized geo operations
|
|
45
|
+
from .geo_ops import (
|
|
46
|
+
simplify_geometries, buffer_geometries, points_in_polygon,
|
|
47
|
+
haversine_distances, validate_geometries, make_valid, spatial_join,
|
|
48
|
+
get_centroids, get_areas, get_lengths, get_bounds,
|
|
49
|
+
get_convex_hulls, get_envelopes,
|
|
50
|
+
intersection, union, difference, unary_union_all,
|
|
51
|
+
distance_between, intersects, contains_geom, within,
|
|
52
|
+
clip_by_rect, is_valid_batch, is_empty_batch,
|
|
53
|
+
get_coordinates, set_precision, segmentize, reverse,
|
|
54
|
+
create_points, create_linestrings, create_polygons
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# File format converters
|
|
58
|
+
from .formats import (
|
|
59
|
+
detect_format, convert, convert_batch,
|
|
60
|
+
read_geojson, write_geojson, geojson_to_features, features_to_geojson,
|
|
61
|
+
filter_features,
|
|
62
|
+
read_kml, write_kml,
|
|
63
|
+
read_gpx, write_gpx,
|
|
64
|
+
read_csv_points, write_csv_points,
|
|
65
|
+
read_mpz, MPZReader
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Caching
|
|
69
|
+
from .cache import (
|
|
70
|
+
get_cache_config, set_cache_config, cached,
|
|
71
|
+
get_memory_cache, get_disk_cache,
|
|
72
|
+
get_polygon_cell_cache, get_spatial_index_cache,
|
|
73
|
+
clear_all_caches, get_cache_stats, print_cache_stats,
|
|
74
|
+
compute_hash, make_cache_key,
|
|
75
|
+
LRUCache, DiskCache, PolygonCellCache, SpatialIndexCache
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
__version__ = "0.1.0"
|
|
79
|
+
__all__ = [
|
|
80
|
+
# Core
|
|
81
|
+
"process",
|
|
82
|
+
"Backend",
|
|
83
|
+
"GeoFastConfig",
|
|
84
|
+
"get_config",
|
|
85
|
+
"set_config",
|
|
86
|
+
# Shorthand decorators
|
|
87
|
+
"cpu",
|
|
88
|
+
"parallel",
|
|
89
|
+
"gpu",
|
|
90
|
+
"numba_jit",
|
|
91
|
+
"hybrid",
|
|
92
|
+
"auto",
|
|
93
|
+
# Executor
|
|
94
|
+
"GeoFastExecutor",
|
|
95
|
+
# Utils
|
|
96
|
+
"detect_backends",
|
|
97
|
+
"get_optimal_backend",
|
|
98
|
+
"print_system_info",
|
|
99
|
+
# Primitives
|
|
100
|
+
"point_in_polygon", "points_in_polygon_batch",
|
|
101
|
+
"haversine_scalar", "haversine_batch", "haversine_matrix",
|
|
102
|
+
"douglas_peucker", "douglas_peucker_mask",
|
|
103
|
+
"lat_lon_to_hex", "lat_lon_to_hex_batch", "hex_to_lat_lon",
|
|
104
|
+
"hex_round", "hex_neighbors", "line_to_hex_cells", "polygon_to_hex_cells",
|
|
105
|
+
"bbox_intersects", "point_in_bbox", "points_in_bbox_batch",
|
|
106
|
+
"NUMBA_AVAILABLE",
|
|
107
|
+
# Spatial indexing
|
|
108
|
+
"SpatialIndex", "HexGridIndex", "PointIndex",
|
|
109
|
+
# GPU
|
|
110
|
+
"hex_keys_gpu", "haversine_gpu", "haversine_matrix_gpu",
|
|
111
|
+
"hex_keys_auto", "haversine_auto",
|
|
112
|
+
"gpu_available", "get_gpu_info",
|
|
113
|
+
"NUMBA_CUDA_AVAILABLE", "CUPY_AVAILABLE",
|
|
114
|
+
# Parallel
|
|
115
|
+
"SharedNumpyArray", "SharedArrayContext", "get_shared_array",
|
|
116
|
+
"parallel_map", "parallel_starmap", "parallel_chunks", "parallel_apply_shared",
|
|
117
|
+
"batch_iterator", "process_in_batches",
|
|
118
|
+
"parallel_map_threads", "parallel_io",
|
|
119
|
+
"reduce_lists", "reduce_sets", "reduce_dicts", "reduce_arrays",
|
|
120
|
+
# Geo operations
|
|
121
|
+
"simplify_geometries", "buffer_geometries", "points_in_polygon",
|
|
122
|
+
"haversine_distances", "validate_geometries", "make_valid", "spatial_join",
|
|
123
|
+
"get_centroids", "get_areas", "get_lengths", "get_bounds",
|
|
124
|
+
"get_convex_hulls", "get_envelopes",
|
|
125
|
+
"intersection", "union", "difference", "unary_union_all",
|
|
126
|
+
"distance_between", "intersects", "contains_geom", "within",
|
|
127
|
+
"clip_by_rect", "is_valid_batch", "is_empty_batch",
|
|
128
|
+
"get_coordinates", "set_precision", "segmentize", "reverse",
|
|
129
|
+
"create_points", "create_linestrings", "create_polygons",
|
|
130
|
+
# File formats
|
|
131
|
+
"detect_format", "convert", "convert_batch",
|
|
132
|
+
"read_geojson", "write_geojson", "geojson_to_features", "features_to_geojson",
|
|
133
|
+
"filter_features",
|
|
134
|
+
"read_kml", "write_kml",
|
|
135
|
+
"read_gpx", "write_gpx",
|
|
136
|
+
"read_csv_points", "write_csv_points",
|
|
137
|
+
"read_mpz", "MPZReader",
|
|
138
|
+
# Caching
|
|
139
|
+
"get_cache_config", "set_cache_config", "cached",
|
|
140
|
+
"get_memory_cache", "get_disk_cache",
|
|
141
|
+
"get_polygon_cell_cache", "get_spatial_index_cache",
|
|
142
|
+
"clear_all_caches", "get_cache_stats", "print_cache_stats",
|
|
143
|
+
"compute_hash", "make_cache_key",
|
|
144
|
+
"LRUCache", "DiskCache", "PolygonCellCache", "SpatialIndexCache",
|
|
145
|
+
]
|