geopython / GeoHealthCheck

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

Bugfixes for Mapbox Vector Tiles #409

Closed jochemthart1 closed 2 years ago

jochemthart1 commented 2 years ago

This PR is based on the changes from PR #405 and with regards to issues #407 and #380.

Version requirement has been removed and I have tested a few version 2.x.x resources without failures. However, https://tiles.isric.org/wosis.json returns 500 errors, trying to find out if this is caused by config on their side or in the probe, see #407.

Transformation of coordinates is now done using pyproj just as with the WMTS probe.

In case the tileset.json does not contain bounds or center, there is now also the possibility for user input coorindates. These are not mandatory and if they are not available, center will be used or else, bounds. If none are available, the result is false with a message to the user to enter lat/lon coordinates in the probe.

I have tested these changes on the resources that were giving errors before and also on the resources that are on the GHC demo server. Both of these resources now also work at least with user input lat:52 and lon:5 (@justb4 probes need to be re-added after updating the code, but you probably know this already).

This process of finding center coordinates can later be changed to automatically fill in the center coordinates in the probe parameters if they are available.

justb4 commented 2 years ago

Also here: additional comment for now is: add tests.

It is not hard to add new tests. Basically you only need to add data objects (Resource, Probe Vars, Check Vars) to tests/data/fixtures.json to configure additional Probes. No Python coding required: fixtures will be loaded in DB and all Resources executed.

jochemthart1 commented 2 years ago

I think there are several cases where a dict is accessed resulting in KeyError. For example if self._parameters['lat_4326'] . Or is there a default or value False if not provided? Better to check like 'lat_4326' in dict. Other case: center_coords = tile_info['center'] though the KeyError is caught there but not for the reason assumed.

Because the parameters are always present with "" as default (str variable) I just checked with if self._parameters['lat_4326']:.

To make it more error resilient I adjusted this one and the tile_info['center'] and tile_info['bounds'] to if 'key' in dict:

I will also add some tests later today or tomorrow.

jochemthart1 commented 2 years ago

@justb4 This PR is also ready for review