Skip to main content
Question

how to calulate the digits in column of x and y utm coordinates before the decimal point


mehar
Forum|alt.badge.img

i need to extract the coordinate which are wrong and does not make sense like easting in utm should be 6 digits .because i have some coordinates in x column for example (easting = 7 digits 3628623.384 ) which is wrong it should be 6 digits. is there any way i can calculate the digits in coodinates column before the decimal point

5 replies

Forum|alt.badge.img
  • November 16, 2019

Use a SubstringExtractor to pull out the digits before the decimal point:

 

Start index: 0

 

End index: @FindString(@Value(x-coord),.)-1

 

x-coord is your x attribute, . is what you're looking for and -1 to get the position one step to the left of the decimal point.

Then use a Tester to check that the resulting string isn't too long:

 

@Evaluate(@StringLength(@Value(_substring))) < 7

 

_substring is the string you just pulled out with the SubstringExtractor.

takashi
Evangelist
  • November 16, 2019

You can use the Tester to test if the value is less than 1000000 (i.e. the minimum value of 7 digits).


Forum|alt.badge.img
  • November 16, 2019
takashi wrote:

You can use the Tester to test if the value is less than 1000000 (i.e. the minimum value of 7 digits).

Doh. Sometimes the answer is just too obvious. :-) In my defense, I'm busy at work with the same maneuver but with character strings, so that's where my head is at the moment.


mehar
Forum|alt.badge.img
  • Author
  • November 17, 2019
takashi wrote:

You can use the Tester to test if the value is less than 1000000 (i.e. the minimum value of 7 digits).

thanks takashi


mehar
Forum|alt.badge.img
  • Author
  • November 17, 2019
danullen wrote:

Use a SubstringExtractor to pull out the digits before the decimal point:

 

Start index: 0

 

End index: @FindString(@Value(x-coord),.)-1

 

x-coord is your x attribute, . is what you're looking for and -1 to get the position one step to the left of the decimal point.

Then use a Tester to check that the resulting string isn't too long:

 

@Evaluate(@StringLength(@Value(_substring))) < 7

 

_substring is the string you just pulled out with the SubstringExtractor.

thanks danullen really appreciated


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