Skip to content
Permalink
Browse files

[processing] Update voronoi classes for Python3; update expected data…

… for multipoint Delaunay traingulation test
  • Loading branch information
p0cisk authored and m-kuhn committed Oct 19, 2016
1 parent 3af2303 commit cd0fefb42b1e58fb06f76c02d9bcce12a27e25c1
@@ -82,6 +82,8 @@ def processAlgorithm(self, progress):
total = 100.0 / len(features)
for current, inFeat in enumerate(features):
geom = QgsGeometry(inFeat.geometry())
if geom.isEmpty():
continue
if geom.isMultipart():
points = geom.asMultiPoint()
else:
@@ -391,17 +391,18 @@ def dump(self):
# fix_print_with_import
print("Site #%d (%g, %g)" % (self.sitenum, self.x, self.y))

def __cmp__(self, other):
def __eq__(self, other):
return (self.x==other.x) and (self.y==other.y)

def __lt__(self, other):
if self.y < other.y:
return -1
return True
elif self.y > other.y:
return 1
return False
elif self.x < other.x:
return -1
return True
elif self.x > other.x:
return 1
else:
return 0
return False

def distance(self, other):
dx = self.x - other.x
@@ -505,17 +506,18 @@ def dump(self):
# fix_print_with_import
print("ystar: ", self.ystar)

def __cmp__(self, other):
if self.ystar > other.ystar:
return 1
elif self.ystar < other.ystar:
return -1
elif self.vertex.x > other.vertex.x:
return 1
def __eq__(self, other):
return (self.vertex.x==other.vertex.x) and (self.ystar==other.ystar)

def __lt__(self, other):
if self.ystar < other.ystar:
return True
elif self.ystar > other.ystar:
return False
elif self.vertex.x < other.vertex.x:
return -1
else:
return 0
return True
elif self.vertex.x > other.vertex.x:
return False

def leftreg(self, default):
if not self.edge:
@@ -791,7 +793,7 @@ def __init__(this, lst):
def __iter__(this):
return this

def next(this):
def __next__(this):
try:
return next(this.generator)
except StopIteration:
@@ -0,0 +1,31 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>mp</Name>
<ElementPath>mp</ElementPath>
<!--POLYGON-->
<GeometryType>3</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>9</FeatureCount>
<ExtentXMin>0.00000</ExtentXMin>
<ExtentXMax>8.00000</ExtentXMax>
<ExtentYMin>-5.00000</ExtentYMin>
<ExtentYMax>3.00000</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>POINTA</Name>
<ElementPath>POINTA</ElementPath>
<Type>Real</Type>
</PropertyDefn>
<PropertyDefn>
<Name>POINTB</Name>
<ElementPath>POINTB</ElementPath>
<Type>Real</Type>
</PropertyDefn>
<PropertyDefn>
<Name>POINTC</Name>
<ElementPath>POINTC</ElementPath>
<Type>Real</Type>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -14,81 +14,73 @@
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>7,-1 8,-1 0,-5 7,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>8.000000000000000</ogr:POINTA>
<ogr:POINTB>7.000000000000000</ogr:POINTB>
<ogr:POINTC>6.000000000000000</ogr:POINTC>
<ogr:POINTA>7.000000000000000</ogr:POINTA>
<ogr:POINTB>6.000000000000000</ogr:POINTB>
<ogr:POINTC>5.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,-5 4,1 7,-1 0,-5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>6.000000000000000</ogr:POINTA>
<ogr:POINTB>5.000000000000000</ogr:POINTB>
<ogr:POINTC>8.000000000000000</ogr:POINTC>
<ogr:POINTA>5.000000000000000</ogr:POINTA>
<ogr:POINTB>4.000000000000000</ogr:POINTB>
<ogr:POINTC>7.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.2">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,-1 4,1 0,-5 0,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>9.000000000000000</ogr:POINTA>
<ogr:POINTB>5.000000000000000</ogr:POINTB>
<ogr:POINTC>6.000000000000000</ogr:POINTC>
<ogr:POINTA>8.000000000000000</ogr:POINTA>
<ogr:POINTB>4.000000000000000</ogr:POINTB>
<ogr:POINTC>5.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.3">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,1 0,-1 0,0 1,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>1.000000000000000</ogr:POINTA>
<ogr:POINTB>9.000000000000000</ogr:POINTB>
<ogr:POINTC>0.000000000000000</ogr:POINTC>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,1 4,1 0,-1 1,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>0.000000000000000</ogr:POINTA>
<ogr:POINTB>4.000000000000000</ogr:POINTB>
<ogr:POINTC>8.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.4">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,1 4,1 0,-1 1,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,2 4,1 1,1 2,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>1.000000000000000</ogr:POINTA>
<ogr:POINTB>5.000000000000000</ogr:POINTB>
<ogr:POINTC>9.000000000000000</ogr:POINTC>
<ogr:POINTB>4.000000000000000</ogr:POINTB>
<ogr:POINTC>0.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.5">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,2 4,1 1,1 2,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>2.000000000000000</ogr:POINTA>
<ogr:POINTB>5.000000000000000</ogr:POINTB>
<ogr:POINTC>1.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.6">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,2 7,-1 4,1 5,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>4.000000000000000</ogr:POINTA>
<ogr:POINTB>8.000000000000000</ogr:POINTB>
<ogr:POINTC>5.000000000000000</ogr:POINTC>
<ogr:POINTA>3.000000000000000</ogr:POINTA>
<ogr:POINTB>7.000000000000000</ogr:POINTB>
<ogr:POINTC>4.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.7">
<ogr:multipoint_delauney fid="multipoint_delauney.6">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,3 4,1 2,2 3,3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>3.000000000000000</ogr:POINTA>
<ogr:POINTB>5.000000000000000</ogr:POINTB>
<ogr:POINTC>2.000000000000000</ogr:POINTC>
<ogr:POINTA>2.000000000000000</ogr:POINTA>
<ogr:POINTB>4.000000000000000</ogr:POINTB>
<ogr:POINTC>1.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.8">
<ogr:multipoint_delauney fid="multipoint_delauney.7">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,3 5,2 4,1 3,3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>3.000000000000000</ogr:POINTA>
<ogr:POINTB>4.000000000000000</ogr:POINTB>
<ogr:POINTC>5.000000000000000</ogr:POINTC>
<ogr:POINTA>2.000000000000000</ogr:POINTA>
<ogr:POINTB>3.000000000000000</ogr:POINTB>
<ogr:POINTC>4.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
<gml:featureMember>
<ogr:multipoint_delauney fid="multipoint_delauney.9">
<ogr:multipoint_delauney fid="multipoint_delauney.8">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,2 8,-1 7,-1 5,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:POINTA>4.000000000000000</ogr:POINTA>
<ogr:POINTB>7.000000000000000</ogr:POINTB>
<ogr:POINTC>8.000000000000000</ogr:POINTC>
<ogr:POINTA>3.000000000000000</ogr:POINTA>
<ogr:POINTB>6.000000000000000</ogr:POINTB>
<ogr:POINTC>7.000000000000000</ogr:POINTC>
</ogr:multipoint_delauney>
</gml:featureMember>
</ogr:FeatureCollection>

0 comments on commit cd0fefb

Please sign in to comment.
You can’t perform that action at this time.