Navigation API
Re: Navigation API
I just spent an hour listing out all the issues in detail and then the forum decided I needed to log in again and I lost everything i was just about to post.
To summarise what i was going to post.
Some database fields are swapped around. The wrong data is in the wrong field.
The ICAO query is not working.
A specific query caused a CTD. Sorry can't remeber which one. I did so many while testing.
Some but not all queries do not return all the stated fields.
I'll go through it again when i can.
To summarise what i was going to post.
Some database fields are swapped around. The wrong data is in the wrong field.
The ICAO query is not working.
A specific query caused a CTD. Sorry can't remeber which one. I did so many while testing.
Some but not all queries do not return all the stated fields.
I'll go through it again when i can.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Navigation API
Did a fresh installation of both AM and the plug-in, restart the sim and voila! It works finally! Got the database built!
Some opinions if I may:
1. Multiple query criteria e.g. NAME + TYPE or AIRPORT + RUNWAY
- Currently if I need to fetch a runway I will need to apply API twice, first get airport and airport ID and then use airport ID and name to get runway. The X Plane API XPLMFindNavAid on the other hand offers quit decent search function by accepting multiple search entries. Unfortunately it doesn’t accept runway queries. Am I missing anything?
2. Any chance to include the function reposition aircraft as well? Hopefully just a simple bridging to the XP API XPLMPlaceUserAtLocation
Some opinions if I may:
1. Multiple query criteria e.g. NAME + TYPE or AIRPORT + RUNWAY
- Currently if I need to fetch a runway I will need to apply API twice, first get airport and airport ID and then use airport ID and name to get runway. The X Plane API XPLMFindNavAid on the other hand offers quit decent search function by accepting multiple search entries. Unfortunately it doesn’t accept runway queries. Am I missing anything?
2. Any chance to include the function reposition aircraft as well? Hopefully just a simple bridging to the XP API XPLMPlaceUserAtLocation
Re: Navigation API
The whole idea behind this and one of the reasons it’s taken so long in coming is it’s platform independent. Meaning it doesn’t use the Xplane database or the SDK function to query.freedom wrote: ↑Sun Jan 31, 2021 3:23 am Did a fresh installation of both AM and the plug-in, restart the sim and voila! It works finally! Got the database built!
Some opinions if I may:
1. Multiple query criteria e.g. NAME + TYPE or AIRPORT + RUNWAY
- Currently if I need to fetch a runway I will need to apply API twice, first get airport and airport ID and then use airport ID and name to get runway. The X Plane API XPLMFindNavAid on the other hand offers quit decent search function by accepting multiple search entries. Unfortunately it doesn’t accept runway queries. Am I missing anything?
2. Any chance to include the function reposition aircraft as well? Hopefully just a simple bridging to the XP API XPLMPlaceUserAtLocation
On the first point about combining queries. The guys can answer for sure but it’s probably better to do 2 smaller queries than a larger more complex one. I don’t think it’s a big deal to split it like they have. If you want the extra info you just query again. The airport and runways are separate tables. I suppose they could have a function that gets it all in one but it’s quite simple to write your own function that also does the same.
Just my thoughts.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Navigation API
I am surprised to know the nav functions are actually independent of the XP API. I originally thought that’s just a bridging service like what has been happening with those scripts in FlyWithLua.
If it takes too much effort then for sure it can be left to the users to filter the queries. I just think it is convenient to do it in one pass.
Freedom
If it takes too much effort then for sure it can be left to the users to filter the queries. I just think it is convenient to do it in one pass.
Freedom
Re: Navigation API
It has to be otherwise how is it going to work for all the other sims. Sure if it’s xplane only then you would surely use the built in database and associated query functions.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Navigation API
I think this is going to be good in the long run but here's the more detailed list of snags for now.
The number of airports in the db is low (14k vs xplane 35K+).
Using the "ICAO" property returns no results.
A RUNWAY query does not return the SURFACE field.
This COMMUNICATION query causes a CTD. nav_get("COMMUNICATION", "AIRPORT_ID", 13380, callback).
A WAYPOINT query does not return the AIRPORT_ID field.
A VHF_NAVAID query does not return all of the db fields. TYPE, RANGE_POWER, ADDITIONAL_INFO, DECLINATION and RANGE are missing. The last 2 are perhaps because the db fields are empty but the others have data in them.
“COLLOCATED” is a rarely used spelling and should really be changed to “CO_LOCATED”. The returned data uses “COLLOCATION”. So they all need to match.
The NDB db has frequency data in the longitude field and no longitude data.
The number of airports in the db is low (14k vs xplane 35K+).
Using the "ICAO" property returns no results.
A RUNWAY query does not return the SURFACE field.
This COMMUNICATION query causes a CTD. nav_get("COMMUNICATION", "AIRPORT_ID", 13380, callback).
A WAYPOINT query does not return the AIRPORT_ID field.
A VHF_NAVAID query does not return all of the db fields. TYPE, RANGE_POWER, ADDITIONAL_INFO, DECLINATION and RANGE are missing. The last 2 are perhaps because the db fields are empty but the others have data in them.
“COLLOCATED” is a rarely used spelling and should really be changed to “CO_LOCATED”. The returned data uses “COLLOCATION”. So they all need to match.
The NDB db has frequency data in the longitude field and no longitude data.
Last edited by Sling on Sun Jan 31, 2021 9:46 am, edited 1 time in total.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Navigation API
Agree. The current API is yet to complete. Better work on it till it stabilizes.
Also the API description seems to be wrong for nav_get.
"IDENTIFIER" is not recognized
Also the API description seems to be wrong for nav_get.
Code: Select all
-- We are looking for ENTO airport
nav_item = nav_get("AIRPORT", "IDENTIFIER", "ENTO", data_callback)
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Navigation API
Hi
Airport "SIZE" field is missing.
Keith
Airport "SIZE" field is missing.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Navigation API
Insert current lat/long (22.0,114.0)
Outputs somewhere in Africa
INFO - ID=1 name:TAKORADI lon:-1.77470833 lat:4.89598611 elev:22.0
If change the variables into numbers i.e.
nav_get_nearest("AIRPORT", 22.0, 114.0, 10, data_callback)
then the result is correct
Code: Select all
function initialize_values(lat,long)
latitude=lat; longitude =long
end
xpl_dataref_subscribe( "sim/flightmodel/position/latitude","DOUBLE", "sim/flightmodel/position/longitude","DOUBLE", initialize_values)
local function data_callback(airports)
if airports ~= nil then
-- Print the found airports to log
for i=1, #airports do
print("ID=" .. i .. " name:" .. airports[i]["NAME"] .. " lon:" .. airports[i]["LONGITUDE"] .. " lat:" .. airports[i]["LATITUDE"])
end
else
print("Error while querying nav data")
end
end
-- Find the nearest 10 Airports from a certain latitude and longitude
nav_get_nearest("AIRPORT", latitude, longitude, 10, data_callback)
INFO - ID=1 name:TAKORADI lon:-1.77470833 lat:4.89598611 elev:22.0
If change the variables into numbers i.e.
nav_get_nearest("AIRPORT", 22.0, 114.0, 10, data_callback)
then the result is correct
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Navigation API
Hi
You have not got the lat and lon switched??
Mine works perfectly.
Just need the Airport size to change the airport Icon.
Keith
You have not got the lat and lon switched??
Mine works perfectly.
Just need the Airport size to change the airport Icon.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card