Thursday 23 May 2019

grass - Computing parameters for QGIS Affine transformation?


I have a vector floorplan (DXF) that I've added to a blank project in QGIS using the Dxf2Shp plugin.


I've been reading tutorials and StackExchange threads, but I can't seem to find out how to "georeference" my layer?


I'm assuming I can somehow select the corners of the building and set the lat/long.


My goal is to export a shapefile that I can use with TileMill and TileStache.


I realized that the project coordinates were actually lat/long coordinates:


enter image description here


and I need to use the "Affine (Rotation, Translation, Scale)" plugin to "place" my CAD drawing.



Answer



Using OpenJump to calculate the affine transformation parameters yields:



Scale x: 0.02550720529745378
Scale y: 0.025669710194697357
Rotation: -88.6538203230914
Dx: 357101.9 (Translation x)
Dy: 4512814.6 (Translation y)

These parameters when properly applied should transform your shapefile from the local CRS that it uses to WGS84/UTM Zone 17 North (EPSG:32617). In QGIS the transformed data could then be exported ("saved as") to any required CRS; Google Mercator or lat/lon, for example.


The bad news is that I have never once been able to use successfully the QGIS affine plug-in for transformations that include rotation. By some accounts it works for other people but not for me, so it must be something I'm doing wrong. If anyone could tell me what this is I'd be grateful.


There was a thread here on affining vectors that is well-worth reading. The method I use for affining vectors is explained here at the bottom of the first page.


If you get really stuck you could post a link to the shapefile and we could all have a go at getting it transformed.



An afterthought. If you decide to try the OpenJump method you'll need the WGS84/UTM Zone 17 North (EPSG:32617) coordinates for your lat/lon points:


EPSG:32617: 361154.4 4513930.1
lat/long: 40.764622,-82.645056
shapefile coor: 947.3,1242.8

EPSG:32617: 361152.2 4513850.3
lat/long: 40.763903,-82.645064
shapefile coor: 4050.3,1035.7

EPSG:32617: 361246.5 4513886.7

lat/long: 40.764247,-82.643956
shapefile coor: 2710.5,4765.2

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...