GML v3 loading with OpenLayers

844 views Asked by At

I rewrote the question to be more readable:

  • I saw GML format is just a little more 'evolved' than KML. Am I right? Which format is to be considered more standard, more supported and convenient to invest more on?

  • I tried the example here (http://openlayers.org/dev/examples/vector-formats.html) trying to load a GML v3 circle defined like this:

    <gml:featureMember xmlns:gml="http://www.opengis.net/gml"
    xsi:schemaLocation="http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <feature:feature xmlns:feature="http://example.com/feature">
        <feature:geometry>
            <gml:CircleByCenterPoint>
                <gml:pos>11.979491114616 43.847170472145</gml:pos>
                <gml:radius uom="km">25</gml:radius>
            </gml:CircleByCenterPoint>
        </feature:geometry>     </feature:feature> </gml:featureMember>
    

the example program is not able to load this. It seems a limitation of OpenLayers library in general that is not able to properly load some kind of GML files, or what? Am I specifying an invalid GML xml string? Do you know about some limitation on supporting some advanced features of the GML format in OpenLayers?

  • The GML v3 type on OpenLayers has only the possibility to load a GML v3 file passing the xml string via the read() method and not specifying the file to be loaded from the server using a HTTPProtocolOptions. Why this? Is there a way which I haven't understood?

  • Do you have some working GML file examples which use relative coordinates?

Thanks.

1

There are 1 answers

0
user2774650 On BEST ANSWER

I cannot answer the OpenLayers question but I can provide some information regarding GML viz KML. GML and KML are designed to solve two different (but related) interoperability requirements. GML was designed and specified to allow the modeling and encoding of geospatial content, including geometry, features, topology, dictionaries, and so forth. KML was designed and specified to enable the portrayal of simple geospatial content in an earth browser system. KML is not a general data modeling standard. Please read the preamble to the KML standard on the OGC website for more information. I should add that GML and KML use the same geometry model as specified in ISO 19107: Spatial Schema. However, KML does not support complex geometries nor does KML support the concept of features. There are excellent resources that describe GML and its use (see wikipedia entry for GML and related links.

So, if you need to model and encode geospatial content that requires features with properties, then use GML. If yo wish to encode simple geospatial content for portrayal, then use KML.