You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/index.rst
+146Lines changed: 146 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,149 @@ geodynamix
11
11
12
12
reference/index
13
13
14
+
Introduction
15
+
____________
16
+
Geodynamix is a Rust library with Python bindings that can be used for geospatial data processing.
17
+
18
+
It's main goal is to make working with raster data more ergonomic.
19
+
The main difference to other libraries like ``numpy`` in combination with ``rasterio`` is that it is designed to make calculations with rasters without having to worry about the nodata value.
20
+
All operations are nodata aware and handle nodata values in a way that makes sense for raster data.
21
+
22
+
IO support
23
+
----------
24
+
Geodynamix supports reading and writing raster data. It uses the ``gdal`` library for reading and writing raster data so it supports all the formats that ``gdal`` supports (See the `gdal drivers <https://gdal.org/en/stable/drivers/raster/index.html>`_ list).
25
+
26
+
.. code-block:: python
27
+
:caption: Reading and writing raster data
28
+
29
+
import geodynamix as gdx
30
+
31
+
raster = gdx.read("path/to/raster.tif")
32
+
gdx.write("path/to/output.tif", raster)
33
+
34
+
The data type of the internal raster will match the data type of the input raster. If a different data type is desired, it can be specified with the ``dtype`` parameter using the ``read_as`` function. The numpy data types are supported to specify the desired data type.
35
+
36
+
.. code-block:: python
37
+
:caption: Reading raster data with data type conversion
Geodynamix support all the basic raster operations like addition, subtraction, multiplication and division.
48
+
49
+
.. code-block:: python
50
+
:caption: Basic raster operations
51
+
52
+
import geodynamix as gdx
53
+
54
+
raster1 = gdx.read("path/to/raster1.tif")
55
+
raster2 = gdx.read("path/to/raster2.tif")
56
+
result = raster1 + raster2
57
+
58
+
If ``raster1`` or ``raster2`` have a nodata value, the ``result`` will also have a nodata value at the same location.
59
+
In all of the examples ``#`` represents the nodata value.
60
+
61
+
.. grid:: 5
62
+
:gutter: 2
63
+
:class-container: custom-grid
64
+
65
+
.. grid-item::
66
+
67
+
.. table:: raster1
68
+
69
+
= = =
70
+
# 1 2
71
+
3 # 5
72
+
6 7 #
73
+
= = =
74
+
75
+
.. grid-item::
76
+
:child-align: center
77
+
78
+
.. math::
79
+
80
+
\Large\textbf{+}
81
+
82
+
83
+
.. grid-item::
84
+
85
+
.. table:: raster2
86
+
87
+
= = =
88
+
8 7 #
89
+
5 # 3
90
+
# 1 0
91
+
= = =
92
+
93
+
.. grid-item::
94
+
:child-align: center
95
+
96
+
.. math::
97
+
98
+
\Large\textbf{=}
99
+
100
+
.. grid-item::
101
+
102
+
.. table:: result
103
+
104
+
= = =
105
+
# 8 #
106
+
8 # 8
107
+
# 8 #
108
+
= = =
109
+
110
+
Multiplication and subtraction behave in the same way. Division is a bit different, it also behaves the same as the other operations except division by zero alsp becomes a nodata value.
0 commit comments