[QGIS-trac] Re: [Quantum GIS] #1079: on the fly projections do not
work
Quantum GIS
qgis at qgis.org
Thu Aug 21 09:31:35 EDT 2008
#1079: on the fly projections do not work
--------------------------------------------------------------+-------------
Reporter: pcav | Owner: mhugent
Type: defect | Status: closed
Priority: critical: causes crash or data corruption | Milestone: Version 1.0.0
Component: Projection Support | Version: HEAD
Resolution: fixed | Keywords: srs.db datum
Platform_version: | Platform: All
Must_fix: Yes | Status_info: 1
--------------------------------------------------------------+-------------
Comment (by msieczka):
Replying to [comment:10 leolami]:
> A little correlate problem is that if I load a layer from a Location of
GRASS with
> this parameters of projection:
>
> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.999600 +x_0=1500000 +y_0=0
> +ellps=intl +units=m
+towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
>
> when I look the projection associated to this layer I can see that QGIS
doesn't know
> this projection and that it associates to the layer the projection
setted as default.
>
> But if I create a custom projection like this and I set it as the
default projection
> when I load the GRASS layer I see that QGIS associates to the layer the
standard
> projection:
>
> +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
>
> but I remember that before QGIS readed the projection with parameters
like the same
> projection withot them and it associated to the layer the standard Gauss
Boaga projection
> (EPSG code=3003)
The problem is that QGIS produces an exact, particular proj4 string for
your layer, and tries to find a match for it in it's CRS database. In
order to let it find it, you need to define a custom CRS using a prj4
exactly the same QGIS qould be looking for.
You can find the string QGIS is looking for in it's terminal output when
it's loading the layer. In your case the very string is:
{{{
+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl
+towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +units=m +no_defs
}}}
The string *you* quoted is slightly different:
{{{
+proj=tmerc +lat_0=0 +lon_0=9 +k=0.999600 +x_0=1500000 +y_0=0 +ellps=intl
+units=m +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68
}}}
i.e.: different order of parameters, trailing zeros in 'k', missing
'no_defs' - enough for QGIS to make it not recognize it.
As long as QGIS depends on string-wise proj4 definitions matching, we need
to keep an eye on such subtle differences.
If you specify your custom CRS the way QGIS expects it, matching should
work for you (it does for me).
Maciek
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1079#comment:15>
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