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: docs/src/main/paradox/release-notes.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
### 0.9.1
6
6
7
7
* Upgraded to Spark 2.4.7
8
-
* Added `pyspark.sql.DataFrame.display(num_rows, truncate)` extension method when `rf_ipython` is imported.
8
+
* Added `pyspark.sql.DataFrame.display(num_rows:int, truncate:bool)` extension method when `rf_ipython` is imported.
9
9
* Added users' manual section on IPython display enhancements.
10
10
* Added `method_name` parameter to the `rf_resample` method.
11
11
*__BREAKING__: In SQL, the function `rf_resample` now takes 3 arguments. You can use `rf_resample_nearest` with two arguments or refactor to `rf_resample(t, v, "nearest")`.
Copy file name to clipboardExpand all lines: pyrasterframes/src/main/python/docs/ipython.pymd
+64-40Lines changed: 64 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -4,67 +4,91 @@ The `pyrasterframes.rf_ipython` module injects a number of visualization extensi
4
4
5
5
By default, the last expression's result in a IPython cell is passed to the `IPython.display.display` function. This function in turn looks for a [`DisplayFormatter`](https://ipython.readthedocs.io/en/stable/api/generated/IPython.core.formatters.html#IPython.core.formatters.DisplayFormatter) associated with the type, which in turn converts the instance to a display-appropriate representation, based on MIME type. For example, each `DisplayFormatter` may `plain/text` version for the IPython shell, and a `text/html` version for a Jupyter Notebook.
6
6
7
-
```python imports, echo=False, results='hidden'
8
-
from pyrasterframes.all import *
9
-
from pyspark.sql.functions import col
7
+
This will be our setup for the following examples:
8
+
9
+
```python setup
10
+
from pyrasterframes import *
11
+
from pyrasterframes.rasterfunctions import *
12
+
from pyrasterframes.utils import create_rf_spark_session
We have some convenience methods to quickly visualize tiles (see discussion of the RasterFrame @ref:[schema](raster-read.md#single-raster) for orientation to the concept) when inspecting a subset of the data in a Notebook.
16
27
17
-
```python raster_read
18
-
uri = 'https://modis-pds.s3.amazonaws.com/MCD43A4.006/31/11/2017158/' \
Within an IPython or Jupyter interpreter, a Spark and Pandas DataFrames containing a column of _tiles_ will be rendered as the samples discussed above. Simply import the `rf_ipython` submodule to enable enhanced HTML rendering of these DataFrame types.
38
+
39
+
```python display_samples
40
+
rf # or `display(rf)`, or `rf.display()`
33
41
```
34
42
35
-
# Tile Display
43
+
### Changing Number of Rows
36
44
37
-
Let's look at a single tile. A `pyrasterframes.rf_types.Tile` will automatically render nicely in Jupyter or IPython.
45
+
By default the RasterFrame sample display renders 5 rows. Because the `IPython.display.display` function doesn't pass parameters to the underlying rendering functions, we have to provide a different means of passing parameters to the rendering code. Pandas approach to this is to use global settings via `set_option`/`get_option`. We take a more functional approach and have the user invoke an explicit `display` method:
Because the `IPython.display.display` function doesn't accept any parameters, we have to provide a different means of passing parameters to the rendering code. Pandas does it with global settings via `set_option`/`get_option`. We take a more functional approach and have the user invoke an explicit `display` method:
65
+
## Sample Colorization
55
66
56
-
```python custom_display
57
-
df.display(num_rows=1, truncate=True)
58
-
```
67
+
RasterFrames uses the "Viridis" color ramp as the default color profile for tile column. There are other options for reasoning about how color should be applied in the results.
59
68
69
+
### Color Composite
60
70
61
-
## pandas.DataFrame Display
71
+
As shown in @ref:[Writing Raster Data section](raster-write.md) section, composites can be constructed for visualization:
62
72
63
-
The same thing works for Pandas DataFrame if it contains a column of `Tile`s.
73
+
```python, png_color_composite
74
+
from IPython.display import Image # For telling IPython how to interpret the PNG byte array
You can also apply a different color ramp to a single-channel Tile using the @ref[`rf_render_color_ramp_png`](reference.md#rf-render-color-ramp-png) function. See the function documentation for information about the available color maps.
Copy file name to clipboardExpand all lines: pyrasterframes/src/main/python/docs/raster-read.pymd
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,11 @@ In the initial examples on this page, you may have noticed that the realized (no
287
287
288
288
## Spatial Indexing and Partitioning
289
289
290
+
@@@ warning
291
+
This is an experimental feature, and may be removed.
292
+
@@@
293
+
294
+
290
295
It's often desirable to take extra steps in ensuring your data is effectively distributed over your computing resources. One way of doing that is using something called a ["space filling curve"](https://en.wikipedia.org/wiki/Space-filling_curve), which turns an N-dimensional value into a one dimensional value, with properties that favor keeping entities near each other in N-space near each other in index space. In particular RasterFrames support space-filling curves mapping the geographic location of _tiles_ to a one-dimensional index space called [`xz2`](https://www.geomesa.org/documentation/user/datastores/index_overview.html). To have RasterFrames add a spatial index based partitioning on a raster reads, use the `spatial_index_partitions` parameter. By default it will use the same number of partitions as configured in [`spark.sql.shuffle.partitions`](https://spark.apache.org/docs/latest/sql-performance-tuning.html#other-configuration-options).
0 commit comments