[gdal-dev] ogrinfo and gml?

Mateusz Loskot mateusz at loskot.net
Fri Jul 25 08:06:38 EDT 2008


Christopher Schmidt wrote:
> On Fri, Jul 25, 2008 at 12:37:38PM +0200, Mateusz Loskot wrote:
>> Wendell Turner wrote:
>>> Why do the examples of ogrinfo not work? That is, the
>>> example shows a coal_dep.gml with contents of:
>>>
>>> <gml:featureMember>
>>> <Coal_Deposits fid="1">
>>> <UNKNOWN>0.000</UNKNOWN>
>>> <NA>0.000</NA>
>>> <ID>2</ID>
>>> <ID2>2</ID2>
>>> <MARK>7</MARK>
>>> <COALKEY>110</COALKEY>
>>> <COALKEY2>110</COALKEY2>
>>> <ogr:geometryProperty>
>>> <gml:Point>
>>> <gml:coordinates>78.531,50.694</gml:coordinates>
>>> </gml:Point>
>>> </ogr:geometryProperty>
>>> </Coal_Deposits>
>>> </gml:featureMember>
>>>
>>> Yet ogrinfo doesn't recognize it:
>>>   > ogrinfo coal_dep.gml 
>>>   FAILURE:
>>>   Unable to open datasource `coal_dep.gml' with the following drivers.
>>>   ...
>>>   -> GML
>>>
>>> This seems to indicate that the GML driver is compiled into
>>> ogrinfo, but the file is not recognized.  Why is that?
>>>
>>> There are no projection associated with the gml file, so are
>>> the coordinates in whatever the layer projection coordinates
>>> are?
>>>
>>> The example is off of the page:
>>>   http://mapserver.gis.umn.edu/docs/reference/vector_data/gml
>> Wendel,
>>
>> The document you pasted is incomplete.
>> For instance, XML prolog is missing there.
>> Add this as the first line:
>>
>> <?xml version='1.0' encoding="UTF-8" ?>
> 
> XML Prologs are not required in XML, and I have no reason to believe
> they are required by OGR.
> 
> The problem seems more likely to be the fact that this is a standalone
> gml:featureMember without a collection: in general, this would be
> wrapped inside something like a wfs:featureCollection or something
> similar...

Yes, I agree the prolog is optional, but GML driver expects to find
target namespace in the root element.

Greetings
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the gdal-dev mailing list