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
2
votes
1
answer
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:
...
2
votes
1
answer
600
views
Rotation of a cropped portion of a raster map
We create printed maps from a GeoTIFF file projected in LCC, which is a common projection for aviation maps. Part of our process includes customization of the raster image by selecting a region and ...
4
votes
2
answers
883
views
Renaming multiple layers in the legend from an attribute in each layer in QGIS
I have 72 layers that have been generated via affine transform of a single layer that has 72 categories. But the 72 layers have been given names that are sequential numeric. The original categories ...
3
votes
1
answer
14k
views
Defining Affine transform with rasterio
I have transform vector that I have gotten from bbox with sentinelhub:
transform=bbox.get_transform_vector(10,10)
>>>
(-101.7359960059834, 10.0, 0, 20.8312118894487, 0, -10.0)
The type of ...
3
votes
1
answer
272
views
rasterio reprojection produces no visible changes
I've been trying to perform translation of a raster using the reproject function from rasterio.warp.
I've calculated the translation amount in X and Y from a series of "control points" ...
2
votes
1
answer
523
views
Visually correcting systematic shift between two geodatasets using ArcMap
I often have two datasets that are obviously not georeferenced correctly. Most of the time a simple translation (shift by x/y) could fix this.
Is there an easy way to do this e.g. by specifying one or ...
0
votes
1
answer
240
views
Rotate, Scale, Translate in OpenLayers 4 and MapServer
Sometimes, I get spatial data (usually DGNs but I am not sure the format matters) that in the coordinate control sheet a 'Project Datum Factor' is noted. Say: 1.000073496. If I add them as is in ...
2
votes
2
answers
435
views
Affine Tranformation Matrix; shapely asks 6 coefficients, but rasterio delivers 9; how to translate
Some lines have been extracted via scikit-image, now tho goal is to vectorize them within the origin coordinate reference system
#some geotif opened with rasterio
src = rasterio.open(raster_path)
...
3
votes
0
answers
658
views
Difference between Affine, Bilinear and Helmert Transformations
I'm georeferencing old arial photos with a commercial GIS. The software offers me 'Affine', 'Bilinear' and 'Helmert transformation' as transformation options. Unfortunately, the support of the GIS can'...
0
votes
1
answer
3k
views
Using "raster.transform" function of "rasterio" in Python
When I execute the "raster.transform" function in Python it returns me a matrix.
What I can understand is that it tells me my data has a 10 m pixel resolution,
It also tells me that my left ...
5
votes
1
answer
2k
views
How do I mirror a vector layer along a line in QGIS?
ArcGIS (Map & Pro) has a nifty utility that allows you to mirror a vector layer along a line segment you give it. Before I spend time trying to write something from scratch, I wanted to see if ...
3
votes
1
answer
1k
views
Get geopandas geo or affine transform
Does anyone know how to get the affine transformation from a geopandas dataframe?
I need this for rasterising geospatial vector data with rasterio.
shapes = ((geom,value) for geom, value in zip(...
1
vote
0
answers
437
views
Transform rectangle from decimal degrees to Cartesian coordinates
I'm trying to achieve the following:
Given four coordinates (lat, lng) decimal degrees and a query coordinate within the formed shape, how can I transform these coordinates into Cartesian space where ...
1
vote
1
answer
2k
views
Apply same coordinate system to raster image and GeoJSON with rasterio
I have a dataset containing raster images and corresponding features in geojson files. I would like to use rasterio.features.rasterize to create a footprint image of the features on the raster image, ...
0
votes
0
answers
124
views
QGIS v.transform output extent not lining up with input
I am using the updated Affine tool (v.transform) to rescale my vector layer (containing multiple polygons). I want to shrink each polygon to half of its size. So I enter in 0.5 for both the x and y ...
3
votes
0
answers
765
views
Coordinate transformation for antenna pointing
I may have bitten off more than I can chew with some coordinate transformation math. As a background, I'm working on a project where we need to mechanically point an antenna to a receiving tower. The ...
3
votes
1
answer
1k
views
Spatial transformation of latitudes and longitudes that preserve distances between points
I have a set of lat,lon points.
I would like to apply a spatial transformation (rotate, translate) to place these points somewhere else on the earth surface (for anonymization purposes), but preserve ...
5
votes
1
answer
3k
views
Shapely affine transformations with bounds of GeoDataFrame
I understand that I can use Shapely's affinity.translate to translate a geometry like the below:
from shapely import affinity
from shapely.geometry import Polygon
poly = Polygon([(0, 0), (1, 0), (1, ...
2
votes
1
answer
2k
views
How to calculate affine transformation by Python gdal as same as gdal_translate?
I've made a python script which tries to reproduce what gdal_translate does (given a bounding box BBOX in EPSG:4326 and an UTM32 .jp2 file. Then, translates the BBOX from EPSG:4326 to EPSG:32632 (...
0
votes
2
answers
328
views
Difference results from QGIS project on fly and gdalwarp for EPSG:4326 of Sentinel 2 UTM zone 32?
I always thought QGIS and gdalwarp should return same result for projecting a 2D Sentinel 2 image (e.g: T32UQD_20200421T102021_TCI_60m.jp2) from UTM 32 to EPSG:4326.
What I did was:
Open the .jp2 in ...
2
votes
2
answers
671
views
Multiplying/dividing x/y values of line and polygon layer vertices?
I have several polygon and line layers in shapefile format with no crs so it can't be reprojected. The vertices coordinates need to be divided by 3,600,000 in order for them to match the project crs, ...
2
votes
0
answers
218
views
Raster shapes are not exactly equal after cropping
I clipped multiple rasters to the shape of a polygon shapefile.
But, the output rasters do not have exactly the same shapes. I am doing correlation analyses per pixel so I need the array shapes to ...
1
vote
1
answer
553
views
Creating Affine for 2D Linear Transformation of Fixed Bounding Box
I am currently trying to create an Affine which can transform data from longitude and latitude to a custom CRS that a client is using. Unfortunately the person who originally made this CRS has left ...
1
vote
1
answer
139
views
Transforming / stretching map or it's part in particular direction
I am trying to model ancient land surfaces we can 'rollback' geological folding and faulting. This is called palinspastic modelling or mapping.
So I have an area that due to folding and faulting was ...
2
votes
1
answer
868
views
Defining rotated CRS with WKT
I am trying to figure out how to display a rotated grid correctly with GeoServer with using the affine transformation in WKT as described here:
Defining coordinate reference system with rotation in ...
5
votes
1
answer
3k
views
Defining a coordinate system in WKT or PROJ format that has an Affine transformaiton and bounds
I need to define a local coordinate system via OGC WKT or PROJ form.
I know they have implemented Affine transformations in Proj 5 but I am unsure of how to implement it. The base projection is from ...
5
votes
1
answer
2k
views
Which affine format to use in Rasterstats zonal_stats?
I am working with the Rasterstats package to run zonal statistics on two raster datasets. The documentation calls for the following:
import rasterio
from rasterstats import zonal_stats
with rasterio....
2
votes
0
answers
767
views
Reprojection problem with Rasterio
I have already processed so far NDSI map by using Rrasterio, NumPy, os and matplotlib.pyplot for plotting the data.
Now, I would like to eliminate permanent ice from NDSI map. I am facing one major ...
1
vote
1
answer
283
views
Controling affine transform of raster in ArcGIS Pro
I have a png file which I created from a field equation. I need to plot that on my map. I am plotting it on a map with Coordinate System being GCS WGS 1984 (EPSG: 4326).
Since it is not georeferenced,...
2
votes
2
answers
814
views
is there a way to manually stretch a polygon?
I have this polygon that I want to manually fit and resize(without entering affine numbers, just resizing it with my mouse).
Is there a way to do it?
4
votes
2
answers
4k
views
Performing Vector Affine transformation in QGIS
Due to incorrect datum coordinates, I need to move a large number of elements in shapefiles by a specific distance.
In QGIS 2.8 I would have used the "Affine Transformation" tool, but this ...
1
vote
0
answers
256
views
Calculate transform from oblique raster, shape and CRS
Given a simple jpg of an oblique aerial photography, the geometry and a CRS I am trying to determine its affine transform so I can convert it into a GeoTIFF.
import rasterio, rasterio.crs
raster = ...
3
votes
1
answer
685
views
Converting coordinates from a local coordinate reference system
I am trying to define a local CRS in R based on the information in the screenshot image below
My R code is as follows:
I define the local CRS from the screenshot image
I apply it to my dummy ...
4
votes
1
answer
1k
views
Non-Earth System in QGIS?
What I need is a function for Non Earth Coordinates in QGIS (both projects and layers). They should be mappable to any projected coordinate system (like SWEREF99TM).
Why: In the Mining industry we ...
1
vote
1
answer
922
views
How to transform a shapefile with a MN03 (LV03) coordinate system into a shapefile with a MN95 (LV95) coordinate system?
Switzerland is currently introducing new coordinates: by the end of 2016, all federal and cantonal reference data (e.g. the Swiss cadastral system) sould be transformed to the new highly-accurate LV95 ...
2
votes
1
answer
3k
views
Transform coordinates from custom projection to lat long PyProj
I am trying to convert a pair of coordinates specified in US survey feet on a custom transverse mercator projection to lat/long using PyProj. I must be doing something wrong because I cannot get the ...
2
votes
2
answers
2k
views
How to create proj4 definition of local coordinatesystem
i have to generate a proj4 definition string from affine transformation parameters (A-F).
For example:
I have a local coordinatesystem based on EPSG:31466
The affine parameter are:
A = 0....
4
votes
2
answers
5k
views
Using shapely.affinity and affine_transform?
I have shapely.geometry Point:
from shapely.geometry import Point
point1 = Point(0, 100, 200)
and I want to swap coordinates Y and Z:
from shapely.affinity import affine_transform
matrix = [1,0,0, ...
2
votes
1
answer
1k
views
Local coordinate system to EPSG via affine transformation
I have a raster file with a local coordinate system. It is based on EPSG:31466 but with a specific rotation and offset.
gdalinfo output is this:
I need to transform this gtiff back to 31466, but how?...
3
votes
0
answers
550
views
Why can't I transpose a raster across the pole with rasterio or gdal, and how could it be done?
I have a raster in e.g epsg:4326, it covers all world, from 180E to 180W, from 90S to 90N. I want to re-project a part of it to epsg:3031 and also change the grid size and resolution.
Here is a ...
0
votes
0
answers
259
views
Spatial Adjustment of shapefile not possible
I am trying to spatially adjust a shapefile containing several polygons to another shapefiles where spatial data is correct. Both should share exactly the same extent. However, when I am using spatial ...
2
votes
0
answers
109
views
Reprojecting trouble: shapes saved in one EPSG load as another EPSG in QGIS and are 200m off?
I'm in a mixed working environment with some ESRI licenses and several people working with QGIS. For a project, we created data and received data in EPSG 31468 (Gauß-Krüger Zone 4). We now need to ...
0
votes
0
answers
1k
views
Import Illustrator/Inkscape svg into qgis
I tried to import lines from svg into qgis 3.x by using dxf format. The problem is that the scale of dxf is of course not the right one (a few centimeters whereas my map is kilometers long).
I tried ...
0
votes
0
answers
74
views
Affine transformation of different sized polygons layer to equal area units
I would like to transform a layer of polygons of different sizearea to become equal in areasize. I have QGIS 2.18 and GRASS GIS 7 available and some basic Python knowledge. Does anyone have an idea of ...
7
votes
3
answers
13k
views
Enlarge a Polygon without changing its shape or position
I have a single polygon shapefile (EPSG: 3044) which I want to enlarge using QGIS 2.18.16. I tried to use the vector affine transformation plugin, but whenever I try to change the size of the polygon,...
1
vote
0
answers
902
views
Raster alignment
I have a problem with raster aligning.
Given:
Two rasters that need to be aligned. Rasters a little bit shifted, scaled and rotated.
Two arrays of matched keypoints.
Transformation is wrong, so ...
2
votes
0
answers
403
views
Weather data in rotating grid without time dimension or vertical dimension or CRS
I am a beginner using QGIS 2.18.15. I am having some trouble to find the right coordinate reference system for wind speed data of Europe from the German Weather forecast service (DWD). (ftp://ftp-...
1
vote
0
answers
373
views
QGIS custom CRS from Mapinfo definition
How do I define a custom CRS in QGIS from the Mapinfo grid definition below?
"MIM Grid",1008,33,7,139.48639389,-20.69008981, 1.000063,0,0,7,0.998796124,-0.049054077,12520.6,0.049054077,0.998796124,...
1
vote
0
answers
267
views
What can the GeoTransform parameters tell me about an incorrectly georeferenced map?
I have two GeoPDF maps of the same area published a few years apart. There are only minor updates so virtually identical. However the newest map appears to be incorrectly georeferenced. I ascertained ...
1
vote
0
answers
148
views
Define Custom CRS for working with SVG
I can't seem to figure out a way to define a custom PROJ4 projection that can mirror geometries (e.g. inverse x to -x and y to -y and vice versa). Other than that, I don't need any transformations or ...