MaxWinterstein / homeassistant-addons

GNU General Public License v3.0
129 stars 37 forks source link

ADSB multi portal feeder: inaccurate location on map #225

Open srchild opened 6 months ago

srchild commented 6 months ago

My lat/lng coordinates are correct and accurately place me on the map, with the marker on my antenna position, whether I search them on google maps, bing maps, ordnance survey or openstreetmap. On the map display in ADS-B feeder the black blob (which I assume is intended to mark my location) is shown about 900feet (275m) to the SE of my location.

The longitude displacement is about 0.001 and the latitude 0.003

The issue appears to be due to rounding. I have entered my antenna position with 4 decimal places for HTML_SITE_LAT and HTML_SITE_LON. I can reproduce the wrong position of the map marker on maps such as google/bing etc by rounding my location to only 2 decimal places.

It isn't so bad if this is just a display problem, but are these inaccurate coordinates being presented to flightaware etc?

MaxWinterstein commented 6 months ago

Tried to reproduce this, but can't.

Choose some random building in Frankfurt, Germany with google maps, right click:

Screenshot 2023-12-16 at 21 55 22

Clicked the Lat/Long, so google copied the location with a lot of digits:

image

And checked it at the addon web:

Screenshot 2023-12-16 at 22 01 33

Looks pretty good to me.

Might give me more information, like the position (feel free to add a little offset to hide your real one)?

srchild commented 6 months ago

I've tried your coordinates 50.12821245114816, 8.691949663737951 and they reproduce the problem!

lat-lng

ads-b-MF

As you see, the black dot is nowhere near the position corresponding to the coordinates. It seems to be near 50.128, 8.691

I'm running Home Assistant OS on a Raspberry Pi 4 with 4Gb.

I've also tested configured to other lat/lng and it is reproducible in other areas.

srchild commented 6 months ago

I'm using ADS-B Multi-Portal Feeder version 1.29.1 as an Add-on

srchild commented 6 months ago

I see that formatter.js does round to three decimal places. Is that relevant?

https://github.com/flightaware/dump1090/tree/master/public_html/formatter.js

lines 230-233

// p is a [lon, lat] coordinate function format_latlng(p) { return p[1].toFixed(3) + DEGREES + "," + NBSP + p[0].toFixed(3) + DEGREES; }

MaxWinterstein commented 6 months ago

I see that formatter.js does round to three decimal places. Is that relevant?

https://github.com/flightaware/dump1090/tree/master/public_html/formatter.js

lines 230-233

// p is a [lon, lat] coordinate function format_latlng(p) { return p[1].toFixed(3) + DEGREES + "," + NBSP + p[0].toFixed(3) + DEGREES; }

well, as far as i understand the code it seems to be used just for showing information about a plane: https://github.com/flightaware/dump1090/blob/e3b3fa879bceee8ab9b5ef1e40ffb21aff3a1f5c/public_html/script.js#L1419

Shown when selecting an airplane at the html site: image

Are you familiar with portainer and excecuting into a running pod?

That shows exactly what lat/long is given towards the feeders:

Screenshot 2023-12-17 at 21 32 30

srchild commented 6 months ago

I think you are correct that formatter.js is not relevant.

I'm not familiar with portainer but anyway I think the correct information is reaching flightaware etc. It seems to be just a display issue for the location of the blob indicating the device location.

But it seems very odd that it is working differently for me compared to you. I'm using the latest default version of HAOS with no tinkering with it, and the latest version of ADSB-multi-feeder, so there doesn't seem to be much scope for discrepancies in libraries etc, unless you are running on a different device to my RPi4?