Opened 15 years ago
Closed 6 years ago
#2856 closed enhancement (fixed)
Relaxing parsing of GML files in OGR
Reported by: | aps03pwb | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR_SF | Version: | svn-trunk |
Severity: | normal | Keywords: | gml xml parse |
Cc: |
Description
OGR currently only recognises GML files when it locates <featureMember> tags with gml tags inside. If no featureMember tags are located it returns an error. The featureMember element is absent from many application schemas (including quite popular ones like GeoRSS) and is also asent from the SF-GML specification.
I would like OGR to complete a second (more relaxed) parse if the initial parse fails whereby it locates gml geometry tags and assumes that the tag two levels up is equivalent to the featureMember element. This should enable GDAL to read XML files that use GML only for a minor subset of their schema.
By peforming the strict parse first and only performing the relaxed parse if the strict parse fails, this enhancement should not negatively impact currently compatible GML files.
Attachments (3)
Change History (6)
by , 15 years ago
by , 15 years ago
Example of a simple XML file containing GML as a minor component that is rejected by OGR
comment:1 by , 15 years ago
As far as GeoRSS is concerned, there's a new OGR driver that specifically read and write that format. It will be in GDAL 1.7.0. See http://gdal.org/ogr/drv_georss.html. It can read your example rss.xml.
comment:2 by , 8 years ago
GDAL 2.1-dev can read rss.xml. It does not find anything from "fails.gml" but I can't judge if it should.
comment:3 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The new GMLAS driver gives an error about fails.gml: "No schema locations found when analyzing data file: XSD open option must be provided"
The test file does not seem to be valid. Otherwise I believe that GMLAS couuld resolve the schema and find the geometry. Closing because impossible to test any better now, and due to many years inactivity.
Example of a simple XML file containing GML as a minor component. The current implementation of OGR accepts this file