| | 127 | # Test reading GMLJP2 file with srsName only on the Envelope, and lots of other |
|---|
| | 128 | # metadata junk |
|---|
| | 129 | |
|---|
| | 130 | def jp2kak_6(): |
|---|
| | 131 | |
|---|
| | 132 | if gdaltest.jp2kak_drv is None: |
|---|
| | 133 | return 'skip' |
|---|
| | 134 | |
|---|
| | 135 | exp_wkt = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]' |
|---|
| | 136 | |
|---|
| | 137 | ds = gdal.Open( 'data/ll.jp2' ) |
|---|
| | 138 | wkt = ds.GetProjection() |
|---|
| | 139 | |
|---|
| | 140 | if wkt != exp_wkt: |
|---|
| | 141 | gdaltest.post_reason( 'did not get expected WKT, should be WGS84' ) |
|---|
| | 142 | print 'got: ', wkt |
|---|
| | 143 | print 'exp: ', exp_wkt |
|---|
| | 144 | return 'fail' |
|---|
| | 145 | |
|---|
| | 146 | gt = ds.GetGeoTransform() |
|---|
| | 147 | if abs(gt[0] - 8) > 0.0000001 or abs(gt[3] - 50) > 0.000001 \ |
|---|
| | 148 | or abs(gt[1] - 0.000761397164) > 0.000000000005 \ |
|---|
| | 149 | or abs(gt[2] - 0.0) > 0.000000000005 \ |
|---|
| | 150 | or abs(gt[4] - 0.0) > 0.000000000005 \ |
|---|
| | 151 | or abs(gt[5] - -0.000761397164) > 0.000000000005: |
|---|
| | 152 | gdaltest.post_reason( 'did not get expected geotransform' ) |
|---|
| | 153 | print 'got: ', gt |
|---|
| | 154 | return 'fail' |
|---|
| | 155 | |
|---|
| | 156 | ds = None |
|---|
| | 157 | |
|---|
| | 158 | return 'success' |
|---|
| | 159 | |
|---|
| | 160 | ############################################################################### |
|---|