Skip to main content
Solved

casting to integer in geojson

  • May 11, 2018
  • 2 replies
  • 50 views

Forum|alt.badge.img

Is there any reason that FME would not cast a value to an integer using xs:int(value)?

i keep getting:

"xs:string": invalid value for cast/constructor: can not cast to "xs:int"

the incoming value is a 12 digit number from a GML file with type: xml_int64

i try it without the cast and the JSONTemplator works but it comes out as a string when i need it as an integer.

Best answer by david_r

Try using "xs:integer" rather than "xs:int".

The difference is that 

xs:int
 is a signed 32-bit integer, while 
xs:integer
 is an unbounded integer value. 

Twelve digits exceeds the 32-bit integer range: 2147483647 to -2147483648.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • Best Answer
  • May 11, 2018

Try using "xs:integer" rather than "xs:int".

The difference is that 

xs:int
 is a signed 32-bit integer, while 
xs:integer
 is an unbounded integer value. 

Twelve digits exceeds the 32-bit integer range: 2147483647 to -2147483648.


Forum|alt.badge.img
  • Author
  • 30 replies
  • May 11, 2018

Thank you, didn't realise there were two different ones.