While trying to use ol/source/Vector#getFeaturesAtCoordinate to retrieve an array of coincident point features at a given coordinate I found that the lack of an override implementation of ol/geom/Geometry#containsXY always results in an empty array even when using the exact coordinate of a given feature's point geometry. What is the reasoning behind not implementing containsXY for Point, MultiPoint, LineString and MultiLineString geometries?
I can achieve my goals by providing my own override as follows, but I am wondering why such implementations are excluded, and if I should be taking a different approach to getting my desired result:
import Point from 'ol/geom/Point'
Point.prototype.containsXY = function(x, y) {
const coord = this.getCoordinates()
return coord[0] === x && coord[1] === y
}
If these implementations are worth doing I will create specific issues for each and am willing to take a run at coding them up and making the pull requests.