[Qgis-developer] OGRSpatialReference problem in QGIS

Florian Hillen fhillen at uni-osnabrueck.de
Mon Aug 17 11:38:58 EDT 2009


Hi Jürgen,

thanks for that workaround. It works good, but delivers the same WKT:

PROJCS["unnamed",
GEOGCS["unnamed",
DATUM["unknown",
SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",3500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]


Florian



> Hi Florian,
>
> On Mon, 17. Aug 2009 at 16:42:13 +0200, Florian Hillen wrote:
>>     OGRSpatialReference oSRS;
>>
>>     long epsg = projectSelector->selectedEpsg();
>>
>>     if(epsg == 0)
>>         return false;
>>
>>     if(epsg == 4326)
>>     {
>>         QString epsgString;
>>         epsgString.setNum(epsg);
>>         epsgString.prepend("EPSG:");
>>         oSRS.SetWellKnownGeogCS(epsgString.toUtf8());
>>     }
>>     else
>>     {
>>         oSRS.SetProjCS((projectSelector->selectedName()).toUtf8());
>>         oSRS.importFromProj4((projectSelector->selectedProj4String()).toUtf8());
>>     }
>>
>>     oSRS.exportToWkt( &pszDstWKT );
>
> What about avoiding the problem with something similar to this?
>
> QString wkt = QgsCoordinateReferenceSystem(
> 		projectionSelector->selectedCrsId(),
> 		QgsCoordinateReferenceSystem::InternalCrsId ).toWkt();
>
>
> I would try to avoid the C++-API and use the C-API to avoid ABI headaches.
>
>
> Jürgen
>
> --
> Jürgen E. Fischer         norBIT GmbH               Tel.
> +49-4931-918175-20
> Dipl.-Inf. (FH)           Rheinstraße 13            Fax.
> +49-4931-918175-50
> Software Engineer         D-26506 Norden
> http://www.norbit.de
>
> --
> 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 at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>



More information about the Qgis-developer mailing list