|
|
|
|
|
|
|
LargestPolyFromMulti(geom)
takes a polygon or a multipolygon geometry and returns only the
largest polygon geometry |
source code
|
|
|
LargestLineFromMulti(geom)
takes a line or a multiline geometry and returns only the longest
line geometry |
source code
|
|
|
angle(pnt1,
pnt2,
pnt3)
Return the angle in radians between line(pnt2,pnt1) and
line(pnt2,pnt3) |
source code
|
|
|
angle_degrees(pnt1,
pnt2,
pnt3)
Return the angle in degrees between line(pnt2,pnt1) and
line(pnt2,pnt3) |
source code
|
|
|
spike_ring_indecies(line_ring,
threshold=0.01)
Returns a list of point indexes if ring contains spikes (angles of
less than threshold degrees). |
source code
|
|
|
remove_spikes(poly,
threshold=0.01)
Looks for spikes (angles < threshold degrees) in the polygons
exterior ring. |
source code
|
|
|
clean_geometry(geom)
Send a geometry to the cleanGeometry stored procedure and get the
cleaned geom back. |
source code
|
|
|
|
|
|
|
|
|
|
|
hex8_to_rgba(hex8)
Takes an 8 digit hex color string (used by Google Earth) and converts
it to RGBA colorspace * 8-digit hex codes use AABBGGRR (R - red, G -
green, B - blue, A - alpha transparency) |
source code
|
|
|
|
|
valid_browser(ua)
Returns boolean depending on whether we support their browser based
on their HTTP_USER_AGENT |
source code
|
|
|
isCCW(ring)
Determines if a LinearRing is oriented counter-clockwise or not |
source code
|
|
|
forceRHR(polygon)
reverses rings so that polygon follows the Right-hand rule exterior
ring = clockwise interior rings = counter-clockwise |
source code
|
|
|
forceLHR(polygon)
reverses rings so that geometry complies with the LEFT-hand rule
Google Earth KML requires this oddity exterior ring =
counter-clockwise interior rings = clockwise |
source code
|
|
|
asKml(input_geom,
altitudeMode=None,
uid='')
Performs three critical functions for creating suitable KML
geometries: |
source code
|
|
|
enable_sharing(group=None)
Give group permission to share models Permissions are attached to
models but we want this perm to be 'global' Fake it by attaching the
perm to the Group model (from the auth app) We check for this perm
like: user1.has_perm("auth.can_share_features") |
source code
|
|
|
|
|
|
|
is_text(s)
Tests a string to see if it's binary borrowed from
http://code.activestate.com/recipes/173220-test-if-a-file-or-string-is-text-or-binary/ |
source code
|
|
|
cachemethod(cache_key,
timeout=3600)
http://djangosnippets.org/snippets/1130/ Cacheable class method
decorator from madrona.common.utils import cachemethod
@cachemethod("SomeClass_get_some_result_%(id)s") |
source code
|
|