Table of contents Index

class GvShapes - A GvData of points, lines and areas (GvShapes).

Declared in module gview

Inheritance hierarchy:

gview.GvShapes
  gview.GvData
    gtk.GtkData

Synopsis

class GvShapes(GvData):
    def gview.GvShapes.__getitem__(self, index) # Return an individual shape by index
    def gview.GvShapes.__init__(self, name=None, _obj=None, shapefilename=None) # Create a GvShapes
    def gview.GvShapes.__len__(self) # Return number of shapes in container.
    def gview.GvShapes.append(self, shape) # Add GvShape to GvShapes
    def gview.GvShapes.save_to(self, filename, type=0) # Save layer to ESRI Shapefile

    # Inherited from gtk.GtkObject
    def gtk.GtkObject.__cmp__(self, other)
    def gtk.GtkObject.__getattr__(self, attr)
    def gtk.GtkObject.__getitem__(self, key)
    def gtk.GtkObject.__hash__(self)
    def gtk.GtkObject.__init__(self, _obj=None)
    def gtk.GtkObject.__setitem__(self, key, v)
    def gtk.GtkObject.connect(self, name, f, *extra)
    def gtk.GtkObject.connect(self, name, f, *extra)
    def gtk.GtkObject.connect_after(self, name, f, *extra)
    def gtk.GtkObject.connect_after(self, name, f, *extra)
    def gtk.GtkObject.connect_object(self, name, f, obj, *extra)
    def gtk.GtkObject.connect_object(self, name, f, obj, *extra)
    def gtk.GtkObject.connect_object_after(self, name, f, obj, *extra)
    def gtk.GtkObject.destroy(self, _obj=None)
    def gtk.GtkObject.disconnect(self, id)
    def gtk.GtkObject.emit(self, signal, *args)
    def gtk.GtkObject.emit_stop_by_name(self, sig)
    def gtk.GtkObject.flags(self, mask=None)
    def gtk.GtkObject.get_data(self, key)
    def gtk.GtkObject.remove_data(self, key)
    def gtk.GtkObject.set(self, dict)
    def gtk.GtkObject.set_data(self, key, value)
    def gtk.GtkObject.set_flags(self, flags)
    def gtk.GtkObject.signal_handler_block(self, id)
    def gtk.GtkObject.signal_handler_unblock(self, id)
    def gtk.GtkObject.signal_handlers_destroy(self)
    def gtk.GtkObject.unset_flags(self, flags)

    # Inherited from gview.GvData
    def gview.GvData.__init__(self, _obj=None)
    def gview.GvData.changed(self) # Emit GvData changed signal.
    def gview.GvData.get_name(self) # Fetch the name of this GvData.
    def gview.GvData.get_parent(self) # Fetch parent GvData object.
    def gview.GvData.get_projection(self) # Fetch projection, if any.
    def gview.GvData.get_properties(self) # Get GvData properties (attributes) as a dictionary.
    def gview.GvData.get_property(self, name) # Get a GvData property.
    def gview.GvData.set_name(self, name) # Set the name of this GvData.
    def gview.GvData.set_projection(self, projection) # Set the projection.
    def gview.GvData.set_property(self, name, value) # Set a GvData property.

    # Inherited from gtk.GtkData
    def gtk.GtkData.__init__(self, _obj=None)

Description

This layer can be treated as a list object, where each value is a GvShape.

gview.GvShapes.__init__(self, name=None, _obj=None, shapefilename=None)

Create a GvShapes

name
name to assign to GvShapes, defaults to None.
shapefilename
name of ESRI shapefile to create from, or None (default) to create an empty container.

gview.GvShapes.append(self, shape)

Add GvShape to GvShapes

shape
GvShape to add.

Returns the id of the newly added shape.

gview.GvShapes.save_to(self, filename, type=0)

Save layer to ESRI Shapefile

Shapefiles can only hold a single geometric type. By default this method will select a type based on the geometry of the first feature (GvShape) written, but it can be overridden with the type argument. The possible values are listed as SHPT_ codes in shapefil.h.

filename
name of file to save to (extension will be automatically supplied)
type
One of the shapefile type codes, or zero to try and auto detect the type of file to create. Zero is the default.

gview.GvData.changed(self)

Emit GvData changed signal.

Send a notification that this data has changed, with a NULL change_info value.

gview.GvData.get_parent(self)

Fetch parent GvData object.

This is typically used to get the underlying GvData on which a GvLayer (which is also a GvData) depends.

gview.GvData.get_projection(self)

Fetch projection, if any.

The projection is normally expressed in OpenGIS Well Known Text format or an empty string if no value is available.

gview.GvData.get_properties(self)

Get GvData properties (attributes) as a dictionary.

The properties are returned as a Python dictionary. Note that changes to this dictionary are not applied back to the GvData.

gview.GvData.get_property(self, name)

Get a GvData property.

name
the key or name of the property being set. Should be a well behaved token (no spaces, equal signs, or colons).

NOTE: Returns None if property does not exist.

gview.GvData.set_projection(self, projection)

Set the projection.

This method won't actually modify the data geometry, only the interpretation of the geometry.

gview.GvData.set_property(self, name, value)

Set a GvData property.

name
the key or name of the property being set. Should be a well behaved token (no spaces, equal signs, or colons).
value
the value to be assigned. Any text is acceptable.

Valid HTML 4.0! Made with CSS