Closed daviessm closed 6 years ago
Airspace data are installed via scripts/update_db.php. I don't save waypoints and airspace filter setting because they can use lot of resources, and I don't think it's needed to keep them.
Ok, despite running update_db.php every hour it hadn't created the table. I ran it manually and it did so that's solved.
However when ticking the airspace layer, nothing happens. No JS errors or anything until I zoom or move the map, at which point I get these respectively:
Uncaught ReferenceError: airspaceLayer is not defined
at e.<anonymous> (map-aircraft.2d.js.php?1507120429:109)
at e.fire (leaflet.js:5)
at e._moveEnd (leaflet.js:5)
at e.<anonymous> (leaflet.js:5)
Uncaught ReferenceError: airspaceLayer is not defined
at e.<anonymous> (map-aircraft.2d.js.php?1507120429:109)
at e.fire (leaflet.js:5)
at e._onPanTransitionEnd (leaflet.js:5)
at e.fire (leaflet.js:5)
at e._complete (leaflet.js:5)
at e._step (leaflet.js:5)
at e._animate (leaflet.js:5)
Even if I zoom out all the way the airspace layer isn't displayed. No errors before these. Browser is Chrome 61 on Windows.
I can't see anywhere in the code that creates airspaceLayer, only removes it.
You can try latest commit. Maybe this will solve the error, but I don't think so...
That did something, now I'm getting a 500 error from airspace-geojson.php?coord=-30.761718750000004,48.980216985374994,52.86621093750001,60.54377524118842
If you don't get around to it I'll debug this later.
It's better. What DB do you use MySQL ? MariaDB ? PostgreSQL ? And what version ?
MariaDB:
mysql Ver 15.1 Distrib 10.1.26-MariaDB, for Linux (armv7l) using readline 6.3
So this should have spatial support. Strange... I will make some tests with the same mariadb version.
Well this could explain it...
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes) in /var/www/planes/htdocs/FlightAirMap/require/libs/geoPHP/lib/geometry/Point.class.php on line 41
What's it doing that would take up more than 256MiB memory?
All is calculated from geometry. It's why airspace is available only when you zoom. This make lot of points. It's not the best way to do but it's the only way I find to do that :)
That makes sense. However I increased the max memory to 512MiB and it doesn't give a 500 error but returns nothing instead! I'll look at it more when I get home.
Is it calculating the points in 2D or 3D?
2D
Got it. At least in my version of PHP, line 64 of airspace-geojson.php tries to remove the 'shape' attribute of the geo objects, but doesn't because SHAPE is capitalised. If I change it to unset($properties['shape']);
the json_encode at the end of the file works. Previously it was returning an empty string.
True thanks. I lowered case of all column name and this was not modified...
Do you download the airspace DB from somewhere? It seems to be missing Irish data. No biggie though.
From soaringweb.org, But I may have make some error on import. I will look at it
Seems to be XCSoar for latest airspace version. I will update that. I opened bug #357
Initial install script doesn't install airspace data (it's commented out in install-action.php)
Selecting waypoints or airspace in the filters list on the main page doesn't save the options or refresh; on refresh they return to unchecked.
I have
$globalWaypoints = TRUE;