https://github.com/developmentseed/titiler-image
TiTiler extension to work with non-geo images
https://github.com/developmentseed/titiler-image
iiif
Last synced: 4 months ago
JSON representation
TiTiler extension to work with non-geo images
- Host: GitHub
- URL: https://github.com/developmentseed/titiler-image
- Owner: developmentseed
- License: mit
- Created: 2022-12-22T12:43:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T13:45:53.000Z (over 1 year ago)
- Last Synced: 2024-07-09T08:23:35.007Z (about 1 year ago)
- Topics: iiif
- Language: Python
- Homepage:
- Size: 24.5 MB
- Stars: 18
- Watchers: 5
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
TiTiler Image.
---
**Source Code**: https://github.com/developmentseed/titiler-image
---
`TiTiler.image` is a [titiler](https://github.com/developmentseed/titiler) extension to work with non-geo images.
## Installation
To install from PyPI and run:
```bash
# Make sure to have pip up to date
python -m pip install -U pippython -m pip install titiler.image
```To install from sources and run for development:
```bash
python -m pip install -e .
```## Launch
```bash
python -m pip install uvicorn
python -m uvicorn titiler.image.main:app --reload
```### Using Docker
```bash
git clone https://github.com/developmentseed/titiler-image.git
cd titiler-pgstac
docker-compose up --build tiler
```It runs `titiler.image` using Gunicorn web server. To run Uvicorn based version:
```bash
docker-compose up --build tiler-uvicorn
```## Factories
`titiler-image` provide multiple endpoint Factories (see https://developmentseed.org/titiler/advanced/tiler_factories/)
### MetadataFactory
#### Endpoints
- `/info?url={...}`
- `/metadata?url={...}`
```python
from fastapi import FastAPI
from titiler.image.factory import MetadataFactoryapp = FastAPI()
meta = MetadataFactory()
app.include_router(meta.router)
```### IIIFFactory
Specification: https://iiif.io/api/image/3.0/
#### Endpoints
- `/{identifier}/info.json`: IIIF Image Information Request
- `/{identifier}/{region}/{size}/{rotation}/{quality}.{format}`: IIIF Image Request
- `/{identifier}`: Redirect do the Image Information Request endpoint or return a simple IIIF viewer (based on headers `Accept` value)
```python
from fastapi import FastAPI
from titiler.image.factory import IIIFFactoryapp = FastAPI()
iiif = IIIFFactory()
app.include_router(iiif.router)
```### LocalTilerFactory
#### Endpoints
- `/tilejson.json?url={...}`: TileJSON document
- `/tiles/{z}/{x}/{y}[@{scale}x.{format}]?url={...}`: Tiles endpoint
- `/viewer?url={...}`: Simple local tiles viewer
```python
from fastapi import FastAPI
from titiler.image.factory import LocalTilerFactoryapp = FastAPI()
local_tiles = LocalTilerFactory()
app.include_router(local_tiles.router)
```### GeoTilerFactory
This is a lightweight version of `titiler.core.factory.TilerFactory`.
#### Endpoints
- `[/TileMatrixSetId]/tilejson.json?url={...}`: TileJSON document
- `/tiles[/TileMatrixSetId]/{z}/{x}/{y}[@{scale}x.{format}]?url={...}`: Tiles endpoint
- `[/{TileMatrixSetId}]/map?url={...}`: Simple dataset viewer
```python
from fastapi import FastAPI
from titiler.image.factory import GeoTilerFactoryapp = FastAPI()
geo = GeoTilerFactory()
app.include_router(geo.router)
```### All together
```python
app = FastAPI()meta = MetadataFactory()
app.include_router(meta.router, tags=["Metadata"])iiif = IIIFFactory(router_prefix="/iiif")
app.include_router(iiif.router, tags=["IIIF"], prefix="/iiif")image_tiles = LocalTilerFactory(router_prefix="/image")
app.include_router(image_tiles.router, tags=["Local Tiles"], prefix="/image")geo_tiles = GeoTilerFactory(
reader=GCPSReader, reader_dependency=GCPSParams, router_prefix="/geo"
)
app.include_router(geo_tiles.router, tags=["Geo Tiles"], prefix="/geo")
```
## Contribution & Development
See [CONTRIBUTING.md](https://github.com//developmentseed/titiler-image/blob/main/CONTRIBUTING.md)
## License
See [LICENSE](https://github.com//developmentseed/titiler-image/blob/main/LICENSE)
## Authors
See [contributors](https://github.com/developmentseed/titiler-image/graphs/contributors) for a listing of individual contributors.
## Changes
See [CHANGES.md](https://github.com/developmentseed/titiler-image/blob/main/CHANGES.md).