Django

Code

Show
Ignore:
Timestamp:
02/14/08 10:33:16 (11 months ago)
Author:
jbronn
Message:

gis: geos: Added GeoJSON input/output support for GEOSGeometry (requires GDAL 1.5+); Polygons may now be instantiated with tuples of coordinates instead of only LinearRing instances; added extent property; added coords property alias for tuple (and added tuple for GeometryCollection); made small optimizations to KML and coordinate array generators. Small GDAL protochange that didn't make last commit: get_envelope is now generated w/the previously unused env_func.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/geos/collections.py

    r6978 r7114  
    8686    def kml(self): 
    8787        "Returns the KML for this Geometry Collection." 
    88         kml = '<MultiGeometry>' 
    89         for g in self: kml += g.kml 
    90         return kml + '</MultiGeometry>' 
     88        return '<MultiGeometry>%s</MultiGeometry>' % ''.join([g.kml for g in self]) 
     89 
     90    @property 
     91    def tuple(self): 
     92        "Returns a tuple of all the coordinates in this Geometry Collection" 
     93        return tuple([g.tuple for g in self]) 
     94    coords = tuple 
    9195 
    9296# MultiPoint, MultiLineString, and MultiPolygon class definitions.