Skip to main content
Question

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

  • November 16, 2019
  • 5 replies
  • 18 views

mehar
Participant
Forum|alt.badge.img+2
  • Participant
  • 8 replies

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

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.

5 replies

Forum|alt.badge.img
  • 104 replies
  • 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
Celebrity
  • 7843 replies
  • 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
  • 104 replies
  • 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).

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
Participant
Forum|alt.badge.img+2
  • Author
  • Participant
  • 8 replies
  • November 17, 2019

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
Participant
Forum|alt.badge.img+2
  • Author
  • Participant
  • 8 replies
  • November 17, 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.

thanks danullen really appreciated