[QGIS-trac] Re: [Quantum GIS] #3099: Projection Failure
Quantum GIS
qgis at qgis.org
Sun Oct 10 04:39:27 EDT 2010
#3099: Projection Failure
------------------------------------------------+---------------------------
Reporter: badams | Owner: nobody
Type: bug | Status: new
Priority: major: does not work as expected | Milestone: Version 1.6.0
Component: Projection Support | Version:
Keywords: Projection Failure | Platform_version:
Platform: Windows | Must_fix: No
Status_info: 0 |
------------------------------------------------+---------------------------
Comment(by lutra):
Supposing that the grids you linked are the right ones for the the
geographic area of your interest (amg zone 51, but I don't think so,
especially after reading this http://www.mail-archive.com/qgis-
user at lists.osgeo.org/msg07255.html in particular http://www.mail-
archive.com/qgis-user at lists.osgeo.org/msg07363.html and following
answers), the transformation works like this
{{{
ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=utm +zone=51 +south
+ellps=aust_SA +units=m +no_defs +nadgrids=agd66.gsb +wktext" -t_srs
"+proj=utm +zone=51 +south +ellps=GRS80 +towgs84=0,0,0 +units=m +no_defs"
adg66_to_gda94.shp agd66_51.shp
}}}
[[BR]]
where:
*) ogr2ogr is the program that underlies QGIS (and many other software) to
handle vectors and make things like coordinate transformations
[[BR]]
*) s_srs is the source coordinate system, here you need to add
"+nadgrids=agd66.gsb" and "+wktext" and where "agd66.gsb" is the
appropriate grid file you need to copy in the right folder (it depends on
the OS and, under Windows, depends also in what kind of
installation/program are you using)
[[BR]]
*) t_srs is the target coordinate system, if is a projected one and you
want the grid transformation to work you need to add always
"+towgs84=0,0,0 "
[[BR]]
Then you indicate the target shape and the source one. The source shape
was obtained with the csv file you provided and saving the import result
as shapefile with the appropriate CRS.
[[BR]]
Obviously in the above example the operation is made by hand, with the
CLI, very handy if you need to transform bunches of shapefiles, but it can
be done obviously also with QGIS.
[[BR]]
But let see before the results (see attachment).
after transforming the points grid from adg66 to gda94, using the ntv2
grid, the resulting grid (in gda94 crs) is just 1.3 meters away from the
original grid in gda94, obtained by the coordinates in the csv file.
[[BR]]
Usually grid transformations give better results, this is another reasons
why I think that the grid you provided is not the right one for the
geographic area of your sample data.
[[BR]]
Back to QGIS:
the boring problem in QGIS is that in none of the GUIs that allow you to
save a copy of a vector is available the field to let you choose the
source SRS (I have already filed a enhancement ticket) and/or let the user
add +nadgrids and +towgs84 parameters. So what you need to do:
create a custom CRS, to be used as source SRS
[[BR]]
{{{
proj=utm +zone=51 +south +ellps=aust_SA +units=m +no_defs
+nadgrids=agd66.gsb +wktext
}}}
save a copy of your source vector ("save as...") and give to it this
custom coordinate system.
save again this "intermediate" vector and give to it the target coordinate
system, in this case
[[BR]]
{{{
"+proj=utm +zone=51 +south +ellps=GRS80 +towgs84=0,0,0 +units=m +no_defs"
}}}
[[BR]]
and don't forget to check if the Proj definition in the QGIS database
included "+towgs84=0,0,0" , if not you'll need to create a custom CRS also
for the target coordinate system.
[[BR]]
It seems complex, but it is not. The method works, and the results are the
same under Linux and Windows, by hand or with QGIS.
Now one question and one problem. Is the precision of the results the one
you were looking for? If not you than probably need to find a more
appropriate ntv2 grid.
The problem: while doing the transformation with QGIS under windows Seven
(osgeo4w/trunk) I'm getting some warnings that I don't get under Linux. So
I'll need to investigate more.
Open the attached project and tell if it makes sense to you.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/3099#comment:12>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list