Skip to main content
Solved

Shape file reading - filter based on an attribute on Navigator

  • December 10, 2015
  • 6 replies
  • 80 views

danilo_fme
Evangelist
Forum|alt.badge.img+42

Hello, i have a shape file with attributes and i would like to extract a any features but i dont want to use the transformer Tester. I know that Database has the option on the Navigator Painel that is able to make this action: Where Clause.

But to Shapefile? existing?Or use python on Navigator configuration Startup Python Script.

Thanks

Best answer by david_r

Hi

The WHERE-clause is only available for formats that supports conditional selects, e.g. SQL-based databases. Unfortunately, Shape-files do not support a WHERE-clause in FME and you will have to use e.g. a Tester to only process parts of the data.

If you do many selections on the same big dataset, consider first loading the Shape file(s) into a proper database, e.g. Postgis, which supports WHERE-clauses.

David

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.

6 replies

david_r
Evangelist
  • Best Answer
  • December 10, 2015

Hi

The WHERE-clause is only available for formats that supports conditional selects, e.g. SQL-based databases. Unfortunately, Shape-files do not support a WHERE-clause in FME and you will have to use e.g. a Tester to only process parts of the data.

If you do many selections on the same big dataset, consider first loading the Shape file(s) into a proper database, e.g. Postgis, which supports WHERE-clauses.

David


danilo_fme
Evangelist
Forum|alt.badge.img+42
  • Author
  • Evangelist
  • December 10, 2015

Perfect @david_r

Thanks your reply and help. I will make this.

Thanks in Advance,

Danilo de Lima


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • December 10, 2015

Yes,

Fme should be made able to query the dbf file and then load only the relevant shapes.

Dbf commander can use sql on dbf, so should fme (without using inlinequerier on the dbf and then merging, because u would still be reading the entire shapefile).

Sounds like a good idea to me..


david_r
Evangelist
  • December 10, 2015
gio wrote:

Yes,

Fme should be made able to query the dbf file and then load only the relevant shapes.

Dbf commander can use sql on dbf, so should fme (without using inlinequerier on the dbf and then merging, because u would still be reading the entire shapefile).

Sounds like a good idea to me..

I agree. It's a pity that not even the DBF reader has a where-clause. You'd think it would be a minor thing to implement. If I wasn't hoping for Shape to die out ASAP, I'd post this as a suggestion for Safe...


danilo_fme
Evangelist
Forum|alt.badge.img+42
  • Author
  • Evangelist
  • December 10, 2015
gio wrote:

Yes,

Fme should be made able to query the dbf file and then load only the relevant shapes.

Dbf commander can use sql on dbf, so should fme (without using inlinequerier on the dbf and then merging, because u would still be reading the entire shapefile).

Sounds like a good idea to me..

@gio i agree too. Its a good idea for SAFE implementing it.


fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • December 11, 2015
gio wrote:

Yes,

Fme should be made able to query the dbf file and then load only the relevant shapes.

Dbf commander can use sql on dbf, so should fme (without using inlinequerier on the dbf and then merging, because u would still be reading the entire shapefile).

Sounds like a good idea to me..

Good feedback. We've added some filtering to CSV reading in FME for example. Note that we still have to read the entire DBF to do any kind of filtering because there is no index or magic available to us. We could make a trivial WHERE clause but to step up to full SQL WHERE power might be more effort than we'd want to roll our own to do.

Would WHERE <filename> <operator> <value> be sufficient?


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