Question

Pass a shape to a reader to spatially select an sde feature so a large amount of data doesn't have to be read


Badge

i have a feature in the sde db that is 1.7M records, the data i am trying to select has a field i want the user to select from. the 1.7M records data set does not have that field so i want to select them spatially, which i am doing now, without all 1.7M records having to be read by the workbench. 1000 or so records to select takes about an hour due to the workbench reading all the records before the spatial selection happens. is there any way to pass my buffer results from the users selection to the reader in the envelope section of the reader before all the record are read?


14 replies

Userlevel 5
Badge +25

Yes, you can use a FeatureReader transformer to read from your database. It needs to be triggered by a feature and can use that feature to do a spatial selection.

Badge

"it needs to be triggered by a feature" does that mean the buffer i am creating from the users selection will work?

 

Userlevel 5
Badge +25

"it needs to be triggered by a feature" does that mean the buffer i am creating from the users selection will work?

 

Yes. You do need to make sure it's in the same coordinate system as the data you're reading and set the spatial filter option.

Badge

that will be an issue, i am reprojecting because the sde is in nad83 and i need it in wgs1984

 

Userlevel 5
Badge +25

that will be an issue, i am reprojecting because the sde is in nad83 and i need it in wgs1984

 

So reproject that buffer to nad83, use it to read the sde and then reproject the resulting data to whatever you want.

Userlevel 1
Badge +10

If you use a feature reader you can send your bounding box as the trigger for that and use it as a spatial filter

image

Badge

how do i call my shape in the spatial filter, i see attributes and user parameters but not a feature

 

Userlevel 5
Badge +25

how do i call my shape in the spatial filter, i see attributes and user parameters but not a feature

 

The Initiator feature is used as the spatial filter.

Badge

ok, so the initiator is not the large data set, its the shape and in the reader configure the db connection to the feature?

 

Userlevel 5
Badge +25

ok, so the initiator is not the large data set, its the shape and in the reader configure the db connection to the feature?

 

Exactly. It'll only read features from the large dataset that have a spatial relation with the initiator feature.

Badge

THAT IS AWESOME, you guys saved me like 50 min of processing, ran my test in 5 min 48 sec as opposed to 59 min

Userlevel 5
Badge +25

THAT IS AWESOME, you guys saved me like 50 min of processing, ran my test in 5 min 48 sec as opposed to 59 min

😃

Badge

stupid question: how do i clear the data that was pulled into the workbench? i have to make this for other groups with other sde db connections, i have changed the db connections in the readers and feature readers but the data i just ran is still there, i tried to purge temp files but the data is still there.

Userlevel 5
Badge +25

stupid question: how do i clear the data that was pulled into the workbench? i have to make this for other groups with other sde db connections, i have changed the db connections in the readers and feature readers but the data i just ran is still there, i tried to purge temp files but the data is still there.

That data is only there in your cache. If you close Workbench it's gone. If somebody else opens the .fmw file (on another machine), they won't see that data.

Reply