<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Thanks a lot for replying... I still a newbie at this ... </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">in order for shapelib to read shapefile, you need a set of three files(.shp, .shx, .dbf).</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">so, if I have to download this to a temp location into my computer filesystem, could you show me how this is done? <BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Andreas Jung &lt;lists@zopyx.com&gt;<BR>To: Allen Huang &lt;swapp0@yahoo.com&gt;; Zope &lt;zope@zope.org&gt;<BR>Sent: Sunday, December 24, 2006 2:47:52 PM<BR>Subject: Re: Fw: [Zope] problem with the shapelib module.. help<BR><BR>
<DIV>-----BEGIN PGP SIGNED MESSAGE-----<BR>Hash: SHA1<BR><BR><BR><BR>- --On 23. Dezember 2006 22:27:29 -0800 Allen Huang &lt;swapp0@yahoo.com&gt; wrote:<BR><BR><BR>&gt;<BR>&gt; 2. but when I save the shapefiles (taiwan1.shp, taiwan1.shx, taiwan1.dbf)<BR>&gt; into zope and call it using dtml it return the same error message.<BR>&gt; import shapelib, dbflib<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def readshp(filename):<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shp = shapelib.ShapeFile(filename)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return shp.info()<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and in zope<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-var expr="readshp(taiwan1.shp)"&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 or<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-var expr="readshp('<A href="http://localhost/pytest/taiwan1.shp" target=_blank )&quot?>http://localhost/pytest/taiwan1.shp')"</A>;&gt;<BR><BR>No idea what shapelib is doing but reading a file from the locale <BR>filesystem as it seems to work from an external method is *different* from <BR>a accessing<BR>content that is stored within the ZODB. I really wonder why you think it <BR>would work the same way? The hierarchical object storage of Zope looks <BR>similar to a filesystem but it is not a filesystem and the Python APIs for <BR>accessing filesystems don't apply. We have no idea what the ShapeFile <BR>constructors expects as data. If it expects a filename of a file within the <BR>filesystem then you must obtain the content of your data stored within the <BR>ZODB, create a temporary file and call the constructor as you did within<BR>your external method. Possibly the constructor accepts the data
 directly<BR>as *string*..in this case this would make things a bit easier. But it is up <BR>to *you* to check the Shapelib API and take appropriate action.<BR><BR>- -aj<BR>-----BEGIN PGP SIGNATURE-----<BR>Version: GnuPG v1.4.6 (Darwin)<BR><BR>iD8DBQFFjiKYCJIWIbr9KYwRAk0oAKCSyEo5ykswElgi9jFGWf89NthzmwCfRvEM<BR>nSMyeIu/cK7NpecUlof2BR8=<BR>=B0Mw<BR>-----END PGP SIGNATURE-----</DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com </body></html>