how to get the airport type name by it's code?

131 views
Skip to first unread message

shengyue gong

unread,
Feb 8, 2023, 11:18:42 AM2/8/23
to OpenAIP - Aviation Data Platform
I use the airport get rest api,and I get a {
    "limit": 100,
    "totalCount": 1,
    "totalPages": 1,
    "page": 1,
    "items": [
        {
            "_id": "626147ef56f327852432088f",
            "approved": true,
            "name": "SHANGHAI PUDONG INTERNATIONAL AIRPORT",
            "icaoCode": "ZSPD",
            "type": 2,
......
but how to get the name of the airport type represented by the number 2?

shengyue gong

unread,
Feb 9, 2023, 12:58:02 AM2/9/23
to OpenAIP - Aviation Data Platform
finaly,I find the result in typeEnum.js 
TypeEnum.names = {
    0: 'Airport (civil/military)',
    1: 'Glider Site',
    2: 'Airfield Civil',
    3: 'International Airport',
    4: 'Heliport Military',
    5: 'Military Aerodrome',
    6: 'Ultra Light Flying Site',
    7: 'Heliport Civil',
    8: 'Aerodrome Closed',
    9: 'Airport resp. Airfield IFR',
    10: 'Airfield Water',
    11: 'Landing Strip',
    12: 'Agricultural Landing Strip',
    13: 'Altiport',
};

openaip net

unread,
Feb 17, 2023, 1:11:02 AM2/17/23
to OpenAIP - Aviation Data Platform
For future users that have the same issue: Please find the used enums as "human-readable" readable values in the official openAIP documentation. For example, for the airport types you will find the used enums in the "Response" section of the airport GET endpoint at https://docs.openaip.net/#/Airports/get_airports__id_. Make sure to click on "schema" above the example response. See attached image for reference.
Bildschirm­foto 2023-02-17 um 07.07.00.jpg
Reply all
Reply to author
Forward
0 new messages