I have some cell sites: every cell has angle degree orientation and a range in km I fetch these cells from the db and represent them on a leaflet map with semiCircles as shown here : screenshot of my map
And I have a home address (coords) that I want to check if it is covered by (one or some) of the cells
As I couldn't find a way to check if a point(home) resides inside a semiCircle, I decided to convert my semiCircle to L.Geojson in order to use the leaflet-pip plugin
Converstion code :
let cellGeojson = {
"features": [
{
"type": "Feature",
"properties": {
"id": cell.id,
"name": cell.name,
"coords": cell.latitude + "," + cell.longitude,
"lat": cell.latitude,
"long": cell.longitude,
"location": cell.location,
"azimuth": cell.azimuth,
},
"geometry": {
"type": "Point",
"coordinates": [cell.longitude, cell.latitude]
}
}
]
}
let cellLayer = L.geoJSON(cellGeojson, {
pointToLayer: function (pointFeature, latlng) {
let rangeMarker = L.semiCircle([cell.latitude,cell.longitude], {
radius: cell.range,
startAngle: cell.angle - 30,
stopAngle: cell.angle + 30
});
return rangeMarker;
},
}).addTo(this.map)
But when I use the leafletPip.pointInLayer(home, cellLayer, [false])
it return always an empty array that means the home is not covered by any cell, I think the cause is that the semiCircle created by the pointToLayer function is just a marker and its layer is treated as a point
I've tried other leaflet plugins such as Leaflet.PointInPolygon ... but it doesn't work cuz the semiCircle is not a polygon
So I need your help to determine if the home is covered or no
and I'm sorry for the bad english