MCPcopy
hub / github.com/django/django / _get_single_internal

Method _get_single_internal

django/contrib/gis/geos/polygon.py:127–143  ·  view source on GitHub ↗

Return the ring at the specified index. The first index, 0, will always return the exterior ring. Indices > 0 will return the interior ring at the given index (e.g., poly[1] and poly[2] would return the first and second interior ring, respectively). CAREFUL:

(self, index)

Source from the content-addressed store, hash-verified

125 capi.destroy_geom(prev_ptr)
126
127 def _get_single_internal(self, index):
128 """
129 Return the ring at the specified index. The first index, 0, will
130 always return the exterior ring. Indices > 0 will return the
131 interior ring at the given index (e.g., poly[1] and poly[2] would
132 return the first and second interior ring, respectively).
133
134 CAREFUL: Internal/External are not the same as Interior/Exterior!
135 Return a pointer from the existing geometries for use internally by the
136 object's methods. _get_single_external() returns a clone of the same
137 geometry for use by external code.
138 """
139 if index == 0:
140 return capi.get_extring(self.ptr)
141 else:
142 # Getting the interior ring, have to subtract 1 from the index.
143 return capi.get_intring(self.ptr, index - 1)
144
145 def _get_single_external(self, index):
146 return GEOSGeometry(

Callers 3

_get_single_externalMethod · 0.95
__delitem__Method · 0.45
newItemsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected