[Qgis-user] CRS Transfer MGA94 <-> AMG94

Micha Silver micha at arava.co.il
Tue Dec 21 01:50:04 PST 2010


Ramon Andinach wrote:

> Hello,
>
> I am wanting to take a set of points stored in csv format that are in the projected CRS GDA94/MGA94 zone 51 (MGAz51) and end up with a csv file with the same points in CRS AGD84/AMG zone 51 (AMGz51). Being able to do this is useful for reconstructing some historical datasets that I deal with.
>   

If all you need is the new AMG z51 coordinates, you might want to try 
using cs2cs to do the conversion. You could script this to create a new 
CSV file from the original with two new columns for the new coord pair.
Here's a one liner to get started (tested on linux):
while read line; do echo $line | gawk -F , '{print $13"\t"$12}' | cs2cs 
+init=epsg:28351 +to +init=epsg:20251;  done < MGAOnlyAC.csv

Columns 12 and 13 are the N and E coords, but in "reverse" order. The 
gawk output gets piped straigt into the cs2cs utility, which then dumps 
(to the screen, at this point) the coordinates, transformed from EPSG 
28351 (MGA z51 ) to EPSG 20251 (AMG94 z51)
 
> I was intending to use the following path, but have hit a few problems on the way. These are using qgis 1.6 on win7-64bit by osgeo, and was updated last thursday. At least Problem 1 has been duplicated using qgis 1.6 on ubuntu 10.4, the others I have yet to have an opportunity to test.
>
> 1. Import CSV using the Delimited Text Plugin (Problem 1).
> 2. Save as a shape file in MGAz51.
> 3. Load shape file
> 4. Export to AMGz51 using either;
>  a. Vector -> Data Management Tools -> Export to New Projection (Problem 2), or
>  b. Save As and select a different CRS (Problem 3)
> 5. Load new shape file.
> 6. Extract coordinates using Vector -> Geometry Tools -> Export/Add Geometry Columns and then
> 7. Save As a CSV.
>
> So my first question is, is this path reasonable? Is there a better way?
>
> Problem 1.
> I experienced problems importing a text file. In the Delimited Text dialogue box the file appears to be correctly parsed, and I can select the correct X and Y fields (East_MGA94 and North_MGA94 respectively). However on import data is scattered all over the place, and most fields do not have data in the X and Y columns. This is weird, and I don't see why. Could some one explain?
>
> What I really don't get is why this file,
> http://members.westnet.com.au/ramon_et_al/files/MGAOnlyAD.csv
> does not import correctly when this file:
> http://members.westnet.com.au/ramon_et_al/files/MGAOnlyAC.csv
> does? There is only one column difference, and it does not remove the columns that would create duplicate headers at an 8 column width.
>
>   
I think there's an empty column at the end of the problem CSV file with 
no header, then after that another column called Item. i.e. after 
DateSampled there are two commas. That might be confusing the import...

Regards,
Micha
> Problem 2.
> Translating from MGA94z51 to GDA94 or WGS84 is successful.
> But any of these to AMG84z51 fails silently after creating the shape file.
>
> Equally, AMG84z51 to any of these fails silently.
>
> I don't know what the problem is. If the error is logged somewhere, and someone can tell me where to look I'll hunt it down and post what it says.
>
> For reference I have also tried this on a test file that *only* contains the coordinates, and hence no duplicate headers at 8 character width, and had the same problem.
>
> Problem 3.
> Translating  using Save As also fails but gives an error.
> Exception : forward transform of 2.11507, -0.524793 failed with error: failed to load datum shift file.
>
> Running from AMG84z51 to MGA94z51 gives a very similar error, except gives the numbers 2.11507, -0.525033
>
>
> Does anyone have any suggestions?
> -ramon._______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
> This mail was received via Mail-SeCure System.
>
>
>   




More information about the Qgis-user mailing list