Skip to content

Commit

Permalink
WMS prototype working (#572)
Browse files Browse the repository at this point in the history
* WMS prototype working

* refactor and add parameters in openapi

* enable multiple layers

* Update src/titiler/core/titiler/core/factory.py

* add tests

* Update src/titiler/extensions/titiler/extensions/wms.py

* add a test for empty CRS

* add xml templates in package

Co-authored-by: Mindless-bureaucrat <taped@DESKTOP-HRCT9N0.localdomain>
Co-authored-by: vincentsarago <vincent.sarago@gmail.com>
3 people authored Jan 26, 2023
1 parent d7ec0c7 commit 9a4931d
Showing 13 changed files with 1,146 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

## 0.11.0 (TBD)

* add `titiler.extensions` package
* add `titiler.extensions` package (`cogValidateExtension`, `stacExtension`, `cogViewerExtension`, `stacViewerExtension`, `wmsExtension`)

### titiler.mosaic

1 change: 1 addition & 0 deletions src/titiler/core/titiler/core/factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""TiTiler Router factories."""

import abc
from dataclasses import dataclass, field
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Type, Union
1 change: 1 addition & 0 deletions src/titiler/extensions/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
recursive-exclude tests *
include titiler/extensions/templates/*.html
include titiler/extensions/templates/*.xml
4 changes: 3 additions & 1 deletion src/titiler/extensions/setup.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,9 @@
url="https://github.com/developmentseed/titiler",
license="MIT",
packages=find_namespace_packages(exclude=["tests*"]),
package_data={"titiler": ["extensions/templates/*.html"]},
package_data={
"titiler": ["extensions/templates/*.html", "extensions/templates/*.xml"]
},
include_package_data=True,
zip_safe=False,
install_requires=inst_reqs,
10 changes: 10 additions & 0 deletions src/titiler/extensions/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""``pytest`` configuration."""

from typing import Any, Dict

import pytest
from rasterio.io import MemoryFile


@pytest.fixture
@@ -12,3 +15,10 @@ def set_env(monkeypatch):
monkeypatch.setenv("AWS_REGION", "us-west-2")
monkeypatch.delenv("AWS_PROFILE", raising=False)
monkeypatch.setenv("AWS_CONFIG_FILE", "/tmp/noconfigheere")


def parse_img(content: bytes) -> Dict[Any, Any]:
"""Read tile image and return metadata."""
with MemoryFile(content) as mem:
with mem.open() as dst:
return {**dst.profile, "bounds": list(dst.bounds)}
Binary file added src/titiler/extensions/tests/fixtures/cog1.tif
Binary file not shown.
Binary file added src/titiler/extensions/tests/fixtures/cog2.tif
Binary file not shown.
Loading

0 comments on commit 9a4931d

Please sign in to comment.