| 457 | /************************************************************************/ |
| 458 | |
| 459 | int msMapSetFakedExtent( mapObj *map ) |
| 460 | |
| 461 | { |
| 462 | int i; |
| 463 | /* -------------------------------------------------------------------- */ |
| 464 | /* Remember the original map extents so we can restore them */ |
| 465 | /* later. */ |
| 466 | /* -------------------------------------------------------------------- */ |
| 467 | map->saved_extent = map->extent; |
| 468 | |
| 469 | /* -------------------------------------------------------------------- */ |
| 470 | /* Set extents such that the bottom left corner is 0,0 and the */ |
| 471 | /* top right is width,height. Note this is upside down from */ |
| 472 | /* the normal sense of pixel/line coordiantes, but we do this */ |
| 473 | /* so that the normal "extent" concept of coordinates */ |
| 474 | /* increasing to the right, and up is maintained (like in */ |
| 475 | /* georeferenced coordinate systems). */ |
| 476 | /* -------------------------------------------------------------------- */ |
| 477 | map->extent.minx = 0; |
| 478 | map->extent.maxx = map->width; |
| 479 | map->extent.miny = 0; |
| 480 | map->extent.maxy = map->height; |
| 481 | map->cellsize = 1.0; |
| 482 | |
| 483 | /* -------------------------------------------------------------------- */ |
| 484 | /* When we copy the geotransform into the projection object we */ |
| 485 | /* have to flip it to account for the preceeding upside-down */ |
| 486 | /* coordinate system. */ |
| 487 | /* -------------------------------------------------------------------- */ |
| 488 | map->projection.gt = map->gt; |
| 489 | |
| 490 | map->projection.gt.geotransform[0] |
| 491 | += map->height * map->gt.geotransform[2]; |
| 492 | map->projection.gt.geotransform[3] |
| 493 | += map->height * map->gt.geotransform[5]; |
| 494 | |
| 495 | map->projection.gt.geotransform[2] *= -1; |
| 496 | map->projection.gt.geotransform[5] *= -1; |
| 497 | |
| 498 | for(i=0; i<map->numlayers; i++) |
| 499 | GET_LAYER(map, i)->project = MS_TRUE; |
| 500 | |
| 501 | return InvGeoTransform( map->projection.gt.geotransform, |
| 502 | map->projection.gt.invgeotransform ); |
| 503 | } |
| 504 | |
| 505 | /************************************************************************/ |
| 506 | /* msMapRestoreRealExtent() */ |
no test coverage detected