Skip to content

Commit 9d536b9

Browse files
committed
Added catalog overview. Edits to GeoTiff tutorial.
1 parent 131e22a commit 9d536b9

File tree

8 files changed

+44
-15
lines changed

8 files changed

+44
-15
lines changed

overviews/datatypes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ layout: overviews
33
title: Raster Data Types and Data Conversions
44

55
tutorial: overviews
6-
num: 3
7-
outof: 6
6+
num: 4
87
---
98

109
#### Data Types

overviews/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ title: Introduction
44

55
tutorial: overviews
66
num: 1
7-
outof: 9
7+
outof: 7
88
---
99
The overviews section contains guides to specific parts of GeoTrellis

overviews/parallel.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: Parallel and Distributed Execution
44

55
tutorial: overviews
66
num: 6
7-
outof: 6
87
---
98

109
## Parallel and distributed execution

overviews/rendering.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ layout: overviews
33
title: Rendering Images
44

55
tutorial: overviews
6-
num: 4
7-
outof: 6
6+
num: 5
87
---
98

109
#### Rendering Images from a Raster

overviews/thecatalog.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: overviews
3+
title: The Catalog
4+
5+
tutorial: overviews
6+
num: 2
7+
---
8+
9+
{
10+
"catalog": "Catalog of Test Data",
11+
"stores": [
12+
{
13+
"store": "test:fs",
14+
"params": {
15+
"type": "fs",
16+
"path": "src/test/resources/data",
17+
"cacheAll": "no"
18+
}
19+
}
20+
]
21+
}
22+
23+
GeoTrellis needs to know where to find data in order to perform it's magic. One way you can tell GeoTrellis where to find rasters is to use the [io.LoadFile operation](http://geotrellis.github.io/scaladocs/0.8/#geotrellis.io.LoadFile). Another way is to create a .json file called a *catalog*. This file tells the GeoTrellis system how to find Rasters that are referred to by name. The raster's name is declared in the [.json metadata file for the ARG as the 'layer' attribute](https://github.com/geotrellis/geotrellis/blob/0.8.1/src/test/resources/sbn/SBN_co_phila.json#L7). Any arg file that is contained in a Data Store declared by the catalog is available to be loaded by GeoTrellis through the [io.LoadRaster](http://geotrellis.github.io/scaladocs/0.8/#geotrellis.io.LoadRaster) operation.
24+
25+
#### Why use a Catalog?
26+
27+
Using the Raster's name to load it into GeoTrellis allows for flexibility in the file storage of your raster data. Code that can run on one set of data can be moved to work with another set, just by changing where the catalog is pointing. Also, using a simple name to refer to raster layers allows for REST calls to include the layer name in query parameters. This lets the client be able to easily declare what server side data to operate on. If you're making a web map that has multiple raster layers, you can dynamically make calls out to GeoTrellis on any one or all the layers by passing through the name of the rasters. For an example of this, see the [admin tool's WMS call](https://github.com/geotrellis/geotrellis/blob/0.8.1/server/src/main/scala/geotrellis/admin/services/Layer.scala#L44).
28+
29+

overviews/tiledrasters.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ layout: overviews
33
title: Tiled Rasters
44

55
tutorial: overviews
6-
num: 6
7-
outof: 6
6+
num: 7
87
---
98

109
To understand the importance of tiled rasters in GeoTrellis, it's helpful

overviews/vector.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: overviews
33
title: Vector Operations
44

55
tutorial: overviews
6-
num: 2
6+
num: 3
77
outof: 6
88
---
99

tutorials/geotiff.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,34 @@ The first thing we're going to do is download one of the archives and see what i
1616

1717
#### Converting to ARG format
1818

19-
To be able to work with Rasters in GeoTrellis, they need to be in the [ARG file format](https://github.com/geotrellis/geotrellis/wiki/ARG-Specification). The way we can do this is using the gt-tool script. You can download the gt-tool script from the [GeoTrellis scripts folder](https://raw.github.com/geotrellis/geotrellis/master/scripts/gt-tool), or in the root folder of the code for this tutorial. We can convert our GeoTIFF to an ARG using the geotiff_convert subcommand:
19+
To be able to work with Rasters in GeoTrellis, they need to be in the [ARG file format](https://github.com/geotrellis/geotrellis/wiki/ARG-Specification). The way we can do this is using the gt-tool script. You can download the gt-tool script from the [GeoTrellis scripts folder](https://raw.github.com/geotrellis/geotrellis/master/scripts/gt-tool), or you can use the one in the root folder of the code for this tutorial. We can convert our GeoTIFF to an ARG using the geotiff_convert subcommand:
2020

2121
gt-tool geotiff_convert -i ned10m39075h2.tif -o philly_ned.arg -n philly_ned
2222

23-
This will produce two files: the philly_ned.arg data file and philly_ned.json metadata file. We need to drop this in a folder that is stated in our GeoTrellis catalog. In the code for this tutorial, the catalog is located in the ```data``` folder, and points to the ```data/ned```, which does not exist in the repository initially. Create that folder and drop the ARG files in.
23+
This will produce two files: the philly_ned.arg data file and philly_ned.json metadata file.
24+
25+
#### Telling GeoTrellis about the Raster
26+
27+
To perform operations on this Raster using GeoTrellis, we need to let GeoTrellis know about the .arg and .json file that we just created. To do that, we drop the files into a folder that is declared in our [GeoTrellis catalog]( {{ site.base }}/overviews/thecatalog.html). In the code for this tutorial, the catalog is located in the ```data``` folder, and points to the ```data/ned```, which does not exist in the repository initially. We need to create that folder and move the ARG files (both the .arg and .json) into it.
2428

2529
#### First Viewing
2630

2731
Run the GeoTrellis server by running the ```./sbt run``` command in the root directory of the code project. You'll then be able to go to http://localhost:8880/admin to see the Philadelphia NED data using the GeoTrellis admin tool. You should see something like this:
2832

2933
<img src="/images/tutorials/geotiff-preproj.png" style="width: 600px;"></img>
3034

31-
You might be able to recognize the shape of Philadelphia, but the raster is clearly in the wrong spot. This is because the GeoTrellis admin tool displays the rasters in the Web Mercator (ESPG:3857) projection. If the raster is not in this projection, you will still be able to see the raster, but it won't be placed correctly. However, if we want to view the raster properly on the map, we can use GDAL to reproject the raster into Web Mercator.
35+
You might be able to recognize the shape of Philadelphia, but the raster is clearly in the wrong spot. This is because the GeoTrellis admin tool displays the rasters in the Web Mercator (ESPG:3857) projection. If the raster is not in this projection, you will still be able to see the raster, but it won't be placed correctly. If we want to view the raster properly on the map, we can use GDAL to reproject the raster into Web Mercator.
3236

33-
#### Reprojecting with gdal_warp
37+
#### Reprojecting with gdal warp
3438

3539
This step requires that you have [GDAL](http://www.gdal.org/) installed. For a script to build and install gdal on Ubuntu, see [this gist](https://gist.github.com/lossyrob/4348503).
3640

37-
To reproject the original GeoTIFF raster, we run the gdal_warp on our raster:
41+
To reproject the original GeoTIFF raster, we run the gdalwarp on our raster:
3842

3943
gdalwarp -t_srs EPSG:3857 ned10m39075h2.tif wm-ned10m39075h2.tif
4044

4145
This will reproject the raster to the proper projection. We can now use gt-tool to convert the GeoTIFF into ARG format, and view it through GeoTrellis on the proper part of the map.
4246

4347
#### Getting more data
4448

45-
Included in the codebase is a python script that will download all the data available for Pennsylvania NED data. Running it will populate the catalog with a set of rasters that gives the elevation of various points in PA. It simply downloads the archive, reprojects the GeoTIFF file, and converts it to an ARG file.
49+
Included in the codebase is a python script that will download all the data available for Pennsylvania NED data. Running the script will populate the catalog with a set of rasters that represent the elevation of all points in PA. It simply downloads the archive, reprojects the GeoTIFF file, and converts it to an ARG file for each tile, as we did with the one above.

0 commit comments

Comments
 (0)