-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from cloudnativegeo/fix/fixes1
fix: Markdown link syntax
- Loading branch information
Showing
5 changed files
with
84 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
--- | ||
title: Our supporters | ||
--- | ||
# Our Supporters | ||
|
||
## Thank you to our supporters | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: "Make better GeoTIFFs" | ||
--- | ||
|
||
# Make better GeoTIFFs | ||
|
||
In the [COG Intro](intro.qmd) you can see what makes a COG different from non-optimized GeoTIFFs. The rest of this page details additional GeoTIFF information that can be relevant to making your files as useful as possible but not a COG requirement. | ||
|
||
## Data Type | ||
|
||
**Recommendation** The smallest possible data type, that still represents the data appropriately, should be used. It is not generally recommended to shift data from float to integer by multiplying, a space saving technique, as end users then need to undo this step to use the data. Data compression is preferred, see also [Compression](#compression). | ||
|
||
GeoTIFF format supports many data types. The key is that all bands must be of the same data type. Unlike some other formats you can not mix and match integers (whole numbers) and floats (decimal numbers) in the same file. If you have this use case consider splitting files by data type and using a catalog like STAC to keep track of them, or look at other formats like [Zarr](../zarr/intro.qmd). | ||
|
||
Scenario: If the COG is intended only for visualization, conversion to 3 band byte will improve performance. | ||
|
||
> GDAL supported Data Types [list](https://gdal.org/drivers/raster/gtiff.html#gtiff-geotiff-file-format) | ||
|
||
## Compression (aka File Size) | ||
|
||
The biggest benefit to compression is on the storage side. It’s always recommended to use a lossless compression method. **Deflate** or **LZW** are the most recommended compression algorithms, there are some choices that depend on the data type and distribution, and if the goal is maximum compression or not. Maximum compression does result in some performance loss. | ||
|
||
## No Data | ||
Setting a no data value makes it clear to users and visualization tools what pixels are not actually data. For visualization this allows these pixels to be easily hidden (transparent). Historically many values have been used, 0, -9999, etc… The key is to make sure the GDAL flag for no data is set. It is also suggested that the smallest negative value be used instead of a random value. For byte and unsigned integers/floats this will be 0, if 0 has meaning in your data use a different value (like the max possible value). Having the right nodata flag set is important for overview generation. | ||
|
||
## Projection | ||
|
||
Read performance can be greatly impacted by the choice of projection and the particular applications used for dynamic tile serving. Using a known CRS defined in the PROJ database (typically EPSG code) is preferred over custom projections. Load times can be 5-20 times greater when using a custom projection. Whenever applying projections make sure to use WKT2 representation. If using a database of known projections, i.e. EPSG codes, this should be fine, there are known issues around manually setting proj-strings. | ||
|
||
## What we don’t know (areas of research) | ||
|
||
* The optimum size of data at which splitting across files improves performance as a multi-file dataset instead of a single file. | ||
* When to recommend particular internal tile sizes | ||
* Compression impacts on http transfer rates. | ||
* Support for COG creation in all common Geospatial tools varies. | ||
|
||
## Additional Resources | ||
|
||
* [An Introduction to Cloud Optimized GeoTIFFS (COGs) Part 1: Overview](https://developers.planet.com/docs/planetschool/an-introduction-to-cloud-optimized-geotiffs-cogs-part-1-overview/) | ||
* [Do you really want people using your data?](https://medium.com/@_VincentS_/do-you-really-want-people-using-your-data-ec94cd94dc3f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,37 @@ | ||
# Cloud-Optimized GeoTIFFs | ||
--- | ||
title: "Cloud-Optimized GeoTIFFs" | ||
--- | ||
|
||
## What is a Cloud-Optimized GeoTIFF? | ||
# What is a Cloud-Optimized GeoTIFF? | ||
|
||
Cloud-Optimized GeoTIFF (the COG) is a variant of the TIFF image format that specifies a particular layout of internal data in the GeoTIFF specification to allow for optimized (subsetted or aggregated) access over a network for display or data reading. The key components are overviews, and internal tiling. | ||
Cloud-Optimized GeoTIFF (the COG), a raster format, is a variant of the TIFF image format that specifies a particular layout of internal data in the GeoTIFF specification to allow for optimized (subsetted or aggregated) access over a network for display or data reading. The key components are overviews, and internal tiling. | ||
|
||
For more details see https://www.cogeo.org/ | ||
For more details see [https://www.cogeo.org/](https://www.cogeo.org/) | ||
|
||
<img alt="COG Diagram" src="../images/cog-diagram-1.png" width=300/> | ||
|
||
### Dimensions | ||
|
||
This attribute is also sometimes called **chunks** or **internal tiles**. | ||
## Dimensions | ||
|
||
Dimensions are the number of bands, rows and columns stored in a GeoTIFF. There is a tradeoff between storing lots of data in one GeoTIFF and storing less data in many GeoTIFFs. The larger a single file, the larger the GeoTIFF header and the multiple requests may be required just to read the spatial index before data retrieval. The opposite problem occurs if you make too many small files, then it takes many reads to retrieve data, and when rendering a combined visualization can greatly impact load time. | ||
|
||
If you plan to pan and zoom a large amount of data through a tiling service in a web browser, there is a tradeoff between 1 large file, or many smaller files. The current recommendation is to meet somewhere in the middle, a moderate amount of medium files. | ||
|
||
### Internal Blocks | ||
## Internal Blocks | ||
|
||
> This attribute is also sometimes called **chunks** or **internal tiles**. | ||
Internal blocks are required if the dimensions of data are over 512x512. However you can control the size of the internal blocks. 256x256 or 512x512 are recommended. When displaying data at full resolution, or doing partial reading of data this size will impact the number of reads required. A size of 256 will take less time to read, and read less data outside the desired bounding box, however for reading large parts of a file, it may take more total read requests. Some clients will aggregate neighboring block reads to reduce the total number of requests. | ||
|
||
### Overviews | ||
## Overviews | ||
|
||
Overviews are downsampled (aggregated) data intended for visualization. | ||
The best resampling algorithm depends on the range, type, and distribution of the data. | ||
|
||
The smallest size overview should match the tiling components’ fetch size, typically 256x256. Due to aspect ratio variation just aim to have at least one dimension at or slightly less than 256. The COG driver in GDAL, or rio cogeo tools should do this. | ||
|
||
There are many resampling algorithms for generating overviews. When creating overviews several options should be compared before deciding which resampling method to apply. | ||
|
||
## How to create and validate COGs | ||
|
||
1. [Rio-cogeo: GitHub - cogeotiff/rio-cogeo: Cloud Optimized GeoTIFF creation and validation plugin for rasterio](https://github.com/cogeotiff/rio-cogeo) | ||
2. [Gdal: COG – Cloud Optimized GeoTIFF generator — GDAL documentation](https://gdal.org/drivers/raster/cog.html) | ||
|
||
|
||
## Additional Resources | ||
|
||
* [Planet Blog: An Introduction to Cloud Optimized GeoTIFFS (COGs) Part 1: Overview](https://developers.planet.com/docs/planetschool/an-introduction-to-cloud-optimized-geotiffs-cogs-part-1-overview/) | ||
* [COG Talk — Part 1: What’s new?](https://medium.com/devseed/cog-talk-part-1-whats-new-941facbcd3d1) | ||
* [Development Seed Blog: Do you really want people using your data?](https://medium.com/@_VincentS_/do-you-really-want-people-using-your-data-ec94cd94dc3f) | ||
There are many [resampling algorithms](https://gdal.org/programs/gdal_translate.html#cmdoption-gdal_translate-r) for generating overviews. When creating overviews several options should be compared before deciding which resampling method to apply. | ||
|
||
## How to visualize COGs | ||
## See more | ||
|
||
* GDAL vis* drivers (vsicurl, vsis3, vsiaz,) | ||
* Titiler https://github.com/developmentseed/titiler | ||
* Rio-viz https://github.com/developmentseed/rio-viz | ||
- Additional [GeoTIFF details](cogs-details.qmd) that can be helpful. | ||
- Making and using [COG examples](cogs-examples.ipynb). |