[gdal-dev] Rotate UTM-Grid
Even Rouault
even.rouault at spatialys.com
Wed Jan 24 13:33:37 PST 2018
On mercredi 24 janvier 2018 15:06:04 CET Julian Zeidler wrote:
> Dear all,
>
> I have the challenge that i have to allign a UTM-GRID with a pysical
> experiment.
>
> The model is rotated by 5 degrees compared to the UTM-Grid (EPSG:25833),
> so that N is at 355°
>
> I have to rasterize multiple Vectors to a 1m resolution rotated-raster,
> so that they can be pysicaly built and the results of a modell run
> directly compared to the measured physical model.
>
> Is there any way to define such a custom rotated Projection so that i
> could use it with gdalwarp and other tools?
This can be done with gdalwarp but requires a preliminary step when you create
an initial blank target raster with the right dimensions, and attach a geotransform that has
rotation terms and a CRS. Then you can use it as the output of gdalwarp in update
mode.
For example with the GDAL Python API;
from osgeo import gdal
from osgeo import osr
ds = gdal.GetDriverByName('GTiff').Create('out.tif', width, height, band_count)
ds.SetGeoTransform(gt) # where gt is an array of 6 values with the top left pixel coordinate, resolution and rotation terms.
#See "Affine GeoTransform" in http://gdal.org/gdal_datamodel.html
srs = osr.SpatialReference()
srs.ImportFromEPSG(25833)
ds.SetProjection(srs)
ds = None
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180124/9a622764/attachment.html>
More information about the gdal-dev
mailing list