Package s3 :: Package codecs :: Module shp :: Class S3SHP
[frames] | no frames]

Class S3SHP

source code

     object --+    
              |    
s3codec.S3Codec --+
                  |
                 S3SHP

Simple Shapefile format codec

Instance Methods
 
__init__(self)
Constructor
source code
 
extractResource(self, resource, list_fields)
Extract the items from the resource
source code
 
encode(self, data_source, **attr)
Export data as a Shapefile
source code
 
decode(self, resource, source, **attr)
Import data from a Shapefile
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods

Inherited from s3codec.S3Codec: get_codec, xml_decode, xml_encode

Static Methods

Inherited from s3codec.S3Codec: crud_string, json_message

Class Variables

Inherited from s3codec.S3Codec: CODECS, PY2XML, XML2PY, indices

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

Constructor

Overrides: object.__init__

extractResource(self, resource, list_fields)

source code 

Extract the items from the resource

Parameters:
  • resource - the resource
  • list_fields - fields to include in list views

encode(self, data_source, **attr)

source code 

Export data as a Shapefile

@param data_source: the source of the data that is to be encoded
                    as a shapefile. This may be:
                    resource: the resource
                    item:     a list of pre-fetched values
                              the headings are in the first row
                              the data types are in the second row
@param attr: dictionary of parameters:
     * title:          The export filename
     * list_fields:    Fields to include in list views

Parameters:
  • resource - the S3Resource
Returns:
a handle to the output
Overrides: s3codec.S3Codec.encode

decode(self, resource, source, **attr)

source code 

Import data from a Shapefile

Parameters:
  • resource - the S3Resource
  • source - the source
Returns:
an S3XML ElementTree
Overrides: s3codec.S3Codec.decode

To Do: Handle encodings within Shapefiles other than UTF-8