<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">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">shapelib still didn't work for me.. help</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">I've being trying different things for the pass day</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">1. I put the shapefile directly in the Extensions with the external method and it work fine</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> import shapelib, dbflib</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> def readshp():<BR> shp = shapelib.ShapeFile(<FONT color=#ff0000>'taiwan1.shp'</FONT>)<BR> return shp.info()</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR> and in zope</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> <dtml-var expr="readshp()></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">2. but when I save the shapefiles (taiwan1.shp, taiwan1.shx, taiwan1.dbf) into zope and call it using dtml it return the same error message. </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> import shapelib, dbflib</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> def readshp(<FONT color=#ff0000>filename</FONT>):<BR> shp = shapelib.ShapeFile(<FONT color=#ff0000>filename</FONT>)<BR> return shp.info()</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR> and in zope</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> <dtml-var expr="readshp(<FONT color=#ff0000>taiwan1.shp</FONT>)"></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> or</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> <dtml-var expr="readshp(<FONT color=#ff0000>'http://localhost/pytest/taiwan1.shp'</FONT>)"></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">The error message are</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>1. in "Run Zope in Console"</DIV>
<DIV> Exception exceptions.AttributeError:"ShapeFile instance has no attribute 'thisown'" in ignored</DIV>
<DIV> </DIV>
<DIV>2. in web browser</DIV>
<DIV>
<P> Site Error</P>
<P> An error was encountered while publishing this resource. </P>
<P><STRONG> Error Type: IOError</STRONG><BR><STRONG> Error Value: new_ShapeFile failed</STRONG><BR></P></DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">is there something wrong with how I constructed it? Do I need to do something before hand?</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">3. in error_log</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><PRE>Traceback (innermost last):
Module ZPublisher.Publish, line 115, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 41, in call_object
Module OFS.DTMLMethod, line 143, in __call__
- <DTMLMethod at /testPython/test>
- URL: http://localhost/testPython/test/manage_main
- Physical Path: /testPython/test
Module DocumentTemplate.DT_String, line 476, in __call__
Module DocumentTemplate.DT_Util, line 196, in eval
- __traceback_info__: readshp
Module <string>, line 1, in <expression>
Module Products.ExternalMethod.ExternalMethod, line 231, in __call__
- __traceback_info__: (('http://localhost/testPython/taiwan1.shp',), {}, None)
Module C:\web\ZopeInstance\Extensions\shapetools.py, line 4, in readshp
Module shapelib, line 44, in __init__
IOError: new_ShapeFile failed
</PRE></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Forwarded Message ----<BR>From: Dieter Maurer <dieter@handshake.de><BR>To: Allen Huang <swapp0@yahoo.com><BR>Cc: Zope <zope@zope.org><BR>Sent: Saturday, December 23, 2006 3:52:53 AM<BR>Subject: Re: [Zope] problem with the shapelib module.. help<BR><BR>
<DIV>Allen Huang wrote at 2006-12-21 23:23 -0800:<BR>>I want to do some mapping application with zope.. but I have run into this problem over and over..<BR>><BR>>in "Run Zope in Console"<BR>>Exception exceptions.AttributeError:"ShapeFile instance has no attribute 'thisown'" in ignored<BR><BR>Hmm. I doubt that you have really seen this text. There should be something<BR>in between the "in" and the "ignored". It is *vital* that you<BR>are as precise as possible in your problem reports...<BR><BR><BR>Python emits messages of the kind above in some (rare) situations,<BR>e.g. when exceptions occur in destructors.<BR><BR><BR>The exception above seems to have been raised in such a situation.<BR>The missing thing betwenn "in" and "ignored" should tell us which situation<BR>this was.<BR><BR>It tells you that something tries to access the attribute "thisown"<BR>on a "ShapeFile" instance but this does not have the attribute.<BR><BR>><BR>>in web
browser<BR>>Site Error<BR>>An error was encountered while publishing this resource. <BR>>Error Type: IOError<BR>>Error Value: new_ShapeFile failed<BR><BR><BR>Another tip for the future. When you report problems, you need<BR>to include full error information. Beside the "Error Type" and<BR>"Error Value" above, this also includes the traceback.<BR>You find all this information in the "error_log" object in<BR>Zope's "Root Folder" (Management Interface).<BR><BR><BR><BR>-- <BR>Dieter</DIV></DIV><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>