XML error with native GML docs via OGR
When I invoke:
I have a GML file on disk. Here's a record of the data natively as GML on disk:
<gml:featureMember>
<Observation>
<gml:name>bob</gml:name>
<gml:location>
<gml:Point
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coord>
<gml:X>-75.70420000</gml:X>
<gml:Y>45.39940000</gml:Y>
</gml:coord>
</gml:Point>
</gml:location>
<datetime>2003-10-30T00:00:00Z</datetime>
</Observation>
</gml:featureMember>
..testing this with ogrinfo returns no apparent problems:
$ ogrinfo -al obs.gml
Had to open data source read-only.
INFO: Open of `obs.gml'
using driver `GML' successful.
Layer name: Observation
Geometry: Unknown (any)
Feature Count: 3
Extent: (-95.704200, 45.399400) - (-71.920080, 55.399400)
Layer SRS WKT:
(unknown)
gml:name: String (0.0)
datetime: String (0.0)
OGRFeature(Observation):1
gml:name (String) = tom
datetime (String) = 2004-10-30T00:00:00Z
POINT (-71.92008200 45.41276600)
OGRFeature(Observation):2
gml:name (String) = bob
datetime (String) = 2003-10-30T00:00:00Z
POINT (-75.70420000 45.39940000)
OGRFeature(Observation):3
gml:name (String) = joe
datetime (String) = 2002-10-30T00:00:00Z
POINT (-95.70420000 55.39940000)
I have referred in my mapfile as:
LAYER
NAME "obs"
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "obs/obs.gml"
...etc...
END
I have also defined in my mapfile:
"wfs_namespace_uri" "http://www.ec.gc.ca/ecows"
"wfs_namespace_prefix" "ecows"
Now, when I invoke:
http://devgeo.cciw.ca/cgi-bin/mapserv/ecows?version=1.0.0&service=WFS&request=GetFeature&typename=obs&
....through OGC:WFS, this gets marshalled as:
<gml:featureMember>
<ecows:obs>
<gml:boundedBy>
<gml:Box srsName="EPSG:4326">
<gml:coordinates>-75.704200,45.399400 -75.704200,45.399400</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:pointProperty>
<gml:Point srsName="EPSG:4326">
<gml:coordinates>-75.704200,45.399400</gml:coordinates>
</gml:Point>
</gml:pointProperty>
<ecows:gml:name>bob</ecows:gml:name>
<ecows:datetime>2003-10-30T00:00:00Z</ecows:datetime>
</ecows:obs>
</gml:featureMember>
...so gml:name gets output as ecows:gml:name. Any items defined in the native
XML file with the gml namespace (i.e. gml:name, gml:description, etc.) should be
pushed out as such. Only non gml namespace'd elements should be pushed out with
whatever wfs_namespace_prefix (or default prefix if one is not defined).
Having said this, should we not be assigning a default namespace to the XML
document so that wfs_namespace_prefix is not prefixed to elements for GetFeature
responses? This seems to be the norm for most XML documents out there.
Note that we still need wfs_namespace_prefix to respond to DescribeFeatureType
requests.