Skip to content
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

Added Tile Matrix Set Retrieval and Collection Tile URL Generation #34

Merged
merged 4 commits into from
May 3, 2024

Conversation

ronitjadhav
Copy link
Member

This pull request introduces three new functionalities to the OGC API endpoint:

  1. getTileMatrixSets: This method retrieves the tile matrix sets advertised by the endpoint. Tile matrix sets are a crucial part of the OGC API, as they define the grid used for map tiling.
  2. parseTileMatrixSets: This function is used to parse the tile matrix sets from the fetched document. It ensures the correct extraction and formatting of the tile matrix set data.
  3. getCollectionTileUrl: This method generates a URL for the tiles of a specified collection, with a specified tile matrix set. This allows for easy access to specific tiles within a collection.

Tests can be performed using this ogc-api (contains vector tiles): https://maps.gnosis.earth/ogcapi/

These additions enhance the library's capabilities in handling tiled map data, providing developers with more tools to interact with OGC APIs.

@ronitjadhav ronitjadhav requested a review from jahow April 18, 2024 18:46
@jahow jahow force-pushed the ogc-api-collection-tile-url branch from 1b8d133 to 0d7cd25 Compare April 23, 2024 13:00
@jahow jahow mentioned this pull request Apr 24, 2024
Added a methods to get the TileMatrixSet and genrate collection tile url

add fixtures & tests
@ronitjadhav
Copy link
Member Author

I have implemented the vectorTileCollections method.
This method returns a Promise that resolves to an array of identifiers for collections that offer vector tiles.

The method works by first checking if the endpoint offers tiles. If it does, it fetches the collections and filters them to only include those that offer vector tiles. This is determined by checking if the vectorTileFormats array in the collection info is not empty. The method then returns an array of identifiers for these collections.

Copy link
Member

@jahow jahow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It's looking really good. I made a comment about the vectorTilesCollections getter, somehow I think we have to find a simpler way to get that list.

Maybe allCollections could return more than an identifier for each, e.g. a small object containing information like "hasVectorTiles", "hasMapTiles" etc.

src/ogc-api/model.ts Outdated Show resolved Hide resolved
src/ogc-api/endpoint.ts Show resolved Hide resolved
@ronitjadhav ronitjadhav force-pushed the ogc-api-collection-tile-url branch 2 times, most recently from 761d4e4 to 16d6f18 Compare April 27, 2024 12:07
@ronitjadhav
Copy link
Member Author

ronitjadhav commented Apr 27, 2024

@jahow following your suggestion, the allCollections function now returns an object.

In this update:

  • The parseCollections function has been optimized to return an array of objects, each representing a collection. Each object contains the collection's name along with boolean flags indicating the presence of records, features, vector tiles, or map tiles, thereby facilitating enhanced functionality within allCollections.
  • Additionally, recordCollections, featureCollections, and vectorTileCollections have been revised to leverage the enhancements in parseCollections.
  • A new getter method, mapTileCollections, has been introduced to provide an array of map tile collection identifiers as strings
  • A new method getMapTilesetUrl, has been introduced which retrieves a URL to render a specified collection as map tiles, with a given tile matrix set

Copy link
Member

@jahow jahow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!! This is much better now 🙂 good work!

@ronitjadhav ronitjadhav merged commit 0a4c598 into main May 3, 2024
1 check passed
@ronitjadhav ronitjadhav deleted the ogc-api-collection-tile-url branch May 3, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants