Pomelo.EntityFrameworkCore.MySql
Pomelo.EntityFrameworkCore.MySql copied to clipboard
Revisit and document spatial distance algorithms
We should do some performance tests with the current distance calculation implementations in regards to index usage.
We should also decide, whether the current implementation strategy is the way to move forward here, where we dynamically check the SRID and then use ST_Distance or ST_Distance_Sphere, or even "polyfill" implementations when they resort to Cartesian distance calculations instead of spherical ones when an SRID <> 0 is being used.
We should also check, whether a more precise earth radius should be used instead of the faulty one MySQL uses as the default.
We should also decide, how we want to handle SRIDs besides 4326 and 0.
At least we need to document, which version of MySQL/MariaDB uses what algorithm in their distance functions (ST_Distance and ST_Distance_Sphere).
Some references:
- ST_Distance_Sphere in mysql not giving accurate distance between two locations
- Geography in MySQL 8.0
- 12.17.12 Spatial Convenience Functions
- MySQL GIS functions strange results from ST_Distance_Sphere
- Where does the default Earth radius in ST_Distance_Sphere come from?
- Calculating distance using MySQL
- 12.17.2 Argument Handling by Spatial Functions
- 11.4.5 Spatial Reference System Support
- Calculating distance using MySQL