-
Notifications
You must be signed in to change notification settings - Fork 1
Implement WMTS endpoints #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4a8c530
Implement WMTS endpoints
scranford1 5e0b1e5
Remove unneeded dpi constant for WMTS
scranford1 471c512
Remove duplication of code in WMTS response and request
scranford1 213505a
Make earth circumference a constant
scranford1 f8d758a
Fix abstraction for WMTS versioning
scranford1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 @@ | ||
| from .wmts_routes import WmtsRoutes | ||
|
|
||
| __all__ = ["WmtsRoutes"] |
This file contains hidden or 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,78 @@ | ||
| import pytest | ||
| import podpac | ||
| import numpy as np | ||
| import importlib | ||
| from typing import List | ||
| from ogc import settings | ||
| from unittest.mock import patch | ||
| from ogc import podpac as pogc | ||
| from ogc.wms_response_1_3_0 import Coverage | ||
|
|
||
| # Create some podpac nodes | ||
| lat = np.linspace(90, -90, 11) | ||
| lon = np.linspace(-180, 180, 21) | ||
| time = np.array(["2025-10-24T12:00:00"], dtype="datetime64") | ||
| data = np.random.default_rng(1).random((11, 21, 1)) | ||
| coords = podpac.Coordinates([lat, lon, time], dims=["lat", "lon", "time"]) | ||
| node1 = podpac.data.Array(source=data, coordinates=coords).interpolate() | ||
| node2 = podpac.data.Array(source=data, coordinates=coords).interpolate() | ||
|
|
||
| # Use podpac nodes to create some test OGC layers | ||
| layer1 = pogc.Layer( | ||
| node=node1, | ||
| identifier="layer1", | ||
| title="Layer 1", | ||
| abstract="Layer1 Data", | ||
| group="Layers", | ||
| ) | ||
|
|
||
| layer2 = pogc.Layer( | ||
| node=node2, | ||
| identifier="layer2", | ||
| title="Layer 2", | ||
| abstract="Layer2 Data", | ||
| group="Layers", | ||
| ) | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def layers() -> List[pogc.Layer]: | ||
| """List of test layers. | ||
|
|
||
| Returns | ||
| ------- | ||
| List[pogc.Layer] | ||
| The test layers. | ||
| """ | ||
| return [layer1, layer2] | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def coverages() -> List[Coverage]: | ||
| """List of coverages based on layers. | ||
|
|
||
| Returns | ||
| ------- | ||
| List[Coverage] | ||
| The test coverages. | ||
| """ | ||
| return [ | ||
| Coverage( | ||
| layer=layer, | ||
| title=layer.title, | ||
| abstract=layer.abstract, | ||
| identifier=layer.id_str, | ||
| ) | ||
| for layer in [layer1, layer2] | ||
| ] | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module", autouse=True) | ||
| def set_env_vars(): | ||
| """Setup the environmental variables for the module to support WMTS.""" | ||
| with patch.dict("os.environ", {"OGC_SUPPORTED_FORMATS": "wmts"}): | ||
| importlib.reload(settings) | ||
| yield | ||
|
|
||
| # Fix imports after patching for test | ||
| importlib.reload(settings) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.