Get Pending_airports data from JSON or API call

456
2
05-27-2022 01:39 PM
JAARSSoftwareDevelopment
New Contributor

I have a local database of airports, runways, navaids, and fixes that I would like to keep in sync.  I have initially populated tables with this data from CSV files and now I want to check if there are any new objects or if any of them have been updated.  It looks like this is a description of the airport interface but I don't know how to get the data I need.  I was able to run a query and get this for output https://services6.arcgis.com/ssFJjBXIUyZDrSYZ/arcgis/rest/services/US_Airport/FeatureServer/0/query?... and saved it as a file but it would not import as a database table.  It looks like there is a section at the beginning that describes the data fields and what type they are. The fields I need are airport identifier (ex: clt), elevation, longitude and latitude degrees, minutes and seconds.  

Maybe I am not even looking in the right place.  If so, I would appreciate some direction and maybe sample code.

Tags (2)
0 Kudos
2 Replies
Raul_Jimenez
Esri Contributor

Hi @JAARSSoftwareDevelopment ,

You are right, the "fields" property describes the columns of that table, apparently there is no "clt" field:

Screenshot 2022-05-31 at 08.12.14.png

You can also check the layer description like this: https://services6.arcgis.com/ssFJjBXIUyZDrSYZ/arcgis/rest/services/US_Airport/FeatureServer/0?f=json

This is how it looks:

2022-05-31_08-06-46.png 2022-05-31_08-08-00.png

The first image is the response in .../FeatureServer/0/query?.... The second one is from .../FeatureServer/0?f=json.

As you can see in the developer site, the "type" field can be:

esriFieldTypeBlob | esriFieldTypeDate | esriFieldTypeDouble | esriFieldTypeGeometry | esriFieldTypeGlobalID | esriFieldTypeGUID | esriFieldTypeInteger | esriFieldTypeOID | esriFieldTypeRaster | esriFieldTypeSingle | esriFieldTypeSmallInteger | esriFieldTypeString | esriFieldTypeXML.

Where: OID = Object ID; GUID = Global Unique IDentifier, ... more about ArcGIS field data types.

Related to this comment:

I want to check if there are any new objects or if any of them have been updated

You have two options:

I hope this helps. 

0 Kudos
JAARSSoftwareDevelopment
New Contributor

Raul,

Thanks so much for taking the time to reply.  After a lot of research it looks like the data I want like airport, runways, navaids and fixes are hosted on arcgis by the FAA.  I do not plan on hosting anything there but want to pull down the data.  Do you know how I could find out if there are webhooks for these?

The solution I am thinking of is a lot more work than a webhook.  I will loop through my list of airports in the database and call the URL that returns JSON to get a list of airports.  I will then compare this list with my database list and archive any that are no longer in the list and add any that are new.  The problem I see is the URL has a limit of 1000 and the list of airports is 13260.  I will go through the airports that start with a and keep calling the URL.  If there is an easier way I would love to hear it.

0 Kudos