Exemplo n.º 1
0
 def transform(self, source, target):
     """
     Transform geometry from source projection to target projection.
     """
     transformation = projections.get_coordinate_transformation(
         source=source, target=target,
     )
     self.geometry.Transform(transformation)
Exemplo n.º 2
0
    def get_data_for_point(self, wkb, crs, size=None):
        """get_data_for_point(
               ogr.CreateGeometryFromWkt('POINT(3 4)').ExportToWkb(),
               projections.RD)

        Size is ignored.
        """

        # Reproject point into dataset's projection
        transformation = projections.get_coordinate_transformation(
            crs, self.projection)
        wkb.Transform(transformation)

        # Fetch single point from dataset
        return self.fetch_single_point(wkb.x, wkb.y)