How to import JSON into ArcGIS Pro with datetime properties?

726
3
03-04-2020 07:48 AM
AndreasHolterman
New Contributor III

Good day,

Via the JSON To Features tool in ArcGIS Pro (version 2.5.0), I can import a .JSON file. Its format is based on the GeoJSON format described here: https://geojson.org/geojson-spec.html

Importing works correctly for most part, but ArcGIS Pro does not recognizes a datetime format. I tried it as a datetime format and also with timestamp() or isoformat(). Neither of these options result in the correct way. The datetime format gives an error when importing the file, the other two options result in a Field Type of Long Integer or Double instead of Date, when you check the Data Type of the particular field in the Attribute Table.

Is there a way to add a date in the properties of a feature in a JSON, and import it in ArcGIS Pro with recognizing that property as a Date Type? Is it also possible to do this directly into ArcGIS Online?

Thank you!

0 Kudos
3 Replies
BruceHarold
Esri Regular Contributor

Andreas, Data Interoperability extension will be able to do this for you, if you can share a sample file I can provide an ETL tool source for Pro 2.5/FME 2019.

0 Kudos
AndreasHolterman
New Contributor III

Thank you Bruce. With the Data Interoperability extension, I ended up with multiple errors, so clearly I am doing something wrong there.

Below I have an example of my json file with a single feature that has a DateStart and DateEnd in its properties, both in isoformat(). Looking forward to your solution.

{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"geometry":{
"type":"LineString",
"coordinates":[
[
4.882968545975606,
52.29634137093137
],
[
4.881542853722186,
52.29658708716925
],
[
4.88014973322635,
52.29671842967587
],
[
4.878669981113818,
52.296904955183386
],
[
4.877233024191733,
52.29709001994841
],
[
4.8757635706510625,
52.297295383098664
],
[
4.874432216343373,
52.29754608638658
],
[
4.873038640810869,
52.29785678574871
],
[
4.871599150723431,
52.29810638483495
],
[
4.870205615404385,
52.29839148061371
],
[
4.868889872763475,
52.29869834599177
],
[
4.867450845414482,
52.299034404814044
],
[
4.8661522461864095,
52.29933752226991
],
[
4.864746241974371,
52.29966685398816
],
[
4.8634325188495895,
52.29997504285232
],
[
4.862099801977044,
52.30028610780678
]
]
},
"properties":{
"No.":1.0,
"Jaar":2020.0,
"WK":3.0,
"Dag":"Wednesday",
"Discipline":"Delivery",
"Status":"Uitgevoerd",
"Maatregelno.":547414.0,
"Fase":"nan",
"Omschrijving werkzaamheden":"Bomen zagen",
"Vakno.":"C",
"Weg":"A9",
"Kant":"HRR",
"Werkruimte":"26,100 - 27,650",
"CROW":"210.0",
"Tekst-wagen":1.0,
"Aantal rijstroken":3.0,
"Rijstroken":"R3, R4, VL",
"DateStart":"2020-01-15T10:00:00",
"DateEnd":"2020-01-15T13:00:00",
"VS":"nan",
"Bijzonderheden":"Incl. 1x TW t.b.v. rijstrookindeling"
}
}
]
}
0 Kudos
BruceHarold
Esri Regular Contributor

Here you are, you will want to refine the schema but the datetime data is correctly handled.