[gdal-dev] ogrinfo and gml?

Christopher Schmidt crschmidt at metacarta.com
Fri Jul 25 07:42:16 EDT 2008


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...

Regards,
-- 
Christopher Schmidt
MetaCarta


More information about the gdal-dev mailing list