-
-
Notifications
You must be signed in to change notification settings - Fork 306
Add auto_webmercator to COG
#1893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
05d8465
4108e8b
55a5ee1
df8c954
209224f
a212c37
17d0528
aaed0d1
bfe18cc
3a4a946
c5e4b9a
7981a38
40b5ee3
c8010ec
32dab67
1bab765
f571457
dbc603a
e79b088
0f2ee38
02f425a
1ecd40a
8a9d551
acd389e
cf6ac10
843c016
8292dde
3cbd185
73b8b7c
f5da83c
78c2a99
73331e1
c9a071f
0cd936f
b48a52b
92baf2a
a348677
0145c8e
04c4eb1
7d7ac8a
326fcd8
17308ab
6aad230
fa372c6
0b1cb8c
bf8f726
b6039a7
ada9be0
0833a42
ccba0ee
a348df2
d4b0f83
5f194bb
51270d4
8e35aa1
1f04451
f4ad640
a8e716a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,44 +17,38 @@ Martin can also serve raster sources like local [COG(Cloud Optimized GeoTIFF)](h | |||||
| * Deflate | ||||||
| * PackBits | ||||||
|
|
||||||
| ## Run Martin with CLI to serve cog files | ||||||
| ## Supported Projection | ||||||
|
|
||||||
| ```bash | ||||||
| # Configured with a directory containing `*.tif` or `*.tiff` TIFF files. | ||||||
| martin /with/tiff/dir1 /with/tiff/dir2 | ||||||
| # Configured with dedicated TIFF file | ||||||
| martin /path/to/target1.tif /path/to/target2.tiff | ||||||
| # Configured with a combination of directories and dedicated TIFF files. | ||||||
| martin /with/tiff/files /path/to/target1.tif /path/to/target2.tiff | ||||||
|
Comment on lines
-23
to
-28
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enable auto-web in CLI Next PR. |
||||||
| ``` | ||||||
| Currently we only support COGS with [EPSG:3857](https://epsg.io/3857) by enable the `auto-web` option. | ||||||
|
|
||||||
| ## Run Martin with configuration file | ||||||
| It's beacause the [Tile Matrix Set](https://docs.ogc.org/is/17-083r2/17-083r2.html#72) inside each COG file is highly customized for its extent and tilesize. It's not aligned | ||||||
| with any well knowed TIle Matrix Set. | ||||||
sharkAndshark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ```yml | ||||||
| keep_alive: 75 | ||||||
| To load COG file, there are two approaches generally: | ||||||
|
|
||||||
| # The socket address to bind [default: 0.0.0.0:3000] | ||||||
| listen_addresses: '0.0.0.0:3000' | ||||||
| 1. The client(`Maplibre`, `OpenLayers`,etc) load COG file with the specific customized [Tile Matrix Set](https://docs.ogc.org/is/17-083r2/17-083r2.html#72). | ||||||
| To not break the compatibility with the [TileJson spec](https://github.com/mapbox/tilejson-spec), the `/catalog` seems a good choice to add the customized TMS info (Other data sources could benefit from this if we want to support other projections either, [Join our discussion there](https://github.com/maplibre/martin/issues/343)) | ||||||
|
|
||||||
| # Number of web server workers | ||||||
| worker_processes: 8 | ||||||
| 2. Martin serve COG files with well known [Tile Matrix Set](https://docs.ogc.org/is/17-083r2/17-083r2.html#72) and do the clipping internally. | ||||||
| Currently, we support [WebMercatorQuad](https://docs.ogc.org/is/17-083r2/17-083r2.html#72) if `auto-web: true` is configured. | ||||||
|
|
||||||
| # Amount of memory (in MB) to use for caching tiles [default: 512, 0 to disable] | ||||||
| cache_size_mb: 8 | ||||||
|
|
||||||
| # Database configuration. This can also be a list of PG configs. | ||||||
| ## Configuration file | ||||||
|
|
||||||
| ```yml | ||||||
| cog: | ||||||
| paths: | ||||||
| # scan this whole dir, matching all *.tif and *.tiff files | ||||||
| - /dir-path | ||||||
| # specific TIFF file will be published as a cog source | ||||||
| - /path/to/target1.tif | ||||||
| - /path/to/target2.tiff | ||||||
| # Default false | ||||||
| # If enabled: | ||||||
| # Serve COG with WebMercatorQuad | ||||||
| # Note: Just work for COG files with EPSG:3857 | ||||||
| auto_web: false | ||||||
| sources: | ||||||
| # named source matching source name to a single file | ||||||
| cog-src1: /path/to/cog1.tif | ||||||
| cog-src2: /path/to/cog2.tif | ||||||
| cog-src2: tests/fixtures/cog/rgb_u8.tif | ||||||
| cog-src1: tests/fixtures/cog/rgba_u8.tif | ||||||
| # Test COG with auto_webmercator enabled | ||||||
| cog-auto-web: | ||||||
| path: tests/fixtures/cog/rgba_u8_nodata.tiff | ||||||
| # inline option. Would override the global dauto_web. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| auto_web: true | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 do we actually need this? This is also motivated by |
||||||
| ``` | ||||||
|
|
||||||
| ## About COG | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I remember these two need to be marked as "please always optimise these at O3" as otherwise debug builds handling images are.. painfull.