<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">A very quick guess would be that you have changed the polyCollect type from a geometry type to a list of geometries. I
don’t think the list of geometries has a UnionCascaded method. I would probably go for a polyCollect geometry type of MultiPolygon instead of the list/vector, that way you should be able to run the UnionCascaded method.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">/Casper<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> gdal-dev <gdal-dev-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Ahmet Temiz<br>
<b>Sent:</b> 29. juni 2019 19:47<br>
<b>To:</b> gdal-dev <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> [gdal-dev] UnionCascaded operation failed<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Using C++ I try to buffers from LineStrings,Then I want to union the
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">resulting polygons with UnionCascaded. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">But at UnionCascaded operation failed with:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">"error: ‘class std::vector<OGRPolygon*>’ has no member named ‘UnionCascaded’<br>
OGRGeometry *result=polyCollect.UnionCascaded();<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Can you tell me what I am doing wrong?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">here is the related code fragment:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> std::vector<OGRPolygon * > polyCollect ;<br>
//OGRGeometryCollection *polyCollect ;<br>
<br>
while( (poFeature = poLayer->GetNextFeature()) != NULL )<br>
{<br>
<br>
OGRGeometry *poGeometry = poFeature->GetGeometryRef();<br>
<br>
if( poGeometry != NULL<br>
&& wkbFlatten(poGeometry->getGeometryType()) == wkbLineString )<br>
{<br>
OGRLineString *poLine = (OGRLineString *) poGeometry;<br>
//<br>
OGRGeometry *bufGeometry = poLine->Buffer(100,30);<br>
OGRPolygon *bufPoly= static_cast<OGRPolygon *> (bufGeometry) ;<br>
printf( "%s \n", bufPoly->getGeometryName());<br>
<br>
//polyCollect->addGeometryDirectly (bufPoly );<br>
polyCollect.push_back(bufPoly );<br>
}<br>
else<br>
{<br>
printf( "no point geometry\n" );<br>
}<br>
<br>
OGRFeature::DestroyFeature( poFeature );<br>
}<br>
<br>
OGRGeometry *result=polyCollect.UnionCascaded();<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Ahmet Temiz<br>
Jeoloji Müh.<br>
Afet ve Acil Durum Yönetimi Başkanlığı<br>
Bilgi İşlem Dairesi Başkanlığı-CBS Grubu<br>
<br>
<br>
________________________<br>
<br>
Ahmet Temiz<br>
Geological Eng.<br>
Information Systems - GIS Group<br>
Disaster and Emergency Management<br>
of Presidency<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>