<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.StyleCourrierlectronique17
        {font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=FR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Hi,</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> I
would like transform a geometry structure in a OGR.Geometry.</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Struct
MyGeometry</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>{</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt;text-autospace:
none'><font size=2 color=blue face="Courier New"><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";color:blue'>bool</span></font><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New"'> [] exterior = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt;text-autospace:
none'><font size=2 color=blue face="Courier New"><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";color:blue'>int</span></font><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New"'> [] partStarts = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt;text-autospace:
none'><font size=2 color=blue face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>int</span></font><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'> []
partEnds = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt;text-autospace:
none'><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt;text-autospace:
none'><font size=2 color=blue face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span></font><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'> []
padfX = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt;text-autospace:
none'><font size=2 color=blue face="Courier New"><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";color:blue'>double</span></font><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:
"Courier New"'> [] padfY = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>}</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>When
I use the method ExportToWkt and CreateFromWkt it’s very slow.</span></font></p>
<p class=MsoNormal style='text-indent:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Now
I have this method for the transformation :</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Geometry
gm = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Geometry
g = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Geometry
lr = <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>g
= <font color=blue><span style='color:blue'>new</span></font> Geometry(wkbGeometryType.wkbPolygon);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
color=blue face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";color:blue'>for</span></font><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>
(<font color=blue><span style='color:blue'>int</span></font> i = 0; i < partStarts.Length;
i++)</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>{</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>if</span></font> (exterior[i])</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> {</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>if</span></font> (i > 0)</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> {</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>if</span></font> (gm == <font color=blue><span
style='color:blue'>null</span></font>)</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> gm
= <font color=blue><span style='color:blue'>new</span></font> Geometry(wkbGeometryType.wkbMultiPolygon);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>
gm.AddGeometry(g);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> g.Dispose();</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> g
= <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> }</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>if</span></font> (g == <font color=blue><span
style='color:blue'>null</span></font>)</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> g
= <font color=blue><span style='color:blue'>new</span></font> Geometry(wkbGeometryType.wkbPolygon);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> }</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> lr
= <font color=blue><span style='color:blue'>new</span></font> Geometry(wkbGeometryType.wkbLinearRing);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>for</span></font> (<font color=blue><span
style='color:blue'>int</span></font> j = partStarts[i]; j < partEnds[i];
j++)</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> lr.AddPoint(padfX[j],
padfY[j], 0);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> g.AddGeometry(lr);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> lr.Dispose();</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> lr
= <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>}</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
color=blue face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New";color:blue'>if</span></font><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>
(gm != <font color=blue><span style='color:blue'>null</span></font>)</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>{</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>if</span></font> (g != <font color=blue><span
style='color:blue'>null</span></font>)</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> {</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> gm.AddGeometry(g);</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> g.Dispose();</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> g
= <font color=blue><span style='color:blue'>null</span></font>;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> }</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>return</span></font> gm;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>}</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
color=blue face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>else</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font
color=blue><span style='color:blue'>return</span></font> g;</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>It
works but it is not very quick, It’s possible to have a function like in
the shapelib</span></font></p>
<p class=MsoNormal style='margin-left:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-indent:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>SHPObject
SHPCreateObject(ShapeType shpType, <font color=blue><span style='color:blue'>int</span></font>
nShapeId, <font color=blue><span style='color:blue'>int</span></font> nParts, <font
color=blue><span style='color:blue'>int</span></font>[] panPartStart, PartType[]
paPartType, <font color=blue><span style='color:blue'>int</span></font> nVertices,
<font color=blue><span style='color:blue'>double</span></font>[] adfX, <font
color=blue><span style='color:blue'>double</span></font>[] adfY, <font
color=blue><span style='color:blue'>double</span></font>[] adfZ, <font
color=blue><span style='color:blue'>double</span></font>[] adfM);</span></font></p>
<p class=MsoNormal style='text-indent:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Thanks for your
support.</span></font></p>
<p class=MsoNormal style='text-indent:35.4pt;text-autospace:none'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>Best Regards.</span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> </span></font></p>
<table class=MsoNormalTable border=0 cellpadding=0 width=246 style='width:184.5pt'>
<tr>
<td width=197 style='width:147.75pt;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b><font size=1 color="#eebb22" face=Arial><span
style='font-size:9.0pt;font-family:Arial;color:#EEBB22;font-weight:bold'><a
href="mailto:jmp@geosys.com"><font color="#eebb22"><span style='color:#EEBB22'>Jean-michel
PIERRET</span></font></a> - Poste 376</span></font></b></p>
</td>
</tr>
<tr>
<td width=197 style='width:147.75pt;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b><font size=1 color="#999999" face=Arial><span
style='font-size:9.0pt;font-family:Arial;color:#999999;font-weight:bold'>Tel
: +33 (0)5 62 47 80 76</span></font></b><font size=1 color="#999999"
face=Arial><span style='font-size:9.0pt;font-family:Arial;color:#999999'><br>
<b><span style='font-weight:bold'>Mail</span></b> : <a
href="mailto:jmp@geosys.com"><font color="#336699"><span style='color:#336699'>jmp@geosys.com</span></font></a><br>
</span></font><b><font size=1 color="#336699" face=Arial><span
style='font-size:9.0pt;font-family:Arial;color:#336699;font-weight:bold'>GEOSYS
SA</span></font></b></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
</div>
</body>
</html>