1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 affine,
11 cachetools,
12 numpy,
13 pyproj,
14 shapely,
15
16 # optional-dependencies
17 azure-storage-blob,
18 boto3,
19 dask,
20 distributed,
21 rasterio,
22 tifffile,
23 xarray,
24
25 # tests
26 geopandas,
27 matplotlib,
28 pytestCheckHook,
29}:
30
31buildPythonPackage rec {
32 pname = "odc-geo";
33 version = "0.4.10";
34 pyproject = true;
35
36 src = fetchFromGitHub {
37 owner = "opendatacube";
38 repo = "odc-geo";
39 tag = "v${version}";
40 hash = "sha256-f4wUUzcv4NM44zrCvW3sBRybppIBZEAm+oiTSW1B+Fw=";
41 };
42
43 build-system = [
44 setuptools
45 ];
46
47 dependencies = [
48 affine
49 cachetools
50 numpy
51 pyproj
52 shapely
53 ];
54
55 optional-dependencies = {
56 xr = [ xarray ];
57 wrap = [ rasterio ];
58 tiff = [
59 dask
60 distributed
61 rasterio
62 tifffile
63 xarray
64 ];
65 s3 = [ boto3 ];
66 az = [ azure-storage-blob ];
67 all = [
68 azure-storage-blob
69 boto3
70 dask
71 distributed
72 rasterio
73 tifffile
74 xarray
75 ];
76 };
77
78 nativeCheckInputs = [
79 geopandas
80 matplotlib
81 pytestCheckHook
82 ]
83 ++ optional-dependencies.all;
84
85 disabledTestMarks = [ "network" ];
86
87 disabledTests = [
88 # AttributeError (fixes: https://github.com/opendatacube/odc-geo/pull/202)
89 "test_azure_multipart_upload"
90 # network access
91 "test_empty_cog"
92 # urllib url open error
93 "test_country_geom"
94 "test_from_geopandas"
95 "test_geoboxtiles_intersect"
96 "test_warp_nan"
97 # requires imagecodecs package (currently not available on nixpkgs)
98 "test_cog_with_dask_smoke_test"
99 ];
100
101 pythonImportsCheck = [
102 "odc.geo"
103 "odc.geo.xr"
104 ];
105
106 meta = {
107 description = "GeoBox and geometry utilities extracted from datacube-core";
108 longDescription = ''
109 This library combines geometry shape classes from `shapely` with CRS from
110 `pyproj` to provide a number of data types and utilities useful for working
111 with geospatial metadata and geo-registered `xarray` rasters.
112 '';
113 homepage = "https://github.com/opendatacube/odc-geo/";
114 changelog = "https://github.com/opendatacube/odc-geo/tag/${src.tag}";
115 license = lib.licenses.asl20;
116 maintainers = with lib.maintainers; [ daspk04 ];
117 };
118}