Changeset 13868

Show
Ignore:
Timestamp:
02/23/08 17:33:56 (3 months ago)
Author:
rouault
Message:

Apply gdal-1.6.0-*-20080223.patch series of patches (#2134)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/ogr/ogr_spatialref.h

    r13482 r13868  
    307307                             double dfFalseEasting, double dfFalseNorthing ); 
    308308 
    309     /** Equidistant Cylindrical Sphere */ 
    310     OGRErr      SetEquidistantCylindricalSphere(double dfCenterLat, double dfCenterLong, 
    311                             double dfScale, 
    312                             double dfFalseEasting, double dfFalseNorthing ); 
    313  
    314309    /** Equirectangular */ 
    315310    OGRErr      SetEquirectangular(double dfCenterLat, double dfCenterLong, 
    316311                            double dfFalseEasting, double dfFalseNorthing ); 
     312    /** Equirectangular generalized form : */ 
     313    OGRErr      SetEquirectangular2( double dfCenterLat, double dfCenterLong, 
     314                                     double dfPseudoStdParallel1, 
     315                                     double dfFalseEasting, double dfFalseNorthing ); 
    317316 
    318317    /** Geostationary Satellite */ 
  • trunk/gdal/ogr/ogr_srs_api.h

    r13719 r13868  
    9797#define SRS_PT_EQUIDISTANT_CONIC                                        \ 
    9898                                "Equidistant_Conic" 
    99 #define SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE                            \ 
    100                                 "Equidistant_Cylindrical_Sphere" 
    10199#define SRS_PT_EQUIRECTANGULAR  "Equirectangular" 
    102100#define SRS_PT_GALL_STEREOGRAPHIC                                       \ 
     
    392390                       double dfFalseEasting, double dfFalseNorthing ); 
    393391 
    394 /** Equidistant Cylindrical Sphere */ 
    395 OGRErr CPL_DLL OSRSetEquidistantCylindricalSphere( OGRSpatialReferenceH hSRS, 
    396                                   double dfCenterLat, double dfCenterLong, 
    397                                   double dfScale, 
    398                                   double dfFalseEasting, 
    399                                   double dfFalseNorthing ); 
    400  
    401392/** Eckert I-VI */ 
    402393OGRErr CPL_DLL OSRSetEckert( OGRSpatialReferenceH hSRS,  int nVariation, 
     
    417408                              double dfFalseEasting, double dfFalseNorthing ); 
    418409 
     410/** Equirectangular generalized form */ 
     411OGRErr CPL_DLL OSRSetEquirectangular2( OGRSpatialReferenceH hSRS, 
     412                              double dfCenterLat, double dfCenterLong, 
     413                              double dfPseudoStdParallel1, 
     414                              double dfFalseEasting, 
     415                              double dfFalseNorthing ); 
     416 
    419417/** Gall Stereograpic */ 
    420418OGRErr CPL_DLL OSRSetGS( OGRSpatialReferenceH hSRS, double dfCentralMeridian, 
     
    430428                           double dfFalseEasting, double dfFalseNorthing ); 
    431429 
    432 /** GaussLabordeReunion */     
     430/** Gauss Laborde Reunion */     
    433431OGRErr CPL_DLL OSRSetGaussLabordeReunion( OGRSpatialReferenceH hSRS, 
    434432                                  double dfCenterLat, double dfCenterLong, 
  • trunk/gdal/ogr/ogr_srs_proj4.cpp

    r13719 r13868  
    490490    else if( EQUAL(pszProj,"eqc") ) 
    491491    { 
    492         SetEquirectangular( OSR_GDV( papszNV, "lat_ts", 0.0 ),  
    493                             OSR_GDV( papszNV, "lon_0", 0.0 ),  
    494                             OSR_GDV( papszNV, "x_0", 0.0 ),  
    495                             OSR_GDV( papszNV, "y_0", 0.0 ) ); 
    496     } 
    497  
    498     else if( EQUAL(pszProj,"eqr") ) 
    499     { 
    500         SetEquidistantCylindricalSphere( OSR_GDV( papszNV, "lat_ts", 0.0 ), 
    501                                          OSR_GDV( papszNV, "lon_0", 0.0 )+dfFromGreenwich, 
    502                                          OSR_GDV( papszNV, "k_0", 6378137.0 ), 
    503                                          OSR_GDV( papszNV, "x_0", 0.0 ), 
    504                                          OSR_GDV( papszNV, "y_0", 0.0 ) ); 
     492        if( OSR_GDV( papszNV, "lat_0", 0.0 ) != OSR_GDV( papszNV, "lat_ts", 0.0 ) ) 
     493          SetEquirectangular2( OSR_GDV( papszNV, "lat_0", 0.0 ), 
     494                               OSR_GDV( papszNV, "lon_0", 0.0 )+dfFromGreenwich, 
     495                               OSR_GDV( papszNV, "lat_ts", 0.0 ), 
     496                               OSR_GDV( papszNV, "x_0", 0.0 ), 
     497                               OSR_GDV( papszNV, "y_0", 0.0 ) ); 
     498        else 
     499          SetEquirectangular( OSR_GDV( papszNV, "lat_ts", 0.0 ), 
     500                              OSR_GDV( papszNV, "lon_0", 0.0 )+dfFromGreenwich, 
     501                              OSR_GDV( papszNV, "x_0", 0.0 ), 
     502                              OSR_GDV( papszNV, "y_0", 0.0 ) ); 
    505503    } 
    506504 
     
    12291227    } 
    12301228 
    1231     else if( EQUAL(pszProjection,SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE) ) 
    1232     { 
    1233         sprintf( szProj4+strlen(szProj4), 
    1234                  "+proj=eqr +lat_ts=%.16g +lon_0=%.16g +k_0=%.16g +x_0=%.16g +y_0=%.16g ", 
    1235                  GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), 
    1236                  GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), 
    1237                  GetNormProjParm(SRS_PP_SCALE_FACTOR,6378137.0), 
    1238                  GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), 
    1239                  GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0) ); 
    1240     } 
    1241  
    12421229    else if( EQUAL(pszProjection,SRS_PT_EQUIRECTANGULAR) ) 
    12431230    { 
    12441231        sprintf( szProj4+strlen(szProj4), 
    1245                  "+proj=eqc +lat_ts=%.16g +lon_0=%.16g +x_0=%.16g +y_0=%.16g ", 
     1232                 "+proj=eqc +lat_ts=%.16g +lat_0=%.16g +lon_0=%.16g +x_0=%.16g +y_0=%.16g ", 
     1233                 GetNormProjParm(SRS_PP_PSEUDO_STD_PARALLEL_1, 
     1234                                 GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0)), 
    12461235                 GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), 
    12471236                 GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), 
  • trunk/gdal/ogr/ogrspatialreference.cpp

    r13859 r13868  
    31973197 
    31983198/************************************************************************/ 
    3199 /*                         SetEquidistantCylindricalSphere()            */ 
    3200 /************************************************************************/ 
    3201  
    3202 OGRErr OGRSpatialReference::SetEquidistantCylindricalSphere( 
    3203                                    double dfCenterLat, double dfCenterLong, 
    3204                                    double dfScale, 
    3205                                    double dfFalseEasting, 
    3206                                    double dfFalseNorthing ) 
    3207  
    3208 { 
    3209     SetProjection( SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE ); 
    3210     SetNormProjParm( SRS_PP_LATITUDE_OF_ORIGIN, dfCenterLat ); 
    3211     SetNormProjParm( SRS_PP_CENTRAL_MERIDIAN, dfCenterLong ); 
    3212     SetNormProjParm( SRS_PP_SCALE_FACTOR, dfScale ); 
    3213     SetNormProjParm( SRS_PP_FALSE_EASTING, dfFalseEasting ); 
    3214     SetNormProjParm( SRS_PP_FALSE_NORTHING, dfFalseNorthing ); 
    3215  
    3216     return OGRERR_NONE; 
    3217 } 
    3218  
    3219 /************************************************************************/ 
    3220 /*                       OSRSetEquidistantCylindricalSphere()           */ 
    3221 /************************************************************************/ 
    3222  
    3223 OGRErr OSRSetEquidistantCylindricalSphere( OGRSpatialReferenceH hSRS, 
    3224                                   double dfCenterLat, double dfCenterLong, 
    3225                                   double dfScale, 
    3226                                   double dfFalseEasting, 
    3227                                   double dfFalseNorthing ) 
    3228  
    3229 { 
    3230     return ((OGRSpatialReference *) hSRS)->SetEquidistantCylindricalSphere( 
    3231         dfCenterLat, dfCenterLong, dfScale, 
    3232         dfFalseEasting, dfFalseNorthing ); 
    3233 } 
    3234  
    3235 /************************************************************************/ 
    32363199/*                         SetEquirectangular()                         */ 
    32373200/************************************************************************/ 
     
    32483211    SetNormProjParm( SRS_PP_FALSE_EASTING, dfFalseEasting ); 
    32493212    SetNormProjParm( SRS_PP_FALSE_NORTHING, dfFalseNorthing ); 
     3213    SetNormProjParm( SRS_PP_PSEUDO_STD_PARALLEL_1, dfCenterLat ); 
    32503214 
    32513215    return OGRERR_NONE; 
     
    32663230    return ((OGRSpatialReference *) hSRS)->SetEquirectangular(  
    32673231        dfCenterLat, dfCenterLong,  
     3232        dfFalseEasting, dfFalseNorthing ); 
     3233} 
     3234 
     3235/************************************************************************/ 
     3236/*                         SetEquirectangular2()                        */ 
     3237/* Generalized form                                                     */ 
     3238/************************************************************************/ 
     3239 
     3240OGRErr OGRSpatialReference::SetEquirectangular2( 
     3241                                   double dfCenterLat, double dfCenterLong, 
     3242                                   double dfPseudoStdParallel1, 
     3243                                   double dfFalseEasting, 
     3244                                   double dfFalseNorthing ) 
     3245 
     3246{ 
     3247    SetProjection( SRS_PT_EQUIRECTANGULAR ); 
     3248    SetNormProjParm( SRS_PP_LATITUDE_OF_ORIGIN, dfCenterLat ); 
     3249    SetNormProjParm( SRS_PP_CENTRAL_MERIDIAN, dfCenterLong ); 
     3250    SetNormProjParm( SRS_PP_FALSE_EASTING, dfFalseEasting ); 
     3251    SetNormProjParm( SRS_PP_FALSE_NORTHING, dfFalseNorthing ); 
     3252    SetNormProjParm( SRS_PP_PSEUDO_STD_PARALLEL_1, dfPseudoStdParallel1 ); 
     3253 
     3254    return OGRERR_NONE; 
     3255} 
     3256 
     3257/************************************************************************/ 
     3258/*                       OSRSetEquirectangular2()                       */ 
     3259/************************************************************************/ 
     3260 
     3261OGRErr OSRSetEquirectangular2( OGRSpatialReferenceH hSRS,  
     3262                               double dfCenterLat, double dfCenterLong, 
     3263                               double dfPseudoStdParallel1, 
     3264                               double dfFalseEasting, 
     3265                               double dfFalseNorthing ) 
     3266     
     3267{ 
     3268    VALIDATE_POINTER1( hSRS, "OSRSetEquirectangular", CE_Failure ); 
     3269 
     3270    return ((OGRSpatialReference *) hSRS)->SetEquirectangular2(  
     3271        dfCenterLat, dfCenterLong,  
     3272        dfPseudoStdParallel1, 
    32683273        dfFalseEasting, dfFalseNorthing ); 
    32693274} 
  • trunk/gdal/swig/include/osr.i

    r13719 r13868  
    5454%constant char *SRS_PT_ECKERT_VI                = SRS_PT_ECKERT_VI; 
    5555%constant char *SRS_PT_EQUIDISTANT_CONIC        = SRS_PT_EQUIDISTANT_CONIC; 
    56 %constant char *SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE = SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE; 
    5756%constant char *SRS_PT_EQUIRECTANGULAR          = SRS_PT_EQUIRECTANGULAR; 
    5857%constant char *SRS_PT_GALL_STEREOGRAPHIC       = SRS_PT_GALL_STEREOGRAPHIC; 
     
    452451  } 
    453452 
    454 %feature( "kwargs" ) SetEquidistantCylindricalSphere; 
    455   OGRErr SetEquidistantCylindricalSphere( double clat, double clong, double sc, double fe, double fn ) { 
    456     return OSRSetEquidistantCylindricalSphere( self, clat, clong, sc, fe, fn ); 
     453%feature( "kwargs" ) SetEquirectangular2; 
     454  OGRErr SetEquirectangular2( double clat, double clong, 
     455                              double pseudostdparallellat, 
     456                              double fe, double fn ) { 
     457    return OSRSetEquirectangular2( self, clat, clong, 
     458                                   pseudostdparallellat, 
     459                                   fe, fn ); 
    457460  } 
    458461