Skip to content

Commit

Permalink
Removing old code
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalLike committed Jan 8, 2024
1 parent 328f899 commit 8893c2c
Showing 1 changed file with 0 additions and 95 deletions.
95 changes: 0 additions & 95 deletions pygeoapi/provider/base_mvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,101 +216,6 @@ def get_metadata(self, dataset, server_url, layer=None,
else:
raise NotImplementedError(f"_{metadata_format.upper()}_ is not supported") # noqa

# def get_metadata(self, dataset, server_url, layer=None,
# tileset=None, metadata_format=None, title=None,
# description=None, keywords=None, **kwargs):
# """
# Gets tile metadata
#
# :param dataset: dataset name
# :param server_url: server base url
# :param layer: mvt tile layer name
# :param tileset: mvt tileset name
# :param metadata_format: format for metadata,
# enum TilesMetadataFormat
#
# :returns: `dict` of JSON metadata
# """
#
# if is_url(self.data):
# url = urlparse(self.data)
# base_url = f'{url.scheme}://{url.netloc}'
# if metadata_format == TilesMetadataFormat.TILEJSON:
# with requests.Session() as session:
# session.get(base_url)
# resp = session.get(f'{base_url}/{layer}/metadata.htmljson') # noqa
# resp.raise_for_status()
# metadata_json_content = resp.json()
# else:
# if not isinstance(self.service_metadata_url, Path):
# msg = f'Wrong data path configuration: {self.service_metadata_url}' # noqa
# LOGGER.error(msg)
# raise ProviderConnectionError(msg)
#
# if self.service_metadata_url.exists():
# with open(self.service_metadata_url, 'r') as md_file:
# metadata_json_content = json.loads(md_file.read())
#
# service_url = url_join(
# server_url,
# f'collections/{dataset}/tiles/{tileset}/{{tileMatrix}}/{{tileRow}}/{{tileCol}}?f=mvt') # noqa
#
# content = {}
# if metadata_format == TilesMetadataFormat.TILEJSON:
# if 'metadata_json_content' in locals():
# content = MVTTilesJson(**metadata_json_content)
# content.tiles = service_url
# content.vector_layers = json.loads(
# metadata_json_content["json"])["vector_layers"]
# return content.dict()
# else:
# msg = f'No tiles metadata json available: {self.service_metadata_url}' # noqa
# LOGGER.error(msg)
# raise ProviderConnectionError(msg)
# elif metadata_format == TilesMetadataFormat.CUSTOMJSON:
# if 'metadata_json_content' in locals():
# content = metadata_json_content
# if 'json' in metadata_json_content:
# content['json'] = json.loads(metadata_json_content['json']) # noqa
# return content
# else:
# msg = f'No custom JSON for tiles metadata available: {self.service_metadata_url}' # noqa
# LOGGER.error(msg)
# raise ProviderConnectionError(msg)
# else:
# tiling_schemes = self.get_tiling_schemes()
# # Default values
# tileMatrixSetURI = tiling_schemes[0].tileMatrixSetURI
# crs = tiling_schemes[0].crs
# # Checking the selected matrix in configured tiling_schemes
# for schema in tiling_schemes:
# if (schema.tileMatrixSet == tileset):
# crs = schema.crs
# tileMatrixSetURI = schema.tileMatrixSetURI
#
# content = TileSetMetadata(title=title, description=description,
# keywords=keywords, crs=crs,
# tileMatrixSetURI=tileMatrixSetURI)
#
# links = []
# service_url_link_type = "application/vnd.mapbox-vector-tile"
# service_url_link_title = f'{tileset} vector tiles for {layer}'
# service_url_link = LinkType(href=service_url, rel="item",
# type=service_url_link_type,
# title=service_url_link_title)
# links.append(service_url_link)
#
# content.links = links
#
# if 'metadata_json_content' in locals():
# vector_layers = json.loads(
# metadata_json_content["json"])["vector_layers"]
# layers = []
# for vector_layer in vector_layers:
# layers.append(GeospatialDataType(id=vector_layer['id']))
# content.layers = layers
# return content.dict(exclude_none=True)

def get_tms_links(self):
"""
Generates TileMatrixSet Links
Expand Down

0 comments on commit 8893c2c

Please sign in to comment.