[xsd-users] retrieving polygon from raeumlicherGeltungsbereich
Jan Pauwels
Jan.Pauwels at graphicomp.com
Mon Nov 19 07:38:07 EST 2007
Hello,
I want to retreive a polygon from hello9.xml. (Extract from file
follows)
<gml:featureMember>
<BP_Plan gml:id="obj_0">
<xplan:raeumlicherGeltungsbereich>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:pos>-82.790 -117.603</gml:pos>
<gml:pos>20.138 -113.254</gml:pos>
<gml:pos>20.138 85.716</gml:pos>
<gml:pos>-90.401 85.716</gml:pos>
<gml:pos>-82.790 -117.603</gml:pos>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</xplan:raeumlicherGeltungsbereich>
</BP_Plan>
</gml:featureMember>
I use the following code :
if (const xplangml::BP_PlanType* bplan = dynamic_cast<const
xplangml::BP_PlanType*> (&i->_Feature()))
{
cout << "BP_Plan" << endl;
for
(xplangml::BP_PlanType::raeumlicherGeltungsbereich_const_iterator j
(bplan->raeumlicherGeltungsbereich().begin());
j != bplan->raeumlicherGeltungsbereich().end();
++j)
{
::gml::SurfacePropertyType surf = *j;
::gml::AbstractSurfaceType absurf = surf._Surface();
::gml::AbstractGMLType ab = absurf;
if (const gml::PolygonType* p = dynamic_cast<const
gml::PolygonType*> (&absurf))
cout << "polygon" << endl;
else
cout << "no polygon" << endl;
}
}
The output is always "no polygon".
I attached the XML-files + schemas.
Thank you in advance.
Greetings.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello9.zip
Type: application/x-zip-compressed
Size: 31954 bytes
Desc: hello9.zip
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20071119/4391f7ea/hello9.bin
More information about the xsd-users
mailing list