43 #include <geo_normalize.h> 44 #include <geovalues.h> 55 #ifdef OSSIM_ID_ENABLED 56 static const char OSSIM_ID[] =
"$Id: ossimGeoTiff.cpp 21024 2012-05-30 08:45:13Z dburken $";
62 static ossimTrace traceDebug(
"ossimGeoTiff:debug");
95 theGeoKeysPresentFlag(false),
98 theDoubleParamLength(0),
99 theAsciiParamLength(0),
100 theProjectionName(
"unknown"),
101 theDatumName(
"unknown"),
111 theCoorTransGeoCode(0),
117 theFalseEasting(0.0),
118 theFalseNorthing(0.0),
132 theGeoKeysPresentFlag(false),
135 theDoubleParamLength(0),
136 theAsciiParamLength(0),
137 theProjectionName(
"unknown"),
138 theDatumName(
"unknown"),
148 theCoorTransGeoCode(0),
154 theFalseEasting(0.0),
155 theFalseNorthing(0.0),
162 <<
"DEBUG ossimGeoTiff::ossimGeoTiff: Entered..." << std::endl;
163 #ifdef OSSIM_ID_ENABLED 165 <<
"DEBUG ossimGeoTiff::ossimGeoTiff: OSSIM_ID = " 170 if(
readTags(file, entryIdx) ==
false)
176 <<
"DEBUG ossimGeoTiff::ossimGeoTiff: " 177 <<
"Unable to reade tags." 181 <<
"FATAL ossimGeoTiff::ossimGeoTiff: " 182 <<
"Unable to reade tags." 237 #define EPSG_CODE_MAX 32767 240 bool imagineNad27Flag)
242 std::lock_guard<std::mutex> lock(
theMutex);
246 if(!mapProj)
return false;
248 GTIF* gtif = GTIFNew(tifPtr);
261 bool gcsTypeSet =
false;
298 datum_code = (int) datum->
epsgCode();
305 GTIFKeySet(gtif, GeographicTypeGeoKey, TYPE_SHORT, 1, pcsCode);
307 GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1, datum_code);
308 GTIFKeySet(gtif, ProjectionGeoKey , TYPE_SHORT, 1, pcsCode);
309 GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT, 1, ellipsoid_code);
310 GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, pcsCode);
320 datumCode = datum->
code();
321 datumName = datum->
name();
326 if (datumCode ==
"WGE") gcs = GCS_WGS_84;
327 else if (datumCode ==
"WGD") gcs = GCS_WGS_72;
328 else if (datumCode ==
"NAR-C") gcs = GCS_NAD83;
329 else if (datumCode ==
"NAR") gcs = GCS_NAD83;
330 else if (datumCode ==
"NAS-C") gcs = GCS_NAD27;
331 else if (datumCode ==
"NAS") gcs = GCS_NAD27;
332 else if (datumCode ==
"ADI-M") gcs = GCS_Adindan;
333 else if (datumCode ==
"ARF-M") gcs = GCS_Arc_1950;
334 else if (datumCode ==
"ARS-M") gcs = GCS_Arc_1960;
335 else if (datumCode ==
"EUR-7" || datumCode ==
"EUR-M") gcs = GCS_ED50;
336 else if ((datumCode ==
"OGB-7") ||
337 (datumCode ==
"OGB-M") ||
338 (datumCode ==
"OGB-A") ||
339 (datumCode ==
"OGB-B") ||
340 (datumCode ==
"OGB-C") ||
341 (datumCode ==
"OGB-D")) gcs = GCS_OSGB_1936;
342 else if (datumCode ==
"TOY-M") gcs = GCS_Tokyo;
343 else if(datumCode ==
"6055") gcs = 3785;
349 <<
"DATUM = " << datumCode <<
" tag not written " << std::endl
350 <<
"Please let us know so we can add it" << std::endl;
360 if((datumCode ==
"NAS-C") && imagineNad27Flag)
365 os <<
"IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 21024 $ $Date: 2012-05-30 04:45:13 -0400 (Wed, 30 May 2012) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)";
374 GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,
377 GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT, 1,
382 GTIFKeySet( gtif, GeographicTypeGeoKey, TYPE_SHORT, 1, gcs );
388 bool setFalseEastingNorthingFlag =
false;
390 if ( projName ==
"ossimUtmProjection" )
420 if ( hemisphere ==
"N" )
431 ProjectedCSTypeGeoKey,
440 GeographicTypeGeoKey,
454 os <<
"UTM Zone " << dec <<
mapZone << hemisphere.
c_str()
455 <<
" with " << datumName <<
" datum";
465 else if(projName ==
"ossimBngProjection")
468 GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
472 GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1,
479 "PCS_British_National_Grid");
482 ProjCoordTransGeoKey,
485 (uint16)CT_TransverseMercator);
488 ProjNatOriginLongGeoKey,
494 ProjNatOriginLatGeoKey,
499 setFalseEastingNorthingFlag =
true;
504 ProjScaleAtNatOriginGeoKey,
509 else if( projName ==
"ossimSinusoidalProjection")
512 ProjCoordTransGeoKey,
515 (uint16)CT_Sinusoidal);
518 ProjNatOriginLongGeoKey,
524 ProjNatOriginLatGeoKey,
529 setFalseEastingNorthingFlag =
true;
531 else if( (projName ==
"ossimEquDistCylProjection")||
532 (projName ==
"ossimLlxyProjection"))
535 ProjNatOriginLongGeoKey,
541 ProjNatOriginLatGeoKey,
546 else if ( (projName ==
"ossimLambertConformalConicProjection") ||
547 (projName ==
"ossimAlbersProjection") )
573 if (projName ==
"ossimLambertConformalConicProjection")
576 ProjCoordTransGeoKey,
579 (uint16)CT_LambertConfConic_2SP );
584 ProjCoordTransGeoKey,
587 (uint16)CT_AlbersEqualArea);
591 GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
595 GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1,
601 ProjStdParallel1GeoKey,
609 ProjStdParallel2GeoKey,
615 ProjCenterLongGeoKey,
621 ProjNatOriginLatGeoKey,
626 setFalseEastingNorthingFlag =
true;
631 else if ( projName ==
"ossimMercatorProjection" )
634 ProjCoordTransGeoKey,
637 (uint16)CT_Mercator);
640 ProjNatOriginLongGeoKey,
646 ProjNatOriginLatGeoKey,
651 setFalseEastingNorthingFlag =
true;
656 ProjScaleAtNatOriginGeoKey,
661 else if ( projName ==
"ossimTransMercatorProjection" )
679 ProjCoordTransGeoKey,
682 (uint16)CT_TransverseMercator);
685 GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, KvUserDefined );
688 GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1, KvUserDefined );
691 ProjNatOriginLongGeoKey,
697 ProjNatOriginLatGeoKey,
702 setFalseEastingNorthingFlag =
true;
707 ProjScaleAtNatOriginGeoKey,
713 if (setFalseEastingNorthingFlag ==
true)
717 ProjFalseEastingGeoKey,
723 ProjFalseNorthingGeoKey,
739 ModelTypeGeographic);
743 GeogAngularUnitsGeoKey,
758 ProjLinearUnitsGeoKey,
766 GeogSemiMajorAxisGeoKey,
772 GeogSemiMinorAxisGeoKey,
781 GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsPoint);
786 GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
792 double tiePoints[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
793 double pixScale[3] = { 0.0, 0.0, 0.0 };
837 TIFFSetField( tifPtr, TIFFTAG_GEOTIEPOINTS, 6, tiePoints );
838 TIFFSetField( tifPtr, TIFFTAG_GEOPIXELSCALE, 3, pixScale );
850 std::vector<ossim_uint8>& buf,
869 TIFF* tiff = XTIFFOpen(tmpFile.
c_str(),
"w");
887 TIFFSetField( tiff, TIFFTAG_IMAGEWIDTH, 1 );
888 TIFFSetField( tiff, TIFFTAG_IMAGELENGTH, 1 );
889 TIFFSetField( tiff, TIFFTAG_BITSPERSAMPLE, 8 );
890 TIFFSetField( tiff, TIFFTAG_SAMPLESPERPIXEL, 1 );
891 TIFFSetField( tiff, TIFFTAG_ROWSPERSTRIP, 1 );
892 TIFFSetField( tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG );
893 TIFFSetField( tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK );
897 TIFFWriteEncodedStrip( tiff, 0, (
char *) &pixel, 1 );
899 TIFFWriteDirectory( tiff );
903 const std::vector<ossim_uint8>::size_type UUID_SIZE = 16;
904 const std::vector<ossim_uint8>::size_type BOX_SIZE = UUID_SIZE +
905 static_cast<std::vector<ossim_uint8>::size_type
>(tmpFile.
fileSize());
908 buf.resize( BOX_SIZE );
910 if ( BOX_SIZE == buf.size() )
914 0xb1, 0x4b, 0xf8, 0xbd,
915 0x08, 0x3d, 0x4b, 0x43,
916 0xa5, 0xae, 0x8c, 0xd7,
917 0xd5, 0xa6, 0xce, 0x03
921 std::vector<ossim_uint8>::size_type i;
922 for (i = 0; i < UUID_SIZE; ++i)
924 buf[i] = GEOTIFF_UUID[i];
929 str.open(tmpFile.
c_str(), ios::in | ios::binary);
933 for (; i < BOX_SIZE; ++i)
956 <<
"ossimGeoTiff::writeJp2GeotiffBox ERROR:\n" 957 <<
"Could not open " << tmpFile << std::endl;
967 TIFF* tiff = XTIFFOpen(file.
c_str(),
"r");
970 result =
readTags(tiff, entryIdx,
true);
978 std::lock_guard<std::mutex> lock(
theMutex);
980 if(!state)
return false;
982 if(!state->checkBool(entryIdx,
"is_geotiff"))
987 theLength = state->getImageLength(entryIdx);
988 theWidth = state->getImageWidth(entryIdx);
1005 <<
" WARNING ossimGeoTiff::addImageGeometry:" 1006 <<
"The angular units (key 2054) is set to ANGULAR_DMS_HEMISPHERE!" 1007 <<
"\nAssuming \"Angular_Degree\"..." << std::endl;
1012 if (state->getValue(value, entryIdx,
"tifftag.pcs_code"))
1024 if(state->getValue(gTCitation, entryIdx,
"tifftag.citation"))
1031 if ( projStr.
empty() == false )
1043 state->getValue(
thePcsCitation, entryIdx,
"tifftag.pcs_citation");
1044 if(state->getValue(value, entryIdx,
"tifftag.coord_trans_code"))
1048 if(state->getValue(value, entryIdx,
"tifftag.std_parallel_1"))
1052 if(state->getValue(value, entryIdx,
"tifftag.std_parallel_2"))
1056 if(state->getValue(value, entryIdx,
"tifftag.origin_lon"))
1060 else if(state->getValue(value, entryIdx,
"tifftag.center_lon"))
1064 else if(state->getValue(value, entryIdx,
"tifftag.false_origin_lon"))
1068 else if(state->getValue(value, entryIdx,
"tifftag.straight_vert_pole_lon"))
1073 if(state->getValue(value, entryIdx,
"tifftag.origin_lat"))
1077 else if(state->getValue(value, entryIdx,
"tifftag.center_lat"))
1081 else if(state->getValue(value, entryIdx,
"tifftag.false_origin_lat"))
1086 if(state->getValue(value, entryIdx,
"tifftag.false_easting"))
1090 if(state->getValue(value, entryIdx,
"tifftag.false_northing"))
1094 if(state->getValue(value, entryIdx,
"tifftag.scale_factor"))
1099 if(state->getGeoPixelScale(
theScale, entryIdx))
1114 state->getValue(
theAsciiParam, entryIdx,
"tifftag.geo_ascii_params");
1125 std::lock_guard<std::mutex> lock(
theMutex);
1137 GTIF* gtif = GTIFNew(tiff);
1160 <<
"ossimGeoTiff::readTags: Raw Geotiff Tags are\n";
1161 GTIFPrint(gtif,0,0);
1164 TIFFTAG_IMAGELENGTH,
1189 <<
" WARNING ossimGeoTiff::addImageGeometry:" 1190 <<
"The angular units (key 2054) is set to ANGULAR_DMS_HEMISPHERE!" 1191 <<
"\nAssuming \"Angular_Degree\"..." << std::endl;
1198 if(GTIFKeyGet(gtif, GTModelTypeGeoKey, &modelType, 0, 1))
1203 if(GTIFKeyGet(gtif, GTRasterTypeGeoKey, &
theRasterType, 0, 1))
1208 if(GTIFKeyGet(gtif, GeographicTypeGeoKey, &
theGcsCode, 0, 1))
1211 if(GTIFKeyGet(gtif, GeogGeodeticDatumGeoKey, &
theDatumCode, 0, 1))
1219 if (GTIFKeyGet(gtif, ProjectedCSTypeGeoKey, &
thePcsCode, 0, 1))
1228 const int CITATION_STRING_SIZE = 512;
1229 char citationStr[CITATION_STRING_SIZE];
1230 if ( GTIFKeyGet(gtif, GTCitationGeoKey, &citationStr,
1231 0, CITATION_STRING_SIZE))
1240 if ( projStr.
empty() == false )
1253 if(GTIFKeyGet(gtif, PCSCitationGeoKey , &buf, 0, 1))
1262 case ProjStdParallel1GeoKey:
1267 case ProjStdParallel2GeoKey:
1272 case ProjOriginLongGeoKey:
1277 case ProjOriginLatGeoKey:
1282 case ProjFalseEastingGeoKey:
1287 case ProjFalseNorthingGeoKey:
1292 case ProjCenterLongGeoKey:
1297 case ProjCenterLatGeoKey:
1302 case ProjFalseOriginLatGeoKey:
1307 case ProjFalseOriginLongGeoKey:
1308 case ProjStraightVertPoleLongGeoKey:
1313 case ProjScaleAtNatOriginGeoKey:
1322 if(GTIFKeyGet(gtif, ProjStdParallel1GeoKey, &
theStdPar1, 0, 1))
1325 if(GTIFKeyGet(gtif, ProjStdParallel2GeoKey, &
theStdPar2, 0, 1))
1328 if(GTIFKeyGet(gtif, ProjNatOriginLongGeoKey, &tempDouble, 0, 1))
1332 else if(GTIFKeyGet(gtif, ProjOriginLongGeoKey, &tempDouble, 0, 1))
1336 if(GTIFKeyGet(gtif, ProjNatOriginLatGeoKey, &tempDouble, 0, 1))
1340 else if(GTIFKeyGet(gtif, ProjOriginLatGeoKey, &tempDouble, 0, 1))
1350 if(GTIFKeyGet(gtif, ProjCenterLongGeoKey, &theCenterLon, 0, 1))
1353 if(GTIFKeyGet(gtif, ProjCenterLatGeoKey, &theCenterLat, 0, 1))
1356 if(GTIFKeyGet(gtif, ProjScaleAtNatOriginGeoKey, &
theScaleFactor, 0, 1))
1363 if(TIFFGetField(
theTiffPtr, TIFFTAG_GEOPIXELSCALE, &pixScaleSize, &pixScale))
1374 double* tiepoints=0;
1375 if(TIFFGetField(
theTiffPtr, TIFFTAG_GEOTIEPOINTS, &tiePointSize, &tiepoints))
1401 if(TIFFGetField(
theTiffPtr, TIFFTAG_GEOTRANSMATRIX, &transSize, &trans))
1404 trans, trans+transSize);
1417 double* tempDoubleParam = 0;
1419 if(TIFFGetField(
theTiffPtr, TIFFTAG_GEODOUBLEPARAMS, &doubleParamSize, &tempDoubleParam))
1423 tempDoubleParam+doubleParamSize);
1426 char* tempAsciiParam=0;
1431 if(TIFFGetField(
theTiffPtr, TIFFTAG_GEOASCIIPARAMS, &tempAsciiParam))
1458 if(TIFFGetField(
theTiffPtr, TIFFTAG_GEOKEYDIRECTORY, &gkdParamSize, &gkdParams))
1462 for( key=0; key<numKeys; ++key )
1467 if ( gkdParams[loc+1] == TIFFTAG_GEODOUBLEPARAMS &&
1468 gkdParams[loc+2] == 1 &&
1469 ind >= 0 && ind < doubleParamSize )
1472 switch( gkdParams[loc] )
1474 case ProjStdParallel1GeoKey:
theStdPar1 = dval;
break;
1475 case ProjStdParallel2GeoKey:
theStdPar2 = dval;
break;
1476 case ProjNatOriginLongGeoKey:
theOriginLon = dval;
break;
1478 case ProjNatOriginLatGeoKey:
theOriginLat = dval;
break;
1482 case ProjCenterLongGeoKey: theCenterLon = dval;
break;
1483 case ProjCenterLatGeoKey: theCenterLat = dval;
break;
1489 <<
"ossimGeoTiff::readTags: Unrecognized geokey directory entry." 1490 <<
"\ngeokey directory index = " << loc
1491 <<
"\ngeokey = " << gkdParams[loc]
1492 <<
"\ndouble array index = " << ind
1493 <<
"\ndval = " << dval
1505 if (ownTiffPtrFlag ==
false)
1522 <<
"ossimGeoTiff::addImageGeometry: Entered............." 1550 <<
"ossimGeoTiff::addImageGeometry: Failed sanity check " 1555 <<
"for error status" << std::endl;
1560 <<
"for tie points, size = " <<
theTiePoint.size()
1571 double x_tie_point = 0.0;
1572 double y_tie_point = 0.0;
1575 if( (
theScale.size() == 3) && (tieCount == 1))
1590 else if(tieCount > 1)
1612 <<
"ossimGeoTiff::addImageGeometry: " 1613 <<
"Creating a Cubic polynomial projection" << std::endl;
1619 else if(tieCount == 4)
1633 <<
"ossimGeoTiff::addImageGeometry: " 1634 <<
"Creating a bilinear projection" << std::endl;
1641 <<
"ossimGeoTiff::addImageGeometry: " 1642 <<
"Not enough tie points to create a interpolation model" 1653 <<
"ossimGeoTiff::addImageGeometry: Do not support rotated " 1654 <<
"map models yet. You should provide the image as a sample " 1655 <<
"and we will fix it" << std::endl;
1703 <<
"WARNING ossimGeoTiff::addImageGeometry:" 1704 <<
"\nNot coded yet for unit type: " 1713 ossimGpt tieGpt(y_tie_point, x_tie_point, 0.0);
1790 <<
"FATAL ossimGeoTiff::addImageGeometry: " 1791 <<
"UTM zone " <<
theZone <<
" out of range!\n" 1792 <<
"Valid range: 1 to 60" << endl;
1804 <<
"FATAL ossimGeoTiff::addImageGeometry: " 1806 <<
"Valid hemisphere: N or S" << std::endl;
1832 out << std::setprecision(15);
1834 for(idx =0; idx < 16; ++idx)
1836 out << v[idx] <<
" ";
1880 <<
"DEBUG ossimGeoTiff::addImageGeometry: Keyword list dump:\n" 1881 << kwl << std::endl;
1901 <<
"DEBUG ossimGeoTiff::convert2meters: " 1902 <<
"Linear units code was undefined!\n" 1903 <<
"No conversion was performed." << std::endl;
1944 <<
"DEBUG ossimGeoTiff::setOssimProjectionName: " 1945 <<
"theProjectionName: " 1961 if(state->getValue(value, entryIdx,
"tifftag.coord_trans_code"))
1984 <<
"DEBUG ossimGeoTiff::setOssimProjectionName: " 1985 <<
"theProjectionName: " 2024 <<
"DEBUG ossimGeoTiff::setOssimDatumName: " 2041 if(state->getValue(value, entryIdx,
"tifftag.datum_code"))
2052 if(state->getValue(value, entryIdx,
"tifftag.gcs_code"))
2066 <<
"DEBUG ossimGeoTiff::setOssimDatumName: " 2094 if (map_proj == NULL)
2216 std::ios_base::fmtflags f = out.flags();
2218 out << setiosflags(ios::fixed) << setprecision(15)
2219 <<
"ossimGeoTiff::print" << std::endl;
2223 std::vector<double>::const_iterator i =
theScale.begin();
2227 out <<
"theScale[" << index <<
"]: " << (*i) << std::endl;
2234 out <<
"theScale is empty..." << endl;
2239 std::vector<double>::const_iterator i =
theTiePoint.begin();
2243 out <<
"theTiePoint[" << index <<
"]: " << (*i) << std::endl;
2250 out <<
"theTiePoint is empty..." << endl;
2259 out <<
"theModelTransformation[" << index <<
"]: " 2260 << (*i) << std::endl;
2267 out <<
"theModelTransformation is empty..." << endl;
2302 const double* tiePointsPtr = &
theTiePoint.front();
2309 for(idx = 0; idx < tieCount; ++idx)
2311 ossimDpt xyPixel(tiePointsPtr[0]+offset, tiePointsPtr[1]+offset);
2313 ossimGpt gpt(tiePointsPtr[4], tiePointsPtr[3], tiePointsPtr[5]);
2322 bool result =
false;
2338 while (tieIndex < SIZE)
2347 if ( (minX == 1) && (maxX ==
theWidth) &&
2357 <<
"ossimGeoTiff::hasOneBasedTiePoints DEBUG:" 2358 <<
"\nminX: " << minX
2359 <<
"\nmaxX: " << maxX
2360 <<
"\nminY: " << minY
2361 <<
"\nmaxY: " << maxY
2364 <<
"\none based: " << (result?
"true":
"false")
2388 2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882,
2389 2883, 2884, 2885, 2886, 2887, 2888, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900,
2390 2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916,
2391 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2967, 2968
2395 2761, 2762, 2763, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778,
2396 2779, 2780, 2781, 2787, 2788, 2789, 2798, 2799, 2804, 2805, 2806, 2807, 2808, 2809, 2813, 2814,
2397 2818, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2836, 2837, 2838, 2839, 2843, 2844,
2398 2845, 2846, 2847, 2848, 2849, 2850, 2851, 2853, 2854, 2855, 2856, 2859, 2860, 2861, 2792, 2793
2403 while ((result == 0) && (index < 64))
2405 if (harn_feet[index] == feet_harn_code)
2406 result = harn_meters[index];
double convert2meters(double d) const
Converts double passed in to meters if needed.
std::vector< double > theScale
static bool remove(const ossimFilename &pathname)
Removes pathname from filesystem if supported by platform.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
static const char * DATUM_KW
virtual double getFalseNorthing() const
ossim_uint32 getEpsgCode() const
double lond() const
Will convert the radian measure to degrees.
static const char * CENTRAL_MERIDIAN_KW
bool addImageGeometry(ossimKeywordlist &kwl, const char *prefix=0) const
Add geometry info from tags to keword list.
ossimString beforeRegExp(const char *regularExpressionPattern) const
Returns from start of string up to but not including found pattern.
Represents serializable keyword/value map.
ossim_uint16 theAngularUnits
std::basic_ifstream< char > ifstream
Class for char input file streams.
bool usingModelTransform() const
const char * find(const char *key) const
ossim_int64 fileSize() const
const std::vector< double > & getModelTransformation() const
virtual ossim_uint32 getPcsCode() const
Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection.
virtual ossimString getEntryString(ossim_int32 entry_number) const
virtual ossim_uint32 epsgCode() const
double nan()
Method to return ieee floating point double precision NAN.
static const char * IMAGE_MODEL_TRANSFORM_MATRIX_KW
std::vector< double > theModelTransformation
ossimDpt getDecimalDegreesPerPixel() const
Returns the decimal degrees per pixel.
virtual const ossimString & code() const
static ossimString toString(bool aValue)
Numeric to string methods.
bool parseProjection(ossimMapProjection *map_proj)
Initializes data members given a projection. Returns TRUE if successful.
virtual bool isGeographic() const
virtual const ossimString & name() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
std::vector< double > theTiePoint
void setPixelType(ossimPixelType type)
Sets the data member "thePixelType".
ossim_uint16 theDatumCode
int mapZone() const
Returns the map zone as an interger.
static std::mutex theMutex
virtual double getStandardParallel2() const
Derived classes should implement as needed.
virtual double getB() const
const std::vector< double > & getScale() const
unsigned short ossim_uint16
double latd() const
Will convert the radian measure to degrees.
void wrap()
Wrap method to maintain longitude between -180 and +180 and latitude between -90 and +90...
static const char * TYPE_KW
ossimString getOssimDatumName() const
Returns an ossimString representing the ossim datum name code.
ossimPixelType getPixelType() const
Returns data member "thePixelType".
virtual double optimizeFit(const ossimTieGptSet &tieSet, double *targetVariance=0)
virtual double getStandardParallel1() const
Derived classes should implement as needed.
ossim_uint16 theLinearUnitsCode
ossim_int32 toInt32() const
ossimString afterRegExp(const char *regularExpressionPattern) const
Returns from position after found pattern to end of string.
static const char * PIXEL_SCALE_XY_KW
void setOssimDatumName()
Attempts to set the ossim datum code.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * ZONE_KW
ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
ossim_uint16 theModelType
virtual const ossimDatum * getDatum() const
static const char * TIE_POINT_XY_KW
ossim_uint16 theCoorTransGeoCode
static const char * FALSE_NORTHING_KW
std::string::size_type size() const
static ossimEpsgProjectionDatabase * instance()
Instantiates singleton instance of this class:
static bool writeJp2GeotiffBox(const ossimFilename &tmpFile, const ossimIrect &rect, const ossimProjection *proj, std::vector< ossim_uint8 > &buf, ossimPixelType pixelType)
Writes a geotiff box to a buffer.
ossim_uint16 theRasterType
virtual ossimString getProjectionName() const
Returns the projection name.
virtual ossimGpt origin() const
ossim_uint16 getMetersEquivalentHarnCode(ossim_uint16 feet_harn_code)
unsigned int ossim_uint32
virtual const ossimEllipsoid * ellipsoid() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossimString getOssimProjectionName() const
Returns an ossimString representing the ossim projection name.
virtual std::ostream & print(std::ostream &out) const
Prints data members.
ossimGpt ulGroundPt() const
Returns the upper left ground point.
static const char * STD_PARALLEL_1_KW
static const char * FALSE_EASTING_KW
ossimString theAsciiParam
ossimPixelType getRasterType() const
static const char * IMAGE_MODEL_TRANSFORM_UNIT_KW
bool parsePcsCode()
Initializes data members given a projection code.
ossimErrorCode theErrorStatus
double ft2mtrs(double feet)
const ossimMapProjection * getProjection() const
Returns reference to "theProjection".
storage class for tie point between ground and image based on ossimGpt
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
static ossimProjectionFactoryRegistry * instance()
static const char * ORIGIN_LATITUDE_KW
const std::vector< double > & getTiePoint() const
ossimString thePcsCitation
virtual double getFalseEasting() const
ossimString theHemisphere
bool hasOneBasedTiePoints() const
Attempts to detect if tie points are one or zero based.
ossimDpt ulEastingNorthingPt() const
Returns the upper left easting and northing as a ossimDpt.
void addTiePoint(ossimRefPtr< ossimTieGpt > aTiePt)
operations
ossimString toString(ossim_uint32 precision=15) const
ossimUnitType getProjectionUnits() const
OSSIM considers all map projection coordinates (including false eastings and northings) to be in mete...
double usft2mtrs(double feet)
storage class for a set of geographic tie points, between master and slave images ...
void setOssimProjectionName()
Attempts to set the ossim projection name from keys read.
static const char * HEMISPHERE_KW
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
ossim_int32 getZone() const
std::vector< double > theDoubleParam
void getTieSet(ossimTieGptSet &tieSet) const
Initializes tieSet from theTiePoints.
double mtrs2usft(double meters)
static const char * SCALE_FACTOR_KW
char getHemisphere() const
double mtrs2ft(double meters)
static const char * STD_PARALLEL_2_KW
bool theGeoKeysPresentFlag
bool readTags(const ossimFilename &file, ossim_uint32 entryIdx=0)
Reads tags.
ossimGeoTiff()
default constructor
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
static bool writeTags(TIFF *tiffOut, const ossimRefPtr< ossimMapProjectionInfo > projectionInfo, bool imagineNad27Flag=false)
double central_meridian(double xmin, double xmax)
virtual double getA() const
ACCESS METHODS:
unsigned char ossim_uint8
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
double getScaleFactor() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
Projection Factory for coded projections defined in database.
std::basic_ostream< char > ostream
Base class for char output streams.
static const char * PIXEL_SCALE_UNITS_KW
static const char * TIE_POINT_UNITS_KW
ossimString theProjectionName
static int getPcsUnitType(ossim_int32 pcsCode)
ossimPrivateGtifDef * thePrivateDefinitions
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.