<span class="gI"><span class="go">strk,<br><br>Thank you very much for pointing out the errors. I could blame it on the lack of enough sample data but that's just laziness. I should have read the specifications more throughly.<br>
<br>I see your first point but I need to dig deeper for the second.<br><br>Please file a ticket at <a href="http://trac.osgeo.org/gdal/newticket">http://trac.osgeo.org/gdal/newticket</a><br>I would be grateful if you can provide some sample data.<br>
</span></span><br><div class="gmail_quote">On Sun, Jan 30, 2011 at 4:39 PM, strk <span dir="ltr"><<a href="mailto:strk@keybit.net">strk@keybit.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello,<br>
I'm writing GML output routines for Topologically-defined features<br>
in PostGIS and found what I think is a bug in how ogr interprets<br>
the <gml:Face> tag contents.<br>
<br>
Take this topology:<br>
<br>
n1<br>
+-----e1-->-----.<br>
| |<br>
| F1 |<br>
| n3 |<br>
| ,-e2->-+ |<br>
| | | |<br>
| | F2 | |<br>
| | | |<br>
| +-<-e7-' |<br>
| n4 |<br>
| |<br>
`---<-e2--------+<br>
n2<br>
<br>
It occurs to me that face F1 above is bounded by all edges,<br>
not just the exterior ones, so I'd put _all_ edges inside<br>
one gml:Face tag:<br>
<br>
<Face id="F1"><br>
<directedEdge orientation="-" id="e1" /><br>
<directedEdge orientation="-" id="e2" /><br>
<directedEdge id="e3" /><br>
<directedEdge id="e4" /><br>
</Face><br>
<br>
This is expressed clearly in the OGC 03-105r1 document (GML-3.1.1, 2004)<br>
and 07-036 (GML-3.2.1, 2007)<br>
<br>
<<<br>
The non-dangling edges in the boundary of a face comprise one or more<br>
topological rings. Each such ring consists of directedEdges connected<br>
in a cycle, and is oriented with the face on its left.<br>
>><br>
<br>
Now, when encountering such a GML snippet, ogr2ogr (GML driver)<br>
insists in considering all edges as being part of the same ring<br>
thus producing an invalid polygon as a result.<br>
<br>
It basically interprets a <gml:Face> tag as if it was a ring, which<br>
I belive is wrong.<br>
<br>
Another example of such invalid intepretation follows:<br>
<br>
+------+------+<br>
| F1 | F2 |<br>
+------+------+<br>
<br>
A surface/polygon formed by the two faces above (F1,F2) should be<br>
represented as:<br>
<br>
<TopoSurface id="P1"><br>
<directedFace> <Face id="F1"/> </directedFace><br>
<directedFace> <Face id="F2"/> </directedFace><br>
</TopoSurface><br>
<br>
Whereas the resulting feature geometry should be a single-ring polygon:<br>
the topological _union_ of the two faces (I haven't tested this but<br>
I belive GDAL would get this wrong as well).<br>
<br>
On the PostGIS side, I've so far implemented the "invalid" representation<br>
for the sake of interoperability with GDAL, but being a new implementation<br>
I'd rather get it right from the start...<br>
<br>
Note that using the "invalid" (but GDAL-compatible) representation also<br>
has the negative effect of making it _impossible_ to map PostGIS(ISO)<br>
topologies to GML in a lossless way (PostGIS topology faces would have<br>
no direct corrispondence to <gml:Face> tags).<br>
<br>
I hope, with this mail, to get some feedback from the authors of the<br>
GML reading capabilities of GDAL to plan actions towards interoperability<br>
of the two systems and adherence to the standard (if possible).<br>
<br>
--strk;<br>
<br>
() Free GIS & Flash consultant/developer<br>
/\ <a href="http://strk.keybit.net/services.html" target="_blank">http://strk.keybit.net/services.html</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9494447584<br>17.2416N 80.1426E<br>