<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://www.flaviocdc.net/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://www.flaviocdc.net/wiki/feed.php">
        <title>Flavio Casadei Della Chiesa Wiki python:en</title>
        <description></description>
        <link>http://www.flaviocdc.net/wiki/</link>
        <image rdf:resource="http://www.flaviocdc.net/wiki/lib/images/favicon.ico" />
       <dc:date>2023-11-07T06:03:30+01:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://www.flaviocdc.net/wiki/python:en:export_a_shapefile_to_csv"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://www.flaviocdc.net/wiki/lib/images/favicon.ico">
        <title>Flavio Casadei Della Chiesa Wiki</title>
        <link>http://www.flaviocdc.net/wiki/</link>
        <url>http://www.flaviocdc.net/wiki/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://www.flaviocdc.net/wiki/python:en:export_a_shapefile_to_csv">
        <dc:format>text/html</dc:format>
        <dc:date>2008-12-30T23:04:54+01:00</dc:date>
        <title>Python Shapefile to CSV converter</title>
        <link>http://www.flaviocdc.net/wiki/python:en:export_a_shapefile_to_csv</link>
        <description>This script exports the data content (tabular data) of a shapefile and the bounding box of every object to csv format


&quot;&quot;&quot;
Shapefile export
&quot;&quot;&quot;
import shapelib, dbflib, string

SHAPEFILE=&quot;shpname&quot;

shp = shapelib.ShapeFile(SHAPEFILE)
dbf = dbflib.DBFFile(SHAPEFILE)

sCount = shp.info()[0]
dCount = dbf.record_count()

if sCount &lt;&gt; dCount:
	raise &quot;Error: shape  number %s (%d) differs from  dbf records (%d) &quot; %(SHAPEFILE,sCount,dCount)


#print l'header!
header = dbf.read_record(0)
#print header.k…</description>
    </item>
</rdf:RDF>
