[Gdal-dev] SRS not properly defined

Petteri Packalen packalen at cs.joensuu.fi
Fri Dec 16 12:10:51 EST 2005


Hi,

I define some projections as follows:

static char kkj3_prj[] = "PROJCS[\"Finland_Zone_3\",GEOGCS ...
static char euref_fin_prj[] = "PROJCS[\"EUREF_FIN_TM35FIN\",GEOGCS[ ...

Then I set projection :

                 /*  Imports above wkt string   */
    char *prj =  GetWktProjectionString( prProj );

    if ( pDS->SetProjection( prj ) == CE_Failure )
    {
       printf( "\nERROR: SetProjection failed.\n" );
       exit( 1 );
    }

Then I print:

    printf( "\n%s\n", pDS->GetProjectionRef() );

Projection WKT is *always* printed properly. However, projection is saved 
into file only in the case of euref_fin-projection. Other projection 
deinitions are not saved into the output file. The wkt which succeeds is 
the only one that is not (yet) widely used - therefore it does not exists 
e.g. in the EPSG library (not at least last time I checked). I'm rather 
sure my wkt strings are correct. I have used these already some years 
such a manner that I save a string into prj file without any problem. 
Wkt strings are copied from ESRI prj files.

I have also tested 'oSRS.Validate()' and it succeeds. Any hints?

Regards,
Petteri

=========================================================================
Petteri Packalén                   "There are two major products that
University of Joensuu               came out of Berkeley: LSD and UNIX.
Faculty of Forestry                 We don't believe this to be a
P.O. Box 111                        coincidence."  -- J.S. Anderson
80101 Joensuu
Finland                            "There still remains a question: Which
e-mail: packalen at cs.joensuu.fi      caused the other?"
=========================================================================


More information about the Gdal-dev mailing list