Skip to content

Commit 5367d2e

Browse files
authored
Merge pull request #341 from s22s/feature/scaladocs
Fleshed out details on using Scala.
2 parents 8e981c8 + a019e36 commit 5367d2e

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

pyrasterframes/src/main/python/docs/getting-started.pymd

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ If you are new to Earth-observing imagery, you might consider looking at the [Co
66

77
@@@
88

9-
There are @ref:[several ways](getting-started.md#other-options) to use RasterFrames, and @ref:[several languages](languages.md) with which you can use it.
9+
RasterFrames® is a geospatial raster processing library for @ref:[Python, Scala and SQL](languages.md), available through @ref:[several mechanisms](#other-options).
1010

1111
The simplest way to get started with RasterFrames is via the [Docker image](#using-jupyter-notebook), or from the Python shell. To get started with the Python shell you will need:
1212

@@ -107,7 +107,26 @@ SparkSession available as 'spark'.
107107

108108
Now you have the configured SparkSession with RasterFrames enabled.
109109

110-
## Installing GDAL
110+
### Scala Development
111+
112+
There is first-class support for Scala in RasterFrames. See the @ref:[Scala and SQL](languages.md) page for an example application, and the [Scala API Documentation](latest/api/index.html) for function details.
113+
114+
If you would like to use RasterFrames in Scala, you'll need to add the following resolvers and dependencies to your sbt project:
115+
116+
```scala
117+
resolvers ++= Seq(
118+
"locationtech-releases" at "https://repo.locationtech.org/content/groups/releases",
119+
"Azavea Public Builds" at "https://dl.bintray.com/azavea/geotrellis"
120+
)
121+
libraryDependencies ++= Seq(
122+
"org.locationtech.rasterframes" %% "rasterframes" % ${VERSION},
123+
"org.locationtech.rasterframes" %% "rasterframes-datasource" % ${VERSION},
124+
// This is optional. Provides access to AWS PDS catalogs.
125+
"org.locationtech.rasterframes" %% "rasterframes-experimental" % ${VERSION}
126+
)
127+
```
128+
129+
## Installing GDAL Support
111130

112131
GDAL provides a wide variety of drivers to read data from many different raster formats. If GDAL is installed in the environment, RasterFrames will be able to @ref:[read](raster-read.md) those formats. If you are using the @ref:[Jupyter Notebook image](getting-started.md#jupyter-notebook), GDAL is already installed for you. Otherwise follow the instructions below. Version 2.4.1 or greater is required.
113132

pyrasterframes/src/main/python/docs/languages.pymd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# API Languages
1+
# Scala and SQL
22

3-
One of the great powers of RasterFrames, afforded by Spark SQL, is the ability to express computation in multiple programming languages. This documentation focuses on Python because it is the most commonly used language in data science and GIS analytics. However, Scala (the implementation language of RasterFrames) and SQL are also fully supported. Examples in Python can be mechanically translated into the other two languages without much difficulty once the naming conventions are understood. In the sections below we will show the same example program in each language. We will compute the average NDVI per month for a single _tile_ in Tanzania.
3+
One of the great powers of RasterFrames is the ability to express computation in multiple programming languages. The content in this manual focuses on Python because it is the most commonly used language in data science and GIS analytics. However, Scala (the implementation language of RasterFrames) and SQL (commonly used in many domains) are also fully supported. Examples in Python can be mechanically translated into the other two languages without much difficulty once the naming conventions are understood.
4+
5+
In the sections below we will show the same example program in each language. To do so we will compute the average NDVI per month for a single _tile_ in Tanzania.
46

57
```python, imports, echo=False
68
from pyspark.sql.functions import *

0 commit comments

Comments
 (0)