You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with open('testdata.shp', 'wb') as f:
f.write(wbshp.getvalue())
with open('testdata.shx', 'wb') as f:
f.write(wbshx.getvalue())
with open('testdata.dbf', 'wb') as f:
f.write(wbdbf.getvalue())
The text was updated successfully, but these errors were encountered:
Are you suggesting that the README file would be improved by adding this more detailed example? If so you might need to make a few tempfiles so the doc tests will delete the files.
On Tue, Jan 19, 2016 at 1:38 AM, Micah Cochran [email protected]
wrote:
Are you suggesting that the README file would be improved by adding this
more detailed example? If so you might need to make a few tempfiles so the
doc tests will delete the files.
—
Reply to this email directly or view it on GitHub #36 (comment)
.
Similar to what is the manual page with a few more details.
from io import BytesIO as StringIO
import shapefile as sf
wb=sf.Writer(shapeType=sf.POINT)
wb.field('test','N',16,3)
wb.record(test=100)
wb.point(1.0,1.0)
wbshp=StringIO()
wbshx=StringIO()
wbdbf=StringIO()
wb.saveShp(wbshp)
wb.saveShx(wbshx)
wb.saveDbf(wbdbf)
with open('testdata.shp', 'wb') as f:
f.write(wbshp.getvalue())
with open('testdata.shx', 'wb') as f:
f.write(wbshx.getvalue())
with open('testdata.dbf', 'wb') as f:
f.write(wbdbf.getvalue())
The text was updated successfully, but these errors were encountered: