Replaced HAS_SPATIAL_DB by testing database feature

Refs #22632. This should be the base for using more database
features to exclude specific backends in GIS tests.
Does this change behavior slightly in that we are only checking the default database instead of all databases in settings like `HAS_SPATIAL_DB` does? It may be fine since we use the same pattern in the rest of the tests for database features, just want to confirm. The patch looks good.