Ticket #2134: gdal-1.6.0-eqc-glabsgm.patch
| File gdal-1.6.0-eqc-glabsgm.patch, 15.1 kB (added by dgrichard, 4 months ago) |
|---|
-
gdal-trunk/ogr/ogrspatialreference.cpp
old new 3172 3172 } 3173 3173 3174 3174 /************************************************************************/ 3175 /* SetEqui distantCylindricalSphere()*/3175 /* SetEquirectangular() */ 3176 3176 /************************************************************************/ 3177 3177 3178 OGRErr OGRSpatialReference::SetEqui distantCylindricalSphere(3178 OGRErr OGRSpatialReference::SetEquirectangular( 3179 3179 double dfCenterLat, double dfCenterLong, 3180 double dfScale,3181 3180 double dfFalseEasting, 3182 3181 double dfFalseNorthing ) 3183 3182 3184 3183 { 3185 SetProjection( SRS_PT_EQUI DISTANT_CYLINDRICAL_SHERE);3184 SetProjection( SRS_PT_EQUIRECTANGULAR ); 3186 3185 SetNormProjParm( SRS_PP_LATITUDE_OF_ORIGIN, dfCenterLat ); 3187 3186 SetNormProjParm( SRS_PP_CENTRAL_MERIDIAN, dfCenterLong ); 3188 SetNormProjParm( SRS_PP_SCALE_FACTOR, dfScale );3189 3187 SetNormProjParm( SRS_PP_FALSE_EASTING, dfFalseEasting ); 3190 3188 SetNormProjParm( SRS_PP_FALSE_NORTHING, dfFalseNorthing ); 3189 SetNormProjParm( SRS_PP_PSEUDO_STD_PARALLEL_1, dfCenterLat ); 3191 3190 3192 3191 return OGRERR_NONE; 3193 3192 } 3194 3193 3195 3194 /************************************************************************/ 3196 /* OSRSetEqui distantCylindricalSphere()*/3195 /* OSRSetEquirectangular() */ 3197 3196 /************************************************************************/ 3198 3197 3199 OGRErr OSRSetEquidistantCylindricalSphere( OGRSpatialReferenceH hSRS, 3200 double dfCenterLat, double dfCenterLong, 3201 double dfScale, 3202 double dfFalseEasting, 3203 double dfFalseNorthing ) 3204 3198 OGRErr OSRSetEquirectangular( OGRSpatialReferenceH hSRS, 3199 double dfCenterLat, double dfCenterLong, 3200 double dfFalseEasting, 3201 double dfFalseNorthing ) 3202 3205 3203 { 3206 return ((OGRSpatialReference *) hSRS)->SetEquidistantCylindricalSphere( 3207 dfCenterLat, dfCenterLong, dfScale, 3204 VALIDATE_POINTER1( hSRS, "OSRSetEquirectangular", CE_Failure ); 3205 3206 return ((OGRSpatialReference *) hSRS)->SetEquirectangular( 3207 dfCenterLat, dfCenterLong, 3208 3208 dfFalseEasting, dfFalseNorthing ); 3209 3209 } 3210 3210 3211 3211 /************************************************************************/ 3212 /* SetEquirectangular() */ 3212 /* SetEquirectangular2() */ 3213 /* Generalized form */ 3213 3214 /************************************************************************/ 3214 3215 3215 OGRErr OGRSpatialReference::SetEquirectangular (3216 OGRErr OGRSpatialReference::SetEquirectangular2( 3216 3217 double dfCenterLat, double dfCenterLong, 3218 double dfPseudoStdParallel1, 3217 3219 double dfFalseEasting, 3218 3220 double dfFalseNorthing ) 3219 3221 … … 3223 3225 SetNormProjParm( SRS_PP_CENTRAL_MERIDIAN, dfCenterLong ); 3224 3226 SetNormProjParm( SRS_PP_FALSE_EASTING, dfFalseEasting ); 3225 3227 SetNormProjParm( SRS_PP_FALSE_NORTHING, dfFalseNorthing ); 3228 SetNormProjParm( SRS_PP_PSEUDO_STD_PARALLEL_1, dfPseudoStdParallel1 ); 3226 3229 3227 3230 return OGRERR_NONE; 3228 3231 } 3229 3232 3230 3233 /************************************************************************/ 3231 /* OSRSetEquirectangular ()*/3234 /* OSRSetEquirectangular2() */ 3232 3235 /************************************************************************/ 3233 3236 3234 OGRErr OSRSetEquirectangular( OGRSpatialReferenceH hSRS, 3235 double dfCenterLat, double dfCenterLong, 3236 double dfFalseEasting, 3237 double dfFalseNorthing ) 3237 OGRErr OSRSetEquirectangular2( OGRSpatialReferenceH hSRS, 3238 double dfCenterLat, double dfCenterLong, 3239 double dfPseudoStdParallel1, 3240 double dfFalseEasting, 3241 double dfFalseNorthing ) 3238 3242 3239 3243 { 3240 3244 VALIDATE_POINTER1( hSRS, "OSRSetEquirectangular", CE_Failure ); 3241 3245 3242 return ((OGRSpatialReference *) hSRS)->SetEquirectangular (3246 return ((OGRSpatialReference *) hSRS)->SetEquirectangular2( 3243 3247 dfCenterLat, dfCenterLong, 3248 dfPseudoStdParallel1, 3244 3249 dfFalseEasting, dfFalseNorthing ); 3245 3250 } 3246 3251 -
gdal-trunk/ogr/ogr_spatialref.h
old new 306 306 OGRErr SetEckertVI( double dfCentralMeridian, 307 307 double dfFalseEasting, double dfFalseNorthing ); 308 308 309 /** Equidistant Cylindrical Sphere */310 OGRErr SetEquidistantCylindricalSphere(double dfCenterLat, double dfCenterLong,311 double dfScale,312 double dfFalseEasting, double dfFalseNorthing );313 314 309 /** Equirectangular */ 315 310 OGRErr SetEquirectangular(double dfCenterLat, double dfCenterLong, 316 311 double dfFalseEasting, double dfFalseNorthing ); 312 /** Equirectangular generalized form : */ 313 OGRErr SetEquirectangular2( double dfCenterLat, double dfCenterLong, 314 double dfPseudoStdParallel1, 315 double dfFalseEasting, double dfFalseNorthing ); 317 316 318 317 /** Geostationary Satellite */ 319 318 OGRErr SetGEOS( double dfCentralMeridian, double dfSatelliteHeight, -
gdal-trunk/ogr/ogr_srs_api.h
old new 96 96 #define SRS_PT_ECKERT_VI "Eckert_VI" 97 97 #define SRS_PT_EQUIDISTANT_CONIC \ 98 98 "Equidistant_Conic" 99 #define SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE \100 "Equidistant_Cylindrical_Sphere"101 99 #define SRS_PT_EQUIRECTANGULAR "Equirectangular" 102 100 #define SRS_PT_GALL_STEREOGRAPHIC \ 103 101 "Gall_Stereographic" … … 389 387 double dfCenterLat, double dfCenterLong, 390 388 double dfFalseEasting, double dfFalseNorthing ); 391 389 392 /** Equidistant Cylindrical Sphere */393 OGRErr CPL_DLL OSRSetEquidistantCylindricalSphere( OGRSpatialReferenceH hSRS,394 double dfCenterLat, double dfCenterLong,395 double dfScale,396 double dfFalseEasting,397 double dfFalseNorthing );398 399 390 /** Eckert I-VI */ 400 391 OGRErr CPL_DLL OSRSetEckert( OGRSpatialReferenceH hSRS, int nVariation, 401 392 double dfCentralMeridian, … … 414 405 double dfCenterLat, double dfCenterLong, 415 406 double dfFalseEasting, double dfFalseNorthing ); 416 407 408 /** Equirectangular generalized form */ 409 OGRErr CPL_DLL OSRSetEquirectangular2( OGRSpatialReferenceH hSRS, 410 double dfCenterLat, double dfCenterLong, 411 double dfPseudoStdParallel1, 412 double dfFalseEasting, 413 double dfFalseNorthing ); 414 417 415 /** Gall Stereograpic */ 418 416 OGRErr CPL_DLL OSRSetGS( OGRSpatialReferenceH hSRS, double dfCentralMeridian, 419 417 double dfFalseEasting, double dfFalseNorthing ); … … 427 425 double dfCentralMeridian, double dfSatelliteHeight, 428 426 double dfFalseEasting, double dfFalseNorthing ); 429 427 430 /** Gauss LabordeReunion */428 /** Gauss Laborde Reunion */ 431 429 OGRErr CPL_DLL OSRSetGaussLabordeReunion( OGRSpatialReferenceH hSRS, 432 430 double dfCenterLat, double dfCenterLong, 433 431 double dfScale, -
gdal-trunk/ogr/ogr_srs_proj4.cpp
old new 480 480 481 481 else if( EQUAL(pszProj,"eqc") ) 482 482 { 483 SetEquirectangular( OSR_GDV( papszNV, "lat_ts", 0.0 ), 484 OSR_GDV( papszNV, "lon_0", 0.0 ), 485 OSR_GDV( papszNV, "x_0", 0.0 ), 486 OSR_GDV( papszNV, "y_0", 0.0 ) ); 487 } 488 489 else if( EQUAL(pszProj,"eqr") ) 490 { 491 SetEquidistantCylindricalSphere( OSR_GDV( papszNV, "lat_ts", 0.0 ), 492 OSR_GDV( papszNV, "lon_0", 0.0 )+dfFromGreenwich, 493 OSR_GDV( papszNV, "k_0", 6378137.0 ), 494 OSR_GDV( papszNV, "x_0", 0.0 ), 495 OSR_GDV( papszNV, "y_0", 0.0 ) ); 483 if( OSR_GDV( papszNV, "lat_0", 0.0 ) != OSR_GDV( papszNV, "lat_ts", 0.0 ) ) 484 SetEquirectangular2( OSR_GDV( papszNV, "lat_ts", 0.0 ), 485 OSR_GDV( papszNV, "lon_0", 0.0 )+dfFromGreenwich, 486 OSR_GDV( papszNV, "lat_ts", 0.0 ), 487 OSR_GDV( papszNV, "x_0", 0.0 ), 488 OSR_GDV( papszNV, "y_0", 0.0 ) ); 489 else 490 SetEquirectangular( OSR_GDV( papszNV, "lat_ts", 0.0 ), 491 OSR_GDV( papszNV, "lon_0", 0.0 )+dfFromGreenwich, 492 OSR_GDV( papszNV, "x_0", 0.0 ), 493 OSR_GDV( papszNV, "y_0", 0.0 ) ); 496 494 } 497 495 498 496 else if( EQUAL(pszProj,"glabsgm") ) … … 1219 1217 GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0) ); 1220 1218 } 1221 1219 1222 else if( EQUAL(pszProjection,SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE) )1223 {1224 sprintf( szProj4+strlen(szProj4),1225 "+proj=eqr +lat_ts=%.16g +lon_0=%.16g +k_0=%.16g +x_0=%.16g +y_0=%.16g ",1226 GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0),1227 GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0),1228 GetNormProjParm(SRS_PP_SCALE_FACTOR,6378137.0),1229 GetNormProjParm(SRS_PP_FALSE_EASTING,0.0),1230 GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0) );1231 }1232 1233 1220 else if( EQUAL(pszProjection,SRS_PT_EQUIRECTANGULAR) ) 1234 1221 { 1235 1222 sprintf( szProj4+strlen(szProj4), 1236 "+proj=eqc +lat_ts=%.16g +lon_0=%.16g +x_0=%.16g +y_0=%.16g ", 1223 "+proj=eqc +lat_ts=%.16g +lat_0=%.16g +lon_0=%.16g +x_0=%.16g +y_0=%.16g ", 1224 GetNormProjParm(SRS_PP_PSEUDO_STD_PARALLEL_1, 1225 GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0)), 1237 1226 GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), 1238 1227 GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), 1239 1228 GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), -
gdal-trunk/swig/include/csharp/ogr_srs_const.h
old new 51 51 #define SRS_PT_EQUIDISTANT_CONIC "Equidistant_Conic" 52 52 #define SRS_PT_EQUIRECTANGULAR "Equirectangular" 53 53 #define SRS_PT_GALL_STEREOGRAPHIC "Gall_Stereographic" 54 #define SRS_PT_GAUSSLABORDEREUNION \ 55 "Gauss_Laborde_Sphere_Geometric_Mean" 54 56 #define SRS_PT_GEOSTATIONARY_SATELLITE "Geostationary_Satellite" 55 57 #define SRS_PT_GOODE_HOMOLOSINE "Goode_Homolosine" 56 58 #define SRS_PT_GNOMONIC "Gnomonic" -
gdal-trunk/swig/include/osr.i
old new 54 54 %constant char *SRS_PT_ECKERT_IV = SRS_PT_ECKERT_IV; 55 55 %constant char *SRS_PT_ECKERT_VI = SRS_PT_ECKERT_VI; 56 56 %constant char *SRS_PT_EQUIDISTANT_CONIC = SRS_PT_EQUIDISTANT_CONIC; 57 %constant char *SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE = SRS_PT_EQUIDISTANT_CYLINDRICAL_SHERE;58 57 %constant char *SRS_PT_EQUIRECTANGULAR = SRS_PT_EQUIRECTANGULAR; 59 58 %constant char *SRS_PT_GALL_STEREOGRAPHIC = SRS_PT_GALL_STEREOGRAPHIC; 60 59 %constant char *SRS_PT_GAUSSLABORDEREUNION = SRS_PT_GAUSSLABORDEREUNION; … … 448 447 fe, fn ); 449 448 } 450 449 451 %feature( "kwargs" ) SetEquidistantCylindricalSphere; 452 OGRErr SetEquidistantCylindricalSphere( double clat, double clong, double sc, double fe, double fn ) { 453 return OSRSetEquidistantCylindricalSphere( self, clat, clong, sc, fe, fn ); 454 } 450 %feature( "kwargs" ) SetEquirectangular2; 451 OGRErr SetEquirectangular2( double clat, double clong, 452 double pseudostdparallellat, 453 double fe, double fn ) { 454 return OSRSetEquirectangular2( self, clat, clong, 455 pseudostdparallellat, 456 fe, fn ); 455 457 456 458 %feature( "kwargs" ) SetGaussLabordeReunion; 457 459 OGRErr SetGaussLabordeReunion( double clat, double clong, double sc, double fe, double fn ) {
