Re: [Qgis-developer] Difference for transform reference system between QGIS and GDAL
Andre, Thank for quickly response. The question is exact this, why the QGIS read the PRJ and understands the 'towgs84', otherwise, the GDAL don't understands, where , the QGIS use the GDAL/OGR provider ? File PRJ: PROJCS[SAD69_UTM_zone_21S,GEOGCS[GCS_SAD69,DATUM[D_South_American_1969,SPHEROID[GRS_1967_Truncated,6378160,298.2496]],PRIMEM[Greenwich,0],UNIT[Degree,0.017453292519943295]],PROJECTION[Transverse_Mercator],PARAMETER[latitude_of_origin,0],PARAMETER[central_meridian,-57],PARAMETER[scale_factor,0.9996],PARAMETER[false_easting,50],PARAMETER[false_northing,1000],UNIT[Meter,1]] Proj4 for QGIS: +proj=utm +zone=21 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs Proj4 for GDAL: +proj=utm +zone=21 +south +ellps=aust_SA +units=m +no_defs Regards, Luiz Motta 2014/1/17 Andre Joost andre+jo...@nurfuerspam.de Am 17.01.2014 03:01, schrieb Luiz Motta: Hi all, I had differences for transform the reference system of geometries between GDAL and QGIS. I made the transform using GDAL into geometry with reference system SAD 69 UTM (EPSG 29191) to WGS 84 (EPSG 4326) . When i add in QGIS the geometries with WGS84 and SAD 69 using 'on the fly' (WGS84), has diferences positions of coordinate (see picture). The QGIS reads the reference system of shapefile different than GDAL (see layer property). I would like understand how using GDAL for transform geometries this reference system of this shapefile ? How can difference reading shapefile by QGIS and GDAL ? The shapefiles .prj file has no +towgs84 parameters, so GDAL sets them to zero. QGIS assigns the EPSG:29191 to the file, which has +towgs84 parameters. HTH, André Joost ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Luiz Motta Analista Ambiental - IBAMA/COTIG Instituto Brasileiro do Meio Ambiente dos Recursos Naturais - IBAMA IBAMA - SCEN Trecho 2 - Ed. Sede - Cx. Postal nº 09566 CEP 70818-900 - Brasília-DF Tel: 61.3316-1807 Skype: ibama_luiz-motta ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Difference for transform reference system between QGIS and GDAL
Hi, you should probably raise this on the gdal-dev mailing list... On Fri, Jan 17, 2014 at 8:56 AM, Luiz Motta motta.l...@gmail.com wrote: Andre, Thank for quickly response. The question is exact this, why the QGIS read the PRJ and understands the 'towgs84', otherwise, the GDAL don't understands, where , the QGIS use the GDAL/OGR provider ? File PRJ: PROJCS[SAD69_UTM_zone_21S,GEOGCS[GCS_SAD69,DATUM[D_South_American_1969,SPHEROID[GRS_1967_Truncated,6378160,298.2496]],PRIMEM[Greenwich,0],UNIT[Degree,0.017453292519943295]],PROJECTION[Transverse_Mercator],PARAMETER[latitude_of_origin,0],PARAMETER[central_meridian,-57],PARAMETER[scale_factor,0.9996],PARAMETER[false_easting,50],PARAMETER[false_northing,1000],UNIT[Meter,1]] Proj4 for QGIS: +proj=utm +zone=21 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs Proj4 for GDAL: +proj=utm +zone=21 +south +ellps=aust_SA +units=m +no_defs Regards, Luiz Motta 2014/1/17 Andre Joost andre+jo...@nurfuerspam.de Am 17.01.2014 03:01, schrieb Luiz Motta: Hi all, I had differences for transform the reference system of geometries between GDAL and QGIS. I made the transform using GDAL into geometry with reference system SAD 69 UTM (EPSG 29191) to WGS 84 (EPSG 4326) . When i add in QGIS the geometries with WGS84 and SAD 69 using 'on the fly' (WGS84), has diferences positions of coordinate (see picture). The QGIS reads the reference system of shapefile different than GDAL (see layer property). I would like understand how using GDAL for transform geometries this reference system of this shapefile ? How can difference reading shapefile by QGIS and GDAL ? The shapefiles .prj file has no +towgs84 parameters, so GDAL sets them to zero. QGIS assigns the EPSG:29191 to the file, which has +towgs84 parameters. HTH, André Joost ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Luiz Motta Analista Ambiental - IBAMA/COTIG Instituto Brasileiro do Meio Ambiente dos Recursos Naturais - IBAMA IBAMA - SCEN Trecho 2 - Ed. Sede - Cx. Postal nº 09566 CEP 70818-900 - Brasília-DF Tel: 61.3316-1807 Skype: ibama_luiz-motta ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Difference for transform reference system between QGIS and GDAL
Hi Luiz, On Fri, 17. Jan 2014 at 08:56:38 -0200, Luiz Motta wrote: The question is exact this, why the QGIS read the PRJ and understands the 'towgs84', otherwise, the GDAL don't understands, where , the QGIS use the GDAL/OGR provider ? QGIS tries to find a (near) match to prj content in it's database, if found it proceeds with it's CRS, instead of the CRS GDAL/OGR produced. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de QGIS PSC member (RM) IRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Difference for transform reference system between QGIS and GDAL
Hi all, Thank Jürgen for your explanation about how QGIS set the reference system from source. I agreement with André Joost about the user should select your specific reference. The source of my problem is the creating of shapefile by GDAL/OGR. For creating shapefile, the OGR/GDAL not using all parameters of reference system. I resolve my problem, creating the GML file, in this case, the refefence system is identical of source. How suggested Etienne i will raise this issue in gdal-dev list. If someone want to see the script example: http://pastebin.com/PbjwdrHR Regards, Luiz Motta 2014/1/17 Andre Joost andre+jo...@nurfuerspam.de Am 17.01.2014 11:56, schrieb Luiz Motta: The question is exact this, why the QGIS read the PRJ and understands the 'towgs84', otherwise, the GDAL don't understands, where , the QGIS use the GDAL/OGR provider ? This is an intended behaviour. Other software (like ESRI) don't write datum shifts in the .prj file, but leave it to the end user to select one of the available shifts. QGIS has to handle these files correctly, so it looks up the EPSG table and selects the best fitting code. If you think it has guessed wrong, you can assign another CRS to the layer. GDAL does no guessing. Unless there are not datum shifts provided on source and target CRS (using either +datum, +towgs84 or +nadgrids), it does no datum shift at all. You can specify -s_srs to override the source file's .prj file with an EPSG code that contains a datum shift. This should bring the same result as QGIS does automatically. HTH, André Joost ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Luiz Motta Analista Ambiental - IBAMA/COTIG Instituto Brasileiro do Meio Ambiente dos Recursos Naturais - IBAMA IBAMA - SCEN Trecho 2 - Ed. Sede - Cx. Postal nº 09566 CEP 70818-900 - Brasília-DF Tel: 61.3316-1807 Skype: ibama_luiz-motta ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Difference for transform reference system between QGIS and GDAL
Le vendredi 17 janvier 2014 20:43:13, Luiz Motta a écrit : Hi all, Thank Jürgen for your explanation about how QGIS set the reference system from source. I agreement with André Joost about the user should select your specific reference. The source of my problem is the creating of shapefile by GDAL/OGR. For creating shapefile, the OGR/GDAL not using all parameters of reference system. I resolve my problem, creating the GML file, in this case, the refefence system is identical of source. How suggested Etienne i will raise this issue in gdal-dev list. If someone want to see the script example: http://pastebin.com/PbjwdrHR Just lurking at this thread : - it is a design decision that OGR will discard parameters of the SRS when writing it in a .prj. The .prj format is ESRI WKT and ESRI WKT does not support TOWGS84 parameters. Perhaps we could try to write them, but I have no way of checking if ESRI software will accept such files - on reading .prj, as being said above, OGR will not try to find a SRS in the EPSG database that would be close. The .prj could be a custom SRS with a different TOWGS84 database. (By the way, the TOWGS84 presented by GDAL when resolving an EPSG code is just the preferred one , but there are potentially other possible TOWGS84 parameters that are a better fit for the area of interest. This is a complex issue...) Regards, Luiz Motta 2014/1/17 Andre Joost andre+jo...@nurfuerspam.de Am 17.01.2014 11:56, schrieb Luiz Motta: The question is exact this, why the QGIS read the PRJ and understands the 'towgs84', otherwise, the GDAL don't understands, where , the QGIS use the GDAL/OGR provider ? This is an intended behaviour. Other software (like ESRI) don't write datum shifts in the .prj file, but leave it to the end user to select one of the available shifts. QGIS has to handle these files correctly, so it looks up the EPSG table and selects the best fitting code. If you think it has guessed wrong, you can assign another CRS to the layer. GDAL does no guessing. Unless there are not datum shifts provided on source and target CRS (using either +datum, +towgs84 or +nadgrids), it does no datum shift at all. You can specify -s_srs to override the source file's .prj file with an EPSG code that contains a datum shift. This should bring the same result as QGIS does automatically. HTH, André Joost ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer -- Geospatial professional services http://even.rouault.free.fr/services.html ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Difference for transform reference system between QGIS and GDAL
Hi all, I had differences for transform the reference system of geometries between GDAL and QGIS. I made the transform using GDAL into geometry with reference system SAD 69 UTM (EPSG 29191) to WGS 84 (EPSG 4326) . When i add in QGIS the geometries with WGS84 and SAD 69 using 'on the fly' (WGS84), has diferences positions of coordinate (see picture). The QGIS reads the reference system of shapefile different than GDAL (see layer property). I would like understand how using GDAL for transform geometries this reference system of this shapefile ? How can difference reading shapefile by QGIS and GDAL ? Data for help me: 1) python script using GDAL: http://pastebin.com/ujeHJLx5 2) Shapefile with SAD69 UTM https://dl.dropboxusercontent.com/u/14847115/diff_qgis-gdal/sad69_utm.zip 3) Picture of QGIS with a difference between geometries https://dl.dropboxusercontent.com/u/14847115/diff_qgis-gdal/diff_transform.png The code of python print the two geometries in WKT format. I use the QuickWKT plugin for view these geometries Regards, Luiz Motta ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Difference for transform reference system between QGIS and GDAL
Am 17.01.2014 03:01, schrieb Luiz Motta: Hi all, I had differences for transform the reference system of geometries between GDAL and QGIS. I made the transform using GDAL into geometry with reference system SAD 69 UTM (EPSG 29191) to WGS 84 (EPSG 4326) . When i add in QGIS the geometries with WGS84 and SAD 69 using 'on the fly' (WGS84), has diferences positions of coordinate (see picture). The QGIS reads the reference system of shapefile different than GDAL (see layer property). I would like understand how using GDAL for transform geometries this reference system of this shapefile ? How can difference reading shapefile by QGIS and GDAL ? The shapefiles .prj file has no +towgs84 parameters, so GDAL sets them to zero. QGIS assigns the EPSG:29191 to the file, which has +towgs84 parameters. HTH, André Joost ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer