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.
145 questions
0
votes
0
answers
29
views
Custom datum transformation pyproj from unknown CRS to WGS84
I have a set of location points that represents real points on earth in Easting and Northing, but these records have lost their information of their original datum, e.g. :
Point
Original X
Original Y
...
0
votes
0
answers
58
views
Rasterio affine transform pixel size meaning
I'm using calculate_default_transform and reproject from rasterio.warp to transform geotiff file from one coordinate reference system (EPSG:25832) to another (EPSG:3857). As a result the pixel size ...
0
votes
1
answer
47
views
How do you scale a polygon by X, Y values in ArcGIS Pro?
I am working with a shapefile that has a series of polygons (for states, countries, etc.)
In my case, I would like apply a linear transformation to one of the polygons using this matrix:
0.64
0
0
1....
1
vote
1
answer
39
views
Shifting points of LAZ point cloud using Python
I want to shift the coordinates of a .laz pointcloud by tx, and ty with laspy. After reading more about the offset and scale attributes of a las header.
I see that Xcoordinate = (Xrecord * Xscale) + ...
4
votes
1
answer
86
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 ...
0
votes
0
answers
57
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 ...
1
vote
0
answers
41
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)
...
0
votes
0
answers
37
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 ...
0
votes
0
answers
99
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
0
answers
56
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 ...
3
votes
1
answer
294
views
Adding simple Geomasking (Donut masking) feature using PyQGIS
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. ...
0
votes
0
answers
163
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,...
0
votes
1
answer
535
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 ...
0
votes
0
answers
159
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 '...
0
votes
0
answers
52
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 ...
0
votes
0
answers
46
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 ...
0
votes
0
answers
49
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 ...
1
vote
1
answer
487
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 ...
1
vote
0
answers
85
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 ...
1
vote
1
answer
121
views
Transform of image downloaded from GEE is different when reading on QGIS or using Rasterio
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 ...
5
votes
1
answer
366
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 ...
2
votes
0
answers
455
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 ...
2
votes
1
answer
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'...
1
vote
0
answers
91
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 ...
1
vote
0
answers
463
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(...
1
vote
0
answers
652
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 ...
0
votes
1
answer
106
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. ...
2
votes
0
answers
232
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 ...
1
vote
1
answer
903
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 ...
0
votes
1
answer
1k
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-...
1
vote
0
answers
60
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 ...
0
votes
1
answer
280
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 ...
2
votes
3
answers
2k
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....
2
votes
1
answer
497
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 ...
1
vote
0
answers
162
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 ...
0
votes
1
answer
384
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 ...
0
votes
0
answers
143
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)
...
8
votes
1
answer
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 ...
1
vote
0
answers
104
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 ...
2
votes
1
answer
78
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
votes
1
answer
527
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 ...
2
votes
1
answer
661
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&...
2
votes
0
answers
55
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 ...
2
votes
1
answer
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
votes
1
answer
1k
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 ...
1
vote
0
answers
125
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 ...
3
votes
0
answers
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 ...
1
vote
2
answers
1k
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 ...
1
vote
0
answers
381
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 ...
3
votes
1
answer
2k
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 ...