#249 closed defect (fixed)
[OGR-GML] GML driver doesn't recognize GML files with 0 features
Reported by: | Daniel Morissette | Owned by: | warmerdam |
---|---|---|---|
Priority: | high | Milestone: | 1.11.0 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | gml gfs |
Cc: | Mateusz Łoskot |
Description (last modified by )
The OGR/GML driver doesn't recognize files that contain 0 features. Everything goes well until GMLReader::PrescanForSchema() gets called, it returns false since it doesn't find any feature class.
I guess this makes sense for datasets in general, but when we use the GML driver in the context of a WFS, receiving 0 features is a valid case.
It would be nice if OGR accepted to open GML file, and present it as a file with a single layer with 0 features in it.
What is an OGR driver expected to do if a file is empty? If nothing can be done at the OGR level for this then I guess I'll have to preparse the GML file before .
I try to open it with OGR, which is a bit of a waste of resources.
Any ideas, suggestions?
Change History (9)
comment:2 by , 21 years ago
I just realized that I may have to open the XML anyway when the open() call fails in order to look for exceptions. I'll get back to you on this one.
comment:3 by , 21 years ago
I modified MapServer to preparse the header of the WFS response and detect WFS exceptions, etc (a bit like a testopen) before calling OGR, so this is not an issue for me any more. I'll let you decide if you want to mark this as invalid, or keep this as a potential enhancement for later. I think it would be nice to return a datasource with zero layers as you suggested to indicate that the file format was recognized. But this could just confuse applications too, I dunno? I'll leave that up to you to decide. Thanks for the quick reply earlier today BTW :)
comment:5 by , 20 years ago
I'm too nervous to fiddle with this aspect of the GML reader before the release. Deferring. This is more of an issue to be revisited on the next substantial effort to improve the GML reader.
comment:6 by , 17 years ago
Description: | modified (diff) |
---|
comment:7 by , 17 years ago
Cc: | added |
---|---|
Keywords: | gml gfs added |
comment:8 by , 11 years ago
Milestone: | → 2.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:9 by , 10 years ago
Milestone: | 2.0 → 1.11.0 |
---|