Skip to main content

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
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): ^-?p0-9]+\\.[0-9]{3}$

 

 

Takashi
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

Reply