[gdal-dev] ogrinfo and gml?

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


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" ?>

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


More information about the gdal-dev mailing list