Skip to main content
Solved

casting to integer in geojson


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.

View original
Did this help you find an answer to your question?

2 replies

david_r
Celebrity
  • 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

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings