How to add a proper Datetime attribute?

1266
2
07-27-2016 08:43 AM
LR
by
Occasional Contributor III

I created a time-enabled Layer in AGP. One Date field reads: 30.07.2016 00:00:00

When I import the layer in CE, the date is diplayed like this and seems to be a text field (can't see the data type): 30 Jul 2016 00:00:00 GMT

When I export this layer from CE and load it in AGP again, the time field is properly recognized. However when I try to create a new time attribute in CE, it's not. I tried a simple string, Unix time, as well as different formattings and arrays, but with no success. Is this even possible (manually, or preferrably with Python)?

Tags (1)
0 Kudos
2 Replies
ThomasFuchs
Esri Regular Contributor

Hello L R

as the CE help on The Inspector states:

City Engine has the following types of object attributes:

  • BOOL  : boolean
  • FLOAT : floating point value (double precision)
  • STR  : character string (UTF-16 encoded)
  • BOOL[ ]  : array of boolean values
  • FLOAT[ ] : array of floating point values
  • STR[ ]  : array of character string

The attribute type DATE is unknown to CityEngine and will be converted to STR.

I made a quick test with a GDB in ArcGIS Pro

and imported it to CityEngine 2016.0

It also showed correctly in python.

On export to GDB the dates will be mapped to their original type and show up as DATE in ArcGIS Pro again.

Please also refer the CE-Help on Esri FileGeodatabase (FileGDB) Export : Export object attributes:
Exports all object attributes as feature class fields. Information about data types and domains will be re-used, if available from an earlier FileGDB import. Array values will be ignored if the next option "Export dataset relationships" is not selected and the attribute is not part of an actual relationship.

In short: When working with GDB data types like DATE that are not natively supported in CityEngine, you have to:

  1. define the GDB attribute in ArcGIS Pro first.
  2. do a GDB import in CityEngine
  3. change the attribute according to the formatting convention
  4. on GDB export from CityEngine the attribute value will be mapped back to its original type
0 Kudos
LR
by
Occasional Contributor III

I figured I'd have to do either that or convert the field afterwards.. are more types planned for future releases?

0 Kudos