geopython / GeoHealthCheck

Service Status and QoS Checker for OGC Web Services
https://geohealthcheck.org
MIT License
84 stars 71 forks source link

Mapbox TileJSON Probe - for issue #380 #405

Closed jochemthart1 closed 2 years ago

jochemthart1 commented 2 years ago

This PR adds a probe for Mapbox Vector tile service based on issue #380.

The tileset.json is requested and checked for http-errors.

Design: From the tileset.json, center coordinate and zoom levels are taken to be used in tile requests later on. If center coordinate doesn't exist, the bounds are used to calculate center coordinate. If bounds do not exist either, result is returned as false.

Then, multiple tile url's are constructed using the tile zoom level and center coordinate and are requested and checked for http-errors as well.

An additional check for http204 errors is implemented when requesting tile data, because a request on coordinates with no data would return an empty page.

jochemthart1 commented 2 years ago

Automatic checks are failing because of this resource: https://geodata.nationaalgeoregister.nl/bag/wms/v1_1

However, it is working on my local version of GHC

justb4 commented 2 years ago

Automatic checks are failing because of this resource: https://geodata.nationaalgeoregister.nl/bag/wms/v1_1

However, it is working on my local version of GHC

Yes, I've seen. See more often. Anyway: merged! Thanks @jochemthart1 !

justb4 commented 2 years ago

I am trying https://geodata.nationaalgeoregister.nl/beta/topotiles-viewer/styles/tilejson.json on GHC demo, but this fails. It advertises v2.2.0. Or is there another root URL to be used?

jochemthart1 commented 2 years ago

@justb4 I see. In the design I went with getting the center of the map from the center attribute in the tilejson or from calculating the center from the bounds attribute. However, this endpoint does not seem to have either.

Not sure how I could determine the center tile for this endpoint. Do you have any suggestions?

I might have to add an exception clause there to make sure the error is more clear when this happens.

justb4 commented 2 years ago

@jochemthart1 I am not so familiar with the TileJSON standard. Found another endpoint from Mapbox, also 2.2.0 with bounds but also fails on GHC demo with another reason: https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json. Error Perform_request Err: UnboundLocalError local variable 'wm_coords' referenced before assignment. Not sure what happens. You may consider using pyproj (included in GHC) for coordinate transformation.

bounds and center are both optional in the 2.2.0 TileJSON spec. Well, I should say bad luck then, or assume global bounds, but then other failures may arise.