[postgis-devel] lwgeom_gml.c patch corrected

Barbara Philippot barbara.philippot at camptocamp.com
Mon Aug 20 07:47:27 PDT 2007


Mark Cave-Ayland a écrit :
> Hi Barbara,
>
> Sorry for the lack of review on this one - I know that I myself don't
> use the GML functions enough to be able to verify the changes that this
> patch makes :(
>
> Would you be able to note down a few paragraphs explaining exactly what
> the patch changes, and why it does it? (specifically how it changes
> existing behavior) I can't promise to commit based upon this
> information, but if I am still not sure then perhaps someone else with
> more GML experience would be able to review?
>
>
> Many thanks,
>
> Mark.
>
>   
Here it is :


 Regarding GML2, actual output doesn't validate against OGC's gml
schemas. Indeed, inside asgml_poly(), the elements <OuterBoundaryIs> and
<InnerBoundaryIs> are not correct : valid syntax is <outerBoundaryIs>
and <innerBoundaryIs>. Besides, coordinates followed straight the
previous elements whereas concerning boundaries, two elements are
required before displaying coordinates : <gml:LinearRing> and
<gml:coordinates>.
<gml:OuterBoundaryIs> is transformed into
<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates> (the same goes
for <innerBoundaryIs>) so that output validates against OGC's gml
schemas. asgml_poly_size() function is modified to take into account
previous changes.

   Still regarding GML2, and more precisely multigeometries, elements
were also missing inside asgml_inspected_buf(). Indeed, before calling
the right functions matching geometries : asgml_point_buf(),
asgml_line_buf() and asgml_poly_buf(), the elements <pointStringMember>,
<lineStringMember> and <polygonMember> must respectively be added.

   Then, the existing structure designed to take into account GML
version (AsGml(geometry,precision, version)) is used to display in GML3
existing geometries (POINTTYPE, LINESTRINGTYPE,
POLYGONTYPE,MULTIPOINTTYPE, MULTILINESTRINGTYPE and MULTIPOLYGONTYPE).
Coordinates syntax is also different in GML3, so a pointArray_toGML3()
function is added. These new functions are written in the same way as
GML2 functions and return valid GML3 according to OGC specifications.
For instance :
    - a polygon in GML2 : 
<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>
/coordinates/
</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>
    - a polygon in GML3 :
<gml:Polygon><gml:exterior><gml:LinearRing><gml:posList> /coordinates/
</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>

To sum up, theses changes are carried out to be compliant with OGC
specifications.


Regards,

Barbara



More information about the postgis-devel mailing list