# Questions tagged [affine-transformation]

An affine transformation is a 2-dimension cartesian transformation applied to both vector and raster data, which can rotate, shift, scale (even applying different factors on each axis) and skew geometries.

142 questions
Filter by
Sorted by
Tagged with
42 views

### QGIS rotate/translate features on several layers with different geometries simultaneously

I am working in QGIS with three vector layers (points, lines, polygons) and an aerial image. The features from these three layers are "connected", i.e. they should stay in the same position ...
• 2,514
48 views

### Fix for incorrect pixel size post transformation

I have a .tif in WGS 84 and one in EPSG 32632. EPSG has a resolution of 10m (so the pixel sizes are 10). When I convert WGS 84 into the EPSG 32632 CRS, even after specifying that the new resolution ...
• 91
1 vote
32 views

### PostGIS: Custom projection matrix from known points

I have a PNG image of a map (mercator) and known points in a table like this: coord_map - geometry(Point, 0) coord_real - geometry(Point, 4326) 010100000000000000000000000000000000000000 (0,0) ...
• 11
19 views

### How can I reverse the effect of geopands.affine_transform?

Beginner question here... I'm a little unclear on how to go about reversing a transformation of a matrix from the format of Ax=b (or if it's possible for that matter). I started out with a 6x6 matrix ...
• 41
42 views

### Convert a homogenous matrix from xyz coordinate system to zyx coordinate system

I want to change my camera pose from xyz coordinate system(where x-forward direction, y left and z up) to zyx coordinate system ( z-forward y- down and x left) My camera pose is described in an ...
1 vote
48 views

### How to create a transformation vector and apply it to a vector layer?

I have 3 layers I'm working with. I'll call them A,B and C. Layer A - Satellite Imagery of location X (2017) (tiff) Laber B - Satellite Imagery of location X (2021) (tiff) Layer C - Vector Polygons of ...
• 41
56 views

### How to visualize affine transformed data in Python

I have Mavic 2 pro drone image, and try to apply georeferencing this JPG data. With the help of VerticalPhotoPlacer code, I first generate JGW file, then convert JPG data to GeoTIFF data.The code is ...
• 13
243 views

I would like to add a simple halo masking feature/plugin in QGIS. Halo/donut masking basically transforms (shifts) all points in a layer to a random distance between two user-provided distances. ...
138 views

### Calculate affine transformation from bounding box coordinates

How do you calculate the geo-affine transform given the bounding box coordinates and image size. For instance, I have the coordinates as follows: Top-Left: -108.01575, 45.01846 Bottom-Left: -108.00717,...
• 11
376 views

### Rasterio Affine Transformation - Inverted

I am trying to understand how to properly set up an affine transformation using Rasterio. I have read through guides online and I have used the format provided but for some reason, it does not seem to ...
104 views

### Correct Format for Transformation Rastio - from_origin

I am attempting to translate an HDF image to a GeoTIFF file and I encountered an issue when working with the transform module from rasterio. The issue comes when defining the transformation using '...
39 views

### How to create a vector for coordinate transformation?

Very new to geospatial data here. I have a number of satellite images with lower left and upper right corner points in 3857. When I lay these images in QGIS against Google's satellite imagery, I'm ...
43 views

### GEE image transform is different when saving on GCS or reading as ee.Image

I have accessed an image using GEE, and then saved it to GCS. I observed an unexpected behavior when I'm trying to get the dimensions and transform of the image. When I am trying to get the ee.Image ...
• 2,169
41 views

### Difference in image meta data when using GEE compared to rasterio

I'm accessing SRTM image using GEE, and then I save it as raster and open again with rasterio. I have realized that when I try to get the metadata with GEE, the values are different (and seem to be ...
• 2,169
1 vote
386 views

### Unexpected crsTransform after reducing an ImageCollection: nominal scale shows 111319.49079327357

I have created an Image from an Imagecollection and I want to export it and to define the crsTransform parameter. I have read the documentation and the post on this forum and tried to export it , and ...
• 2,169
1 vote
73 views

### CRS rotation in Geoserver

I want to add rotation angle for a custom metric CRS, that I created before in the Geoserver. I tryed two methods: Adding a WKT-stroke of rotated CRS to the Geoserver as usual. The example of such ...
• 43
1 vote
113 views

I have downloaded Sentinel-2 image using GEE platform. When I opened the image using QGIS, I was happy with the image as it seems to be right placed, With the following transform equation : *False ...
• 2,169
313 views

### Scaling linestrings gives incorrected final scale

I have a shapefile with about 5000 line strings. I am translating and scaling this file using GeoPandas: import geopandas green = geopandas.read_file('./shapefiles/unnamed (1)_green.shp') The ...
403 views

### How to use an affine transformation pipepline with GDAL Python API?

I am trying to transform coordinates from a local grid to a projected coordinate system (UTM) to ultimately reproject raster or vector data. I am using : Python 3.9 GDAL 3.6.0 Pyproj 3.4 I generated ...
1k views

### Scaling rotated rectangle in Shapely

I have a Polygon which looks like this It's a minimum-oriented bounding box for the LineString geometry contained within it, I generated it using QGIS. Actually, there are many more of these, but let'...
• 23
1 vote
82 views

### Combining affine transformations and COMPOUNDCRS

I have a need to define a WKT CRS which is both affine-transformed in 2D, and vertically shifted in the height direction. What I would like to say is something like this: COMPOUNDCRS["Modified ...
• 153
1 vote
430 views

### rasterio.plot gives different shape using extent after transformation

I plot the following tiff I plot it using import matplotlib.pyplot as plt from rasterio import plot def plot(self) -> None: fig, ax = plt.subplots(1, figsize=(10, 7)) ax.ticklabel_format(...
• 119
1 vote
567 views

### Change the origin point of the GeoTIFF files using Rasterio

I created a GeoTIFF file in Python (v3.8) using Rasterio (v1.2.10). The upper left corner is defined as the GeoTIFF file's origin point, which causes some difficulties in subsequent steps. Is there ...
103 views

### Mismatch between Google Earth and RasterIO Transform

I imported an image from a Arc GIS REST Map service and the dimensions of the image as projected don't match the transform, but they do line up correctly in Google Earth with the expected building. ...
• 167
204 views

### How to remove banding artifact in R after reprojecting sf with st_transform

I have several global map layers I am plotting using ggplot() + geom_sf() + etc. All data is "+proj=longlat +datum=WGS84 +no_defs". My goal is to have Eurasia be a contiguous land mass. This ...
• 21
1 vote
831 views

### Georeference and rotate an image using GDAL and Python

I have a drone image with no spatial reference (ungeoreferenced). I know from some calculations the coordinates of the upper left corner, and X and Y resolutions. I was able to georeference the image ...
• 528
967 views

### GDAL coordinate transformation using C/C++ API (OGRCoordinateTransformation)

I'm in a puzzle of figuring out how to create correct coordinate transformations using GDAL C/C++ API. I have referenced code from tutorial - https://gdal.org/tutorials/osr_api_tut.html#coordinate-...
• 103
1 vote
56 views

### How to get the transformation for a georeferenced dataset in azimuthal equidistant projection using rasterio

I have a squared Numpy array with data. I also have both squared arrays of the same shape with lat and lon. I also know the projection used by this data, an azimuthal equidistant with known center ...
• 389
251 views

### Transforming GPM Precip Data using rioxarray

I am working with GPM Precip data on a hydrologic study and I am having a hard time figuring out why the netcdf files I downloaded are giving me issues when I try and map the data. I am still learning ...
• 136
1k views

### Get the geo-coordinates of a point from a pixel

I need to get the geo-coordinates of a point from a pixel GeoTiff. I am using the following code: import gdal from affine import Affine # open the dataset and get the geo transform matrix ds = gdal....
397 views

### Visually correcting systematic shift between two geodatasets using QGIS

The equivalent question has been asked wrt ArcMap, but I'm using QGIS and am also an inexperienced user. I have multiple rasters, provided as GeoTIFFs, that are all projected to the same custom CRS ...
• 21
1 vote
153 views

### Transforming raster with matrix

I would like to apply a similarity transformation matrix (potentially a homography matrix) on a valid raster (with proper CRS, resolution, bounds, width height, etc). The 1st image is the original ...
• 258
348 views

### Projected coordinates points rotating horizontally

I have this Sentinel-2 picture that uses the WGS84 UTM zone 23S as projection type. My picture is rescaled to 3413 by 4741. My objective is to transform the X and Y pixels to EPSG 32723 and then from ...
• 53
125 views

### How to convert an affine matrix setup in a metric coordinate system to a pseudo web mercator System

I have an affine matrix (with rotation and translation), which is setup in a local metric coordinate system. 1 0 0 10 M = 0 1 0 15 0 0 1 14 0 0 0 1 webMercPoint = (20000, 1000, 0) ...
• 101
2k views

### How to find a particular coordinate on a Sentinel image using proj:transform?

Background I am retrieving images from the Sentinel satellites. I plot these images, using pixel coordinates. I would like to show points specified using latitude and longitude on those images. Data ...
• 2,224
1 vote
92 views

### Custom Projection Definition - Excel Formula to ArcGIS Pro

I have been given an Excel formula for converting a custom projection coordinate point to a known defined system (state plane AZ East) I'm trying to get create a custom projection definition in ArcGIS ...
74 views

### Wrong transform after interpolating points

Following this post, I'ms trugglig wwith interpolation and projection of set of points. I have used griddata in order to interpolate, and seems like interpolation hapenns, however, the results look ...
• 2,169
478 views

### Custom-derived CRS by affine transformation from EPSG:32633: Setting as layer-CRS works only for current QGis-session. Information lost after restart

I am working with QGIS 3.16, Win10. With help of another SE-user I created several derived CRS by an affine transformation from EPSG:32633 CRS (see below) in order to shift some related layers a ...
• 507
613 views

### How do I find these values for an Affine Transformation (state plane to local grid)?

so I need to perform some kind of transformation. I have a bunch of points like so: <record id="Localization Points" > <record id="Point 1" > <value name="Lat&...
52 views

### 3D transformation of local points

I was wondering if anyone could assist me with a problem. Undertaking some archaeological excavations we use a laser level as a datum to take heights or Z values, the laser level is free floating and ...
• 21
5k views

### Get the correct transform from bounding box with Rasterio

I have image as numpy array with no projection or geographical data and I have information of the bouding box of this numpy array (the image suppose to match perfectly the bbox). The bbox is ...
• 2,169
983 views

### How to get the affine matrix between 2 projection using pyproj?

I'm struggling getting the affine matrix (or crs_transform) using pyproj. The Transformerobject is full of functions to actually transform coordinates but I just want to check the matrix: I'm stuck ...
• 2,903
1 vote
122 views

### Cannot georeference an image using a custom projection in QGIS

I am trying to georeference a map using a custom projection I created in QGIS. I get the error Transform failed: "Failed to compute GCP transform: Transform is not solvable" Does anyone have ...
• 11
2k views

### Getting extents of raster with GeoTransform

I'm trying to better understand GeoTransform. For getting the extents of a raster, I've seen solutions posted such as below. But doesn't this only account for perfectly square rasters? From my ...
• 119
1 vote
945 views

### Reading CRS and Affine transformation from a NetCDF with CF conventions

I have a NetCDF with geographical information. I'd like to obtain a GeoTIFF file with rasterio. The problem is how to translate the geographical information from CF standard to something that GeoTIFF ...
• 389
1 vote
363 views

### Width and value problems with rasterstats

I am trying to extract data from a raster with a gpkg file as a vector. The issue is that, the data can't be extracted because the internal Bounding Box is negative. There I am not sure, whether this ...
• 449
1k views

### How to use affine transform parameters in a PROJ or WKT2 string

Can anyone show me how I can construct a PROJ or WKT2 string with affine transformation parameters to create a custom CRS in QGIS? I wish to use the following affine transformation parameters to ...
• 101
2k views

### Getting geo transforms (affine) without a TIFF reference image

I have a binary mask with buildings' footprints. What I have is a latitude and longitude of the center of my image and I want to georeference each polygon first. And here is what I have done before: ...
• 145