Skip to content

Commit

Permalink
Release 0.10.0: migration to rio-tiler (#183)
Browse files Browse the repository at this point in the history
* [wip] start refactoring to rio-tiler

* Trim whitespace assets

* Bump license year

* Run black

* Fix GitHub Action syntax

* Use pre-commit

* fix flake8

* Update requirements

* deps

* comments

* Update dependencies

* Fix bounds

* [wip] Generally working

* Cleanup classes and remove remote stuff

* [wip] nearly working

* Fix Cesium basemap sources

* [wip] seemingly fully working

* Fix vmin/vmax

* [wip] more implementation

* [wip] Cleanup tiler

* Improve deps

* Tersts are passing

* Cover bahamas to COG

* Support multiple band indexes

* Update example

* Cleanup docs

* Strip out geojs

* Use leaflets new add method

* Cleanup

* Fix multiband test

* Better metadata

* Improve tests

* Linting

* remove codespell check

* Fix typing

* Type annotations

* Erg, when does 3.8 EoL?
  • Loading branch information
banesullivan authored Jan 21, 2024
1 parent 41aed45 commit fe7c7cf
Show file tree
Hide file tree
Showing 75 changed files with 2,462 additions and 4,422 deletions.
23 changes: 23 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[flake8]
exclude = .git,__pycache__,build,dist,doc/build
ignore =
# whitespace before ':'
E203,
# line break before binary operator
W503,
# line length too long
E501,
# do not assign a lambda expression, use a def
E731,
# too many leading '#' for block comment
E266,
# ambiguous variable name
E741,
# module level import not at top of file
E402,
# Quotes (temporary)
Q0,
# bare excepts (temporary)
B001, E722
# we already check black
BLK100
4 changes: 1 addition & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
- name: Install Style dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_style.txt
pip install pre-commit
- name: Run linting
run: make lint
- name: Run codespell
run: make codespell
3 changes: 2 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Docker Package
on:
workflow_dispatch:
push:
tags: "*"
tags:
- "*"
branches:
- main
pull_request:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Package Release
on:
push:
tags: "*"
tags:
- "*"
jobs:
publish:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand Down
50 changes: 50 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: check-docstring-first
- id: end-of-file-fixer
- id: mixed-line-ending

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.3
hooks:
- id: check-github-workflows


- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [
"flake8-black==0.3.6",
"flake8-isort==6.0.0",
"flake8-quotes==3.3.2",
]


# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.6
# hooks:
# - id: codespell
# args: [
# "doc examples examples_trame pyvista tests",
# "*.py *.rst *.md",
# ]
# additional_dependencies: [
# "tomli"
# ]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2022 Bane Sullivan
Copyright (c) 2021-2024 Bane Sullivan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ doctest:

lint:
@echo "Linting with flake8"
flake8 --ignore=E501 localtileserver tests
pre-commit run --all-files

format:
@echo "Formatting"
black .
isort .
pre-commit run --all-files
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ standalone web app or in your own web deployments needing dynamic tile serving.

- Launch a tile server for large geospatial images
- View local or remote* raster files with `ipyleaflet` or `folium` in Jupyter
- View rasters with CesiumJS with the built-in Flask web application
- Extract regions of interest (ROIs) interactively
- Use the example datasets to generate Digital Elevation Models
- View rasters with CesiumJS with the built-in web application

**remote raster files should be pre-tiled Cloud Optimized GeoTiffs*

Expand All @@ -48,7 +46,7 @@ client = TileClient('path/to/geo.tif')
t = get_leaflet_tile_layer(client)

m = Map(center=client.center(), zoom=client.default_zoom)
m.add_layer(t)
m.add(t)
m
```

Expand All @@ -62,13 +60,10 @@ thread which will serve raster imagery to a viewer (usually `ipyleaflet` or

This tile server can efficiently deliver varying resolutions of your
raster imagery to your viewer; it helps to have pre-tiled,
[Cloud Optimized GeoTIFFs (COGs)](https://www.cogeo.org/), but no wories if
not as the backing library, [`large_image`](https://github.com/girder/large_image),
will tile and cache for you when opening the raster.
[Cloud Optimized GeoTIFFs (COGs)](https://www.cogeo.org/).

There is an included, standalone web viewer leveraging
[CesiumJS](https://cesium.com/platform/cesiumjs/) and [GeoJS](https://opengeoscience.github.io/geojs/).
You can use the web viewer to select and extract regions of interest from rasters.
[CesiumJS](https://cesium.com/platform/cesiumjs/).


## ⬇️ Installation
Expand Down
Loading

0 comments on commit fe7c7cf

Please sign in to comment.