MCPcopy
hub / github.com/golang/geo / initLoopProperties

Method initLoopProperties

s2/polygon.go:389–405  ·  view source on GitHub ↗

initLoopProperties sets the properties for polygons with multiple loops.

()

Source from the content-addressed store, hash-verified

387
388// initLoopProperties sets the properties for polygons with multiple loops.
389func (p *Polygon) initLoopProperties() {
390 p.numVertices = 0
391 // the loops depths are set by initNested/initOriented prior to this.
392 p.bound = EmptyRect()
393 p.hasHoles = false
394 for _, l := range p.loops {
395 if l.IsHole() {
396 p.hasHoles = true
397 } else {
398 p.bound = p.bound.Union(l.RectBound())
399 }
400 p.numVertices += l.NumVertices()
401 }
402 p.subregionBound = ExpandForSubregions(p.bound)
403
404 p.initEdgesAndIndex()
405}
406
407// initEdgesAndIndex performs the shape related initializations and adds the final
408// polygon to the index.

Callers 4

PolygonFromLoopsFunction · 0.95
InvertMethod · 0.95
initNestedMethod · 0.95
decodeCompressedMethod · 0.95

Calls 7

initEdgesAndIndexMethod · 0.95
ExpandForSubregionsFunction · 0.85
IsHoleMethod · 0.80
NumVerticesMethod · 0.80
EmptyRectFunction · 0.70
RectBoundMethod · 0.65
UnionMethod · 0.45

Tested by

no test coverage detected