예제 #1
0
    def _iterator(self):

        for point in self.generator.iterator():
            index = point.indexes[0]
            x_name = self.names[0]
            y_name = self.names[1]
            x_position = point.positions[x_name]
            y_position = point.positions[y_name]
            java_point = Point(x_name, index, x_position,
                               y_name, index, y_position, False)
            # Set is2D=False

            yield java_point
예제 #2
0
    def _iterator(self):

        for point in self.generator.iterator():

            if len(point.positions.keys()) == 1:
                name = point.positions.keys()[0]
                index = point.indexes[0]
                position = point.positions[name]
                java_point = Scalar(name, index, position)

            elif len(point.positions.keys()) == 2:
                logging.debug([point.indexes, point.positions])

                names = []
                indexes = []
                values = []
                for axis in self.axes_ordering:
                    index = self.index_locations[axis]
                    indexes.append(point.indexes[index])
                    logging.debug([axis, index])
                    values.append(point.positions[axis])
                    names.append(axis)

                java_point = Point(names[1], indexes[1], values[1],
                                   names[0], indexes[0], values[0])
                java_point.setDimensionNames(self.dimension_names)
            else:
                java_point = MapPosition()

                for axis in self.axes_ordering:
                    index = self.index_locations[axis]
                    logging.debug([axis, index])
                    value = point.positions[axis]
                    java_point.put(axis, value)
                    java_point.putIndex(axis, point.indexes[index])

                java_point.setDimensionNames(self.dimension_names)

            yield java_point