I’m not familiair with this specific problem, but why would you not solve this using multiple FeatureReaders, one for each specific type?
Hey @nielsgerrits and thanks for response, we have one-stop-shop conversion tools on our Flow where users can drop various kinds of file formats and convert it into various kinds of file formats, so generic to generic (where the user selects the output format from a dropdown).
So having a generic GML to other fomat’s would be the lesser feasible option.
Hi @hlynur
This is an issue with how the Generic Reader works with formats that share a common extension, in this case, .gml. Specifically, when the generic reader recieves a file, it goes down the list of formats in formats.db until it finds an entry with a matching file extension.
It will use the first match to read the data (this is why we are seeing AIXM readers opened in the logfile, opposed to GML/INSPIRE).
We suspect, because the reader is being opened as AIXM (and the Reader as a Resource is not an AIXM Reader), they aren't speaking to each other properly, and no parameters are passed.
This is our workaround
- Add a Directory and File Path Reader
- Test or filter datasets based on format extension (TestFilter)
- Route data to an appropriate FeatureReader where the XSD can be referenced explicitly
If you need any help building this out, please reach out to us.
Thanks for this @crystalatsafe just wondering about Directory and Path Reader for a Flow tool where the user just drags and drops a file, how do we incorporate a Directory and Path Reader for that without it just turning an error (as it is a file that kick it off)?
-Hlynur
Hi @hlynur
I'm sorry for the late response.
You can try using the File/Folder/URL user parameter. Fetch the path using a ParameterFetcher, test the path/extension, then route to a FeatureReader where the parameters can be explicitly set, and then read the data.
I just ended up making a standalone one for GML and then another for everything else.
Hi @hlynur
I'm sorry we didn't have a straightforward solution for this but that seems like a good workaround!