-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdal_test_netcdf_CFattributes.cpp
66 lines (54 loc) · 1.42 KB
/
gdal_test_netcdf_CFattributes.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <cfloat>
#include <map>
#include <vector>
#include "cpl_string.h"
#include "cpl_conv.h" // for CPLMalloc()
#include "gdal_frmts.h"
#include "gdal_pam.h"
#include "gdal_priv.h"
#include "netcdf.h"
#include "ogr_spatialref.h"
#include "ogrsf_frmts.h"
#include "netcdfdataset.h"
int main() {
const char* proj4_str = "\
+proj=geos \
+lon_0=0 \
+h=35785831 \
+x_0=0 \
+y_0=0 \
+a=6378169.0 \
+b=6356583.8 \
+units=m \
+sweep=y \
+no_defs";
char* wkt_proj_2;
const char* wkt_proj = "\
PROJCS[\"unnamed\",\
GEOGCS[\"unknown\",\
DATUM[\"unknown\",\
SPHEROID[\"Spheroid\",638169.0,295.488065897]],\
PRIMEM[\"Greenwich\",0],\
UNIT[\"degree\",0.0174532925199433]],\
PROJECTION[\"Geostationary_Satellite\"],\
PARAMETER[\"central_meridian\",0],\
PARAMETER[\"satellite_height\",35785831],\
PARAMETER[\"false_easting\",0],\
PARAMETER[\"false_northing\",0]]";
//OGRSpatialReference poSRS(wkt_proj);
OGRSpatialReference poSRS;
//poSRS.SetProjection(wkt_proj);
poSRS.importFromProj4(proj4_str);
poSRS.exportToWkt(&wkt_proj_2);
printf( "Projection is `%s'\n", wkt_proj_2);
for( int iMap = 0; poNetcdfSRS_PT[iMap].WKT_SRS != nullptr; iMap++ )
{
printf("%s\n", poNetcdfSRS_PT[iMap].WKT_SRS);
//if( EQUAL(pszProjection, poNetcdfSRS_PT[iMap].WKT_SRS) )
//{
// nMapIndex = iMap;
// poMap = poNetcdfSRS_PT[iMap].mappings;
// break;
//}
}
}