[QGIS-trac] Re: [Quantum GIS] #1875: A few problems with crs
definitions with TOWGS parameters
Quantum GIS
qgis at qgis.org
Tue Aug 18 08:33:13 EDT 2009
#1875: A few problems with crs definitions with TOWGS parameters
--------------------------------------------------------------+-------------
Reporter: lutra | Owner: homann
Type: bug | Status: closed
Priority: critical: causes crash or data corruption | Milestone: Version 1.2.0
Component: Projection Support | Version: HEAD
Resolution: fixed | Keywords:
Platform_version: | Platform: All
Must_fix: No | Status_info: 0
--------------------------------------------------------------+-------------
Comment (by hamish):
Hi,
With the latest svn trunk I still see the failure to apply a datum shift
as seen in this old screenshot:
http://trac.osgeo.org/qgis/attachment/ticket/1079/qgis_fly_nodatum.png
The problem is that QGIS fails to convert the DATUM string in the WKT
shapefile.prj:
{{{
PROJCS["New Zealand Map Grid",
GEOGCS["international",
DATUM["New_Zealand_Geodetic_Datum_1949",
SPHEROID["international",6378388,297]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["New_Zealand_Map_Grid"],
PARAMETER["latitude_of_origin",-41],
PARAMETER["central_meridian",173],
PARAMETER["false_easting",2510000],
PARAMETER["false_northing",6023150],
UNIT["meter",1]]
}}}
specifically the translation magic fails to add the +datum=nzgd49 term
from: {{{ DATUM["New_Zealand_Geodetic_Datum_1949", }}}
If I specifically pick `NZ Map Grid` from the CRS list it adds that term
and the WGS84/LL and NZMG coastlines (more of less) correctly overlap, but
I could not find a way to edit the proj4 terms manually in the layer
projection settings. If the "*Generated CRS" is to be automagically
converted into proj4 +terms, it would be nice if it were left in an
editable state for those cases, either in the CRS picker GUI or in the
layer properties GUI's General tab. Maybe I am missing some easy trick
there.
So that gets rid of the 100m+ offset due to the wrong datum (ellipsoid).
But a 2-4m shift remains due the the inability to apply +towgs84 or
+nadgrids term. For +datum=nzgd49 there are 3 common datum transform
options: 3-term +towgs84, 7-term +towgs84, and a +nadgrids NTv2 distortion
grid file. One of these maps was reprojected from the other using the grid
file.
The +towgs84 datum transform terms are not saved in the shapefile's .prj
WKT by GRASS export [IIRC you can add the +proj4 terms as a meta-data
extra string in the WKT- that's a todo for grass's v.out.ogr module;
somewhere Frank had an example of how that should look. perhaps on the
proj4 FAQ or OGR's WKT parsing? I can't find it now...argh]
OT:
I'm finding it very difficult to test these as the map is taking about 2
minutes to render after each adjustment (svn trunk on a brand new amd
64bit quad-core + 8gig RAM). It's a large shapefile with the entire
countries coastline as a set of large single-line polygons, but the .shp
filesize is only 9MB so it's not that huge. Old versions of QGIS (0.8) had
no problem with it. I believe this is happening even before on the fly
reprojection is switched on.
If this were GRASS I'd call it the classic "Florida Coastline" problem.
I am happy to send anyone shp.zip's if it would help :)
ramble,
Hamish
--
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1875#comment:34>
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