| | 539 | def _provideGeoInterface(self): |
|---|
| | 540 | allcoords = [] |
|---|
| | 541 | for i in range(self.numGeometries()): |
|---|
| | 542 | line = self.geometryN(i) |
|---|
| | 543 | coords = [] |
|---|
| | 544 | for j in range(line.numPoints()): |
|---|
| | 545 | p = line.pointN(j) |
|---|
| | 546 | coords.append((p.x, p.y, p.z)) |
|---|
| | 547 | allcoords.append(tuple(coords)) |
|---|
| | 548 | return { |
|---|
| | 549 | 'type': 'MultiLineString', |
|---|
| | 550 | 'coordinates': tuple(allcoords) |
|---|
| | 551 | } |
|---|
| | 552 | __geo_interface__ = property(_provideGeoInterface) |
|---|
| | 553 | |
|---|
| | 578 | |
|---|
| | 579 | def _provideGeoInterface(self): |
|---|
| | 580 | allcoords = [] |
|---|
| | 581 | for i in range(self.numGeometries()): |
|---|
| | 582 | g = self.geometryN(i) |
|---|
| | 583 | geomcoords = [] |
|---|
| | 584 | exring = g.exteriorRing() |
|---|
| | 585 | ringcoords = [] |
|---|
| | 586 | for k in range(exring.numPoints()): |
|---|
| | 587 | p = exring.pointN(k) |
|---|
| | 588 | ringcoords.append((p.x, p.y, p.z)) |
|---|
| | 589 | geomcoords = [tuple(ringcoords)] |
|---|
| | 590 | for j in range(g.numInteriorRings()): |
|---|
| | 591 | inring = g.interiorRingN(j) |
|---|
| | 592 | ringcoords = [] |
|---|
| | 593 | for k in range(inring.numPoints()): |
|---|
| | 594 | p = inring.pointN(k) |
|---|
| | 595 | ringcoords.append((p.x, p.y, p.z)) |
|---|
| | 596 | geomcoords.append(tuple(ringcoords)) |
|---|
| | 597 | allcoords.append(tuple(geomcoords)) |
|---|
| | 598 | return { |
|---|
| | 599 | 'type': 'MultiPolygon', |
|---|
| | 600 | 'coordinates': tuple(allcoords) |
|---|
| | 601 | } |
|---|
| | 602 | __geo_interface__ = property(_provideGeoInterface) |
|---|