Changeset 13874
- Timestamp:
- 02/25/08 13:34:26 (5 months ago)
- Files:
-
- spike/grib/gribdataset.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spike/grib/gribdataset.cpp
r13841 r13874 397 397 case GS3_MERCATOR: 398 398 oSRS.SetMercator(meta->gds.meshLat, meta->gds.orientLon, 399 meta->gds.scaleLat1, 400 0.0, 0.0); 399 1.0, 0.0, 0.0); 401 400 break; 402 401 case GS3_POLAR: … … 438 437 NULL, 439 438 "Sphere", 440 a, 0.0, 441 "Greenwich", 0.0, 442 NULL, 0.0); 439 a, 0.0 ); 443 440 } 444 441 else … … 448 445 NULL, 449 446 "Spheroid imported from GRIB file", 450 a, fInv, 451 "Greenwich", 0.0, 452 NULL, 0.0); 447 a, fInv ); 453 448 } 454 449 … … 470 465 rPixelSizeY = geosExtentInMeters / meta->gds.Ny; 471 466 } 472 else 467 else if( oSRS.IsProjected() ) 473 468 { 474 469 rMinX = meta->gds.lon1; // longitude in degrees, to be transformed to meters (or degrees in case of latlon) … … 479 474 if (meta->gds.scan == GRIB2BIT_2) // Y is minY, GDAL wants maxY 480 475 rMaxY += (meta->gds.Ny - 1) * meta->gds.Dy; // -1 because we GDAL needs the coordinates of the centre of the pixel 476 rPixelSizeX = meta->gds.Dx; 477 rPixelSizeY = meta->gds.Dy; 478 } 479 else 480 { 481 rMinX = 0.0; 482 rMaxY = 0.0; 483 484 rPixelSizeX = 1.0; 485 rPixelSizeY = -1.0; 486 487 oSRS.Clear(); 488 489 CPLError( CE_Warning, CPLE_AppDefined, 490 "Unable to perform coordinate transformations, so the correct\n" 491 "projected geotransform could not be deduced from the lat/long\n" 492 "control points. Defaulting to ungeoreferenced." ); 481 493 } 482 494 delete poTransformLLtoSRS; 495 } 496 else 497 { 498 rMinX = meta->gds.lon1; // longitude in degrees, to be transformed to meters (or degrees in case of latlon) 499 rMaxY = meta->gds.lat1; // latitude in degrees, to be transformed to meters 500 501 if (meta->gds.scan == GRIB2BIT_2) // Y is minY, GDAL wants maxY 502 rMaxY += (meta->gds.Ny - 1) * meta->gds.Dy; // -1 because we GDAL needs the coordinates of the centre of the pixel 483 503 rPixelSizeX = meta->gds.Dx; 484 504 rPixelSizeY = meta->gds.Dy; 485 505 } 506 486 507 adfGeoTransform[0] = rMinX; 487 508 adfGeoTransform[3] = rMaxY;
