[Gdal-dev] RE: OGR GML output

Kralidis,Tom [Burlington] Tom.Kralidis at ec.gc.ca
Mon Jan 31 09:30:55 EST 2005



> 
> On Wed, 26 Jan 2005 21:52:55 -0500, Kralidis,Tom [Burlington] 
> <Tom.Kralidis at ec.gc.ca> wrote:
> > 
> > Hi,
> > 
> > Using under GDAL 1.2.5, I converted a shapefile to a GML document, 
> > i.e.:
> > 
> > ogr2ogr -f GML out.gml hydroshedg.shp
> > 
> > ...and have some comments / suggestions w.r.t. the output GML:
> > 
> > .xsd file generated:
> > 
> > - http://schemas.cubewerx.com/schemas/gml/2.1.2/feature.xsd 
> is used as 
> > the schemaLocation for the GML import.  Suggest changing to 
> > http://schemas.opengeospatial.net/gml/2.1.2/feature.xsd
> 
> Tom,
> 
> Updated the schemaLocation.
>  
> > - the ogr namespace in the .xsd and the .gml document 
> differ.  Should 
> > be the same (suggest http://gdal.maptools.org/ogr/)
> 
> I have changed them both to be http://ogr.maptools.org/. 
> 
> > .gml file generated:
> > 
> > - the root element should add an attribute which points to the .xsd 
> > file generated (i.e. 
> xsi:schemaLocation="http://gdal.maptools.org/ogr/
> > ./out.xsd"
> 
> There is a line that reads:
> 
>      xsi:schemaLocation=". out.xsd"
> 
> I assume that is the correct way to refer to an out.xsd file 
> in the same directory as the file referencing it ... isn't 
> it?  I can't very well refer to http://gdal.maptools.org/ogr 
> as being the location since it will never be there, can I? 
>  

The format of xsi:schemaLocation is:

xsi:schemaLocation="[namespace] [.xsd file]"

...so the first arg (namespace) is okay.  The .xsd can be local or on
another box via http.


> > - suggest a default namespace in the root element (i.e. 
> > xmlns="http://gdal.maptools.org/ogr/"), thus negating the 
> requirement 
> > to prefix elements with "ogr".
> 
> I have added this.  Is there any harm in including the "ogr" 
> prefixes on elements?  I think it makes things clearer. 
> 

OK.  My recommendation was based on the norm I see out there (default
namespace'd XML docs as opposed to explicitly referred to prefixes).
Should be okay either way, I think.

 
> > I'd be willing to help out with this in terms of testing and XML / 
> > Schema design.
> 
> I have also committed the changes I made last week to bring 
> the OGR GML support into line with the 3L0 (GML 3 Level 0) 
> profile document with the exception that I still refer to the 
> GML 2.1.2 
> feature.xsd.  
> 
> If you get a chance to try what is in CVS now, I would 
> appreciate additional feedback.  I'm afraid XML (especially 
> stuff related to 
> XML Schema and namespaces) is not my forte so help is 
> appreciated. 


OK, is there a Windows binary of latest CVS by any chance out there
being generated?



More information about the Gdal-dev mailing list