2

I have many shape files that I am reading on FME (points, lines and polygons), editing them little bit and writing back the same format. However I am having an issue that I as far as process comes to an empty shape file while reading, process stucks and doesn´t continue enymore (though no error message pops up)! Is there a way that can ignore those empty shape files without any geometry (without any feature in it)?

4
  • what version of FME?
    – Mapperz
    Commented May 11, 2020 at 14:19
  • I am using version 2019.2
    – gisgis
    Commented May 11, 2020 at 14:21
  • Try the No Features Tester on the hub hub.safe.com/publishers/safe-lab/transformers/nofeaturestester
    – Mapperz
    Commented May 11, 2020 at 14:32
  • I am not able to come to that point. Process stucks while reading feature because the feature has no records
    – gisgis
    Commented May 11, 2020 at 14:49

2 Answers 2

3

I suspect you'll need the Ignore Failed Readers parameter in the Navigator window:

enter image description here

If a reader fails with an error, then set this to Yes and it will continue.

If this doesn't help (you do mention that yours never ends, rather than fails) can you post one of the files here so that we can test? I don't think it should hang, so I just wonder if your files are special in some way.

Edit: I just tried it in 2019.2 and 2020 and it was OK. Which Shapefile reader are you using? I think in 2019 there was the old version and a new one. Regardless, both seem to work fine for me, but it could make a difference for testing a sample file of yours.

3
  • in my case version 2019.2 is not working but 2019 when ignoring failed readers it does work! Something really strange. I am using normally Esri shape file readers.
    – gisgis
    Commented May 11, 2020 at 18:54
  • I managed to solve it, but you gave me very valuable hint to test it with different versions :-) With version 2019.2 as I told it didnt work but with 2019.0 exactly the same parameters it worked and then I saved to version 2019.2 now it works in both versions ..... I am not sure how comes but it works it might be a bug on software or something I am not sure....
    – gisgis
    Commented May 11, 2020 at 20:54
  • 1
    I'll check into if it's a known issue or not, but either way I'm glad your workspace is working now. Commented May 11, 2020 at 21:22
2

You can use FME transformer StatisticsCalculator by fme_basename attribute to test if the file contains no features. You just need to calculate total count (fme_basename.total_count).

You can test this attribute later on if greater than 0 to apply the rest of the workflow or to go to the next file.

FME StatisticsCalculator

If you have problems with features that don't have geometries, you can use GeometryFilter transformer.

FME Geometry filter

2
  • I am not sure if you got the problem... the thing is, I am not beeing able to read it at all because it stucks, it is like non-ending process..... it starts to read it and if it is empty it never ends and I want this to be skipped or removed or ignored something like that...
    – gisgis
    Commented May 11, 2020 at 14:27
  • 1
    Well, not sure if you can check it without opening the file. Check if everything is ok with the files. It shouldn't took so long if the file is empty. You can also use Min features to read in the reader parameters. Commented May 11, 2020 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.