예제 #1
0
파일: vectors.py 프로젝트: SiggyF/gislib
 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)
예제 #2
0
파일: stores.py 프로젝트: SiggyF/gislib
    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)