<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-7">
<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="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* 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:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</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=EL link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'>Hi,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:navy'>Did you use first the shpcreate
as you do now and then the shpopen (this is correct)? Or did you replace the shpcreate
with the shpopen (this is false)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
shapelib-bounces@lists.maptools.org
[mailto:shapelib-bounces@lists.maptools.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>romain didier<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, May 29, 2008 7:00
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Shapelib Development<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Shapelib] Adding new
shape to shapefile</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I'm sorry, that doesn't work anymore... <o:p></o:p></span></font></p>

<div id="result_box">

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>My file is not even created !<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Thank you for your quick reply<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>2008/5/29 Vassilis Perantzakis &lt;<a href="mailto:vaspervnp@yahoo.gr">vaspervnp@yahoo.gr</a>&gt;:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>If it works like in Delphi, after creating the file you should close it
with<br>
<br>
shpFile.SHPClose(newShp);<br>
<br>
and then reopen it with<br>
<br>
IntPtr newShp = shpFile.SHPOpen(@&quot;\SD-MMCard\TestParcelle\ARRETBUS.shp
&quot;,<br>
&quot;rb+&quot;)<br>
<br>
to insure appending mode. I believe the same goes for the dbf file.<br>
<br>
Let me know if it helped.<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:shapelib-bounces@lists.maptools.org">shapelib-bounces@lists.maptools.org</a><br>
[mailto:<a href="mailto:shapelib-bounces@lists.maptools.org">shapelib-bounces@lists.maptools.org</a>]
On Behalf Of thecrashteam<br>
Sent: Thursday, May 29, 2008 6:31 PM<br>
To: <a href="mailto:shapelib@lists.maptools.org">shapelib@lists.maptools.org</a><br>
Subject: [Shapelib] Adding new shape to shapefile<br>
<br>
<br>
Hello,<br>
<br>
<br>
<br>
First, sorry for my English, I'll promise you I'll do my best.<br>
<br>
<br>
<br>
I'm in a training period in order to prepare my degree and I've in charge of<br>
the development of a PPC application in C# using shapelib.<br>
<br>
I read some posts in this forum about adding shapes in shapefile, and I<br>
apply some parts of code in my application but, I have a problem with the<br>
SHPWriteObject function. The application runs correctly but nothing is<br>
written in my shapefile. Someone could help me ? Do I make a mistake in my<br>
code ?<br>
<br>
<br>
<br>
Well thank you for your help<br>
<br>
<br>
<br>
Romain<br>
<br>
<br>
<br>
<br>
<br>
My code :<br>
<br>
IntPtr newShp = shpFile.SHPCreate(@&quot;\SD-MMCard\TestParcelle\ARRETBUS.shp&quot;,<br>
ShapeFile.ShapeFile.ShapeType.Point);<br>
<br>
double[] dblX = new double[1];<br>
<br>
dblX[0] = 803606;<br>
<br>
double[] dblY = new double[1];<br>
<br>
dblY[0] = 800000;<br>
<br>
IntPtr newDbf = shpFile.DBFCreate(@&quot;\SD-MMCard\TestParcelle\ARRETBUS.dbf&quot;);<br>
<br>
IntPtr pso = shpFile.SHPCreateObject(ShapeFile.ShapeFile.ShapeType.Point, 1,<br>
1, null, null, 1, dblX, dblY, null, null);<br>
<br>
IntPtr psObject =<br>
shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, dblX,<br>
dblY, null);<br>
<br>
shpFile.SHPWriteObject(newShp, -1, psObject);<br>
<br>
shpFile.SHPWriteObject(newShp, -1, pso);<br>
<br>
shpFile.DBFClose(newDbf);<br>
<br>
shpFile.SHPClose(newShp);<br>
--<br>
View this message in context:<br>
<a
href="http://www.nabble.com/Adding-new-shape-to-shapefile-tp17536792p17536792.html"
target="_blank">http://www.nabble.com/Adding-new-shape-to-shapefile-tp17536792p17536792.html</a><br>
Sent from the ShapeLib mailing list archive at Nabble.com.<br>
<br>
<br>
_______________________________________________<br>
Shapelib mailing list<br>
<a href="mailto:Shapelib@lists.maptools.org">Shapelib@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/shapelib" target="_blank">http://lists.maptools.org/mailman/listinfo/shapelib</a><br>
<br>
_______________________________________________<br>
Shapelib mailing list<br>
<a href="mailto:Shapelib@lists.maptools.org">Shapelib@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/shapelib" target="_blank">http://lists.maptools.org/mailman/listinfo/shapelib</a><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>