| 135 | 138 | 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 | 139 | |
|---|
| | 161 | gdal.SetConfigOption( 'GDAL_IGNORE_AXIS_ORIENTATION', 'NO' ) |
|---|
| | 162 | |
|---|
| | 163 | return 'success' |
|---|
| | 164 | |
|---|
| | 165 | ############################################################################### |
|---|
| | 166 | # Test reading a file with axis orientation set properly for an alternate |
|---|
| | 167 | # axis order coordinate system (urn:...:EPSG::4326). |
|---|
| | 168 | |
|---|
| | 169 | def jp2kak_7(): |
|---|
| | 170 | |
|---|
| | 171 | if gdaltest.jp2kak_drv is None: |
|---|
| | 172 | return 'skip' |
|---|
| | 173 | |
|---|
| | 174 | 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"]]' |
|---|
| | 175 | |
|---|
| | 176 | ds = gdal.Open( 'data/gmljp2_dtedsm_epsg_4326_axes.jp2' ) |
|---|
| | 177 | wkt = ds.GetProjection() |
|---|
| | 178 | |
|---|
| | 179 | if wkt != exp_wkt: |
|---|
| | 180 | gdaltest.post_reason( 'did not get expected WKT, should be WGS84' ) |
|---|
| | 181 | print 'got: ', wkt |
|---|
| | 182 | print 'exp: ', exp_wkt |
|---|
| | 183 | return 'fail' |
|---|
| | 184 | |
|---|
| | 185 | gt = ds.GetGeoTransform() |
|---|
| | 186 | gte = (42.999583333333369,0.008271349862259,0, |
|---|
| | 187 | 34.000416666666631,0,-0.008271349862259) |
|---|
| | 188 | |
|---|
| | 189 | if abs(gt[0] - gte[0]) > 0.0000001 or abs(gt[3] - gte[3]) > 0.000001 \ |
|---|
| | 190 | or abs(gt[1] - gte[1]) > 0.000000000005 \ |
|---|
| | 191 | or abs(gt[2] - gte[2]) > 0.000000000005 \ |
|---|
| | 192 | or abs(gt[4] - gte[4]) > 0.000000000005 \ |
|---|
| | 193 | or abs(gt[5] - gte[5]) > 0.000000000005: |
|---|
| | 194 | gdaltest.post_reason( 'did not get expected geotransform' ) |
|---|
| | 195 | print 'got: ', gt |
|---|
| | 196 | return 'fail' |
|---|
| | 197 | |
|---|
| | 198 | ds = None |
|---|
| | 199 | |
|---|