Select to view content in your preferred language

Controlling Field Data Types When Creating a Feature Service From a GeoJSON

161
0
08-27-2024 11:04 AM
mikeytes
Emerging Contributor

This question is in regards to both using the ArcGIS Portal GUI and the ArcGIS API for Python.

I'm able to create a hosted feature service from a GeoJSON, but I'm unable to create esriFieldTypeDate fields. All date formats in the geojson properties lead to esriFieldTypeString field types. I don't have this issue when publishing from a csv.

I understand that I can delete the fields and add new ones in. But it would help our workflow to immediately declare the field type.

Here's what I do programmatically...

layer.manager.delete_from_definition({
"fields": [{"name": "created_at"}]
})

layer.manager.add_to_definition({
"fields": [{
"name": "created_at",
"type": "esriFieldTypeDate",
"alias": "Created At"]

Just wondering if this is a bug when working with geojsons or if I'm not formatting my dates correctly.

0 Kudos
0 Replies