From the course: FME Desktop: Data Translation for AEC

Tester

From the course: FME Desktop: Data Translation for AEC

Start my 1-month free trial

Tester

- [Instructor] One of my favorite transformers is the tester. The tester is a logic yes or no, that filters out your vector data. Let's try that now. First we're going to drag and drop a file from the desktop exercise files under the folder called 5 vector transformers. We're going to drag that into a brand new workbench. Okay, there we are. You'll see that it's an Autodesk map guide SDF file is great, where a single SDF that can have multiple feature classes inside of it. So we're going to just say okay. And there's only one feature class it's parcels. And now we have parcel boundaries that has ID, role, address, civic use, all sorts of things in there. So we're going to do that, and this time before we translate it to something else, we're going to actually use the tester. So just type tester, there it is. And the tester basically has a passed and failed. So let's connect the tester to our parcel boundaries. And what we'll do is we'll go double click on the tester and we can rename it. I sometimes want to check I'll say, tester look for empty addresses. So what I'm going to be testing for is to see what parcels don't have an address. So the left value will be one of the attributes. So I have a choice here, in the left value, that means what I'm looking for. So the left value, and I can choose a text editor or arithmetic editor or some user parameter that I've created, but I'm going to use the attribute. So these are one of the columns inside the SDF. In this case it's address, so I'm just going to choose address. And then the operator is greater than less than equal to within a range. But what I'm actually looking for, is the attribute is null. So I'll say null. So therefore if it's null, then that's what I'm looking for. And the comparison mode is automatic. Now I could do it case sensitive or numeric or any different types I want for example, case sensitive, like if I was looking for something that equals main street and that means the mainstream would have to be upper case whereas the case sensitive main street could be all upper case, lower case doesn't matter. But we're just going to choose automatic. And the right value is unused because all we're saying is the attribute is null. So we don't have to use the right value. Now I can flip this on its head and say not null. And then I could say not null. And that way it could say where the address is not null. Okay, we basically have a tester that says, if it's not null that means there's something inside. And If it is null, it failed. So let's run this right now, We'll go run, run, and it should run. And you'll see how many are null versus how many actually have an address inside. So it's going through each and every parcel. So as you can see there's over 40,000 and we've got two layer showing. So basically if I pick on the 2,800, those are the ones. I'm using the little magnifying glass to show you in a visual preview how many are null. Those are the 2,807 that are null, so if I were to pick on any of these, you could see as I scroll over the addresses null. Now if I pick on passed, and hit the magnifying glass that'll preview what the results will be for the ones that aren't null that basically they have an address. So if I sort by address, I'm just going to double click on it and show you that everything is populated from one pinnacle all the way to UH and UD. So everything's populated in here. So what I want to do then, I want to create a new SDF with the failed ones. So I'm going to create a brand new writer, and writer. And this time I'm going to call it missing addresses, I'm just going to put on the desktop. I'll call it missing addresses SDF, and I'll say, copy from reader that's fine, I'll hit okay. And I'll make a connection between the ones that are blank, the failed. That means the ones that are null and I'll get 2,800 in that SDF file. Now it's copying the feature class and it's calling it default parcel boundaries. I'm actually going to just name this parcels, parcels out addresses, there we go. So the feature class name is there. So if you look at my missing addresses, you could see the feature type is parcels without addresses. We're inside of this feature type is default parcel boundaries. So that's inside the SDF3 that we connected to under the missing addresses, that's what we'll get. Doubts greyed out because I haven't run it yet. So let's hit run, analysis translation is successful. So what I've done is I've basically created a brand new SDF file with the 2,807 parcels without addresses. So I can give that to someone to populate. Alright let's look at the desktop, there's a missing addresses. If I right click, I can inspect it with the data inspector. I just add that to my current view. And you can see the attributes down below. There's all the parcels without addresses. Basically they're null. No matter which one I pick on they are null, all the 2,800. So this at a glance, with one single file, these are all the addresses in this city that do not have addresses filled in. They have land_use. They have, see most of them are residential. Some of them are parks but they don't have addresses, which is interesting. Let's go back here. So you could see a tester can be used, mainly as a passed, failed based on some sort of logic. So if it meets that requirement, that's a pass if it doesn't, it's a fail and then you could direct all the data where you want. And now you can chain these together, as many as you want. So you can have one tester of once it fails. And then you could say, give me the parcels without addresses and then find out the parcels without roll and so on if you can daisy chain all the testers together. So the tester is definitely one of my favorite vector transformers for doing any kind of logical work within FME workbench.

Contents