Question

test coordinate system between 2 feature class


Badge
Hello, 

 

 

I am trying to compare corrdinate system between 2 feature class . If corrdinate system is different then I want to terminate the process 

 

 

In this below workflow my tester always gets failed even when both feature class are in same coordinate system . 

 

 

Can anyoone point out what am I doing wrong . 

 

 

 


8 replies

Badge
Hi Vikram,

 

 

You are testing a feature at a time by itself and it has no reference to the coordinatesytem of the other feature. One feature comes from the first featuretype and there is nothing to link it to the second featuretype.

 

 

Also, in this workspace you would test ever feature. I would suggest you test one feature from each rather than every single feature.
Userlevel 4
Hi,

 

 

before the Tester, route all features into an AttributeCreator setup like this:

 

 

 

 

You can now check if _prev_coordsys = _coordsys and route accordingly.

 

 

David
Badge +3
Hi,

 

 

 

Best to combine both answers.

 

First use only one feature per featuretype by using a sampler. (nu need to test all features within the same featuretype)

 

Then feed them to the workspace you posted but insert Davids suggestion before the tester.

 

 

Badge +3
..that way yu dont have to link them as Vikram said. You are not testing for attirubtes basicaly, you are testing traits.
Userlevel 4
Well, if we're splitting hairs, I'd recommend not using the Sampler at all, since it will still read all the features in both datasets, which often is much slower than the comparison itself ;-)

 

 

For a case like this, I'd rather set the "Max features to read = 1" and skip the Sampler... :-)

 

 

David
Userlevel 4
But I see now that Vikram is using a dynamic reader, so it might well read many feature types with one or many different projections... Caveat emptor...

 

 

David
Badge
Thanks David and Gio for the insight . I found a way to detect cooordinate system . 

 

 

I kept my reader as Schema any format and exposed the attribute fme_coordinate_system .

 

 

And then I could compare my coordinate system . 

 

 

I will definitely try both your methods too :) 
Badge +3
Did'nt realise Sampler would read all features..

 

I read the discription that it will "discard the rest"...so i should have known.

 

Then of course Max-features to read is more logical.

 

 

It was not to split hairs, wich if one asks ones wive is a biological self emergent event anyway.... ;).

 

It was ment, as u obviously did realise, to reduce procestime.

 

 

Then again, Vikram's own solution in combination with max-feature to read, seems most efficient.

Reply