Skip to main content
Question

How to check the three decimal places?

  • November 17, 2014
  • 2 replies
  • 130 views

Hi all,

 

 

I have a gml file. I wanna check if all geometries has three decimal places.

e.g.

 

.......

<gml:LineString>

<gml:posList srsDimension="3">354378.48 5715752.931 58.379 354379.262 5715756.965 58.364</gml:posList>

</gml:LineString>

...............

 

 

I thought maybe using XMLFragmenter and then stringsearcher will help.

 

With XMLFragmenter I used "gml:posList" but do not have any idea how to extract the numbers(geometries) and check if all of them have three decimal places or not.

 

 

I appreciate your help in advance.

 

 

Best regards,

 

Mani
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

takashi
Celebrity
  • November 18, 2014
Hi Mani,

 

 

If the purpose is only to check the number of digits in decimal places, this could be possible.

 

1) Read the source GML file by the XML Reader with Feature Paths option (Elements to Match: posList).

 

2) Use an AttributeSplitter to split the "posList" value at whitespace.

 

3) Use a ListExploder to explode the list into each element (i.e. individual coordinate value).

 

4) Use a Tester to check if the coordinate value has just three digits in decimal places.

 

Left Value: <coordinate value>

 

Operator: Matches Regex

 

Right Value (regular expression example): ^-?[0-9]+\\.[0-9]{3}$

 

 

Takashi

  • Author
  • November 19, 2014
Thank you Takashi a lot. Your advice is always very helpful.

 

 

I am just wondering to know if is there any other possibility to fragment the gml file except adding it as reader?

 

Because for example when I used XMLFragmenter and I attached the result into an inspector in feature properties windows I had an attribute posList (exactly like what I have here in my feature type attributes) but not in the table attribute. Is it possible to have access to this attribute?

 

 

Thank you again

 

Mani

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