BEAM Coordinate Systems Overview
The following image depicts the coordinate systems used within BEAM and their relations.
- The zoom level and rotation of the view determine the affine transformation between model CS and view CS. This transformation is managed by the ViewPort and can be obtained by ViewPort.getModelToViewTransform() and ViewPort.getViewToModelTransform().
- The model CS of the display layer is either the image or the map CS depending on the transformation T between image and map. If T is affine the model CS is the map CS, else the model CS is the image CS. T is
- affine - if the map CS is defined by a projected Coordinate Reference System (CRS)
- not affine - if the map CS is defined by tie-points or ground control points (GCPs)
Updates of coordinates
- When model coordinate is changed (by dragging the figure), the PixelPos is updated (Placemark.updatePositions()) by using the model to image transformation (m2iTransform). Afterwards, the geo-position is updated by using the GeoCoding*.
- When PixelPos is changed (Placemark.setPixelPos()), the model coordinate is updated by using the image to model transformation (i2mTransform). Afterwards, the geo-position is updated by using the GeoCoding*.
- When GeoPos is changed (Placemark.setGeoPos()), the PixelPos is updated by using the GeoCoding* and afterwards the model coordinate is updated by using the image to model transformation.
*Note: GeoPos and PixelPos depend on each other only if the placemark is a pin.
Problem when attaching GcpGeoCoding to projected product
| Tie-point-based Product | Projected Product |
|---|---|
| The transformation between image CS and model CS is identity (because image to map is not affine). Thus, model coordinate and PixelPos are identical. | The transformation between image CS and model CS is affine, because image to map is affine (made sure by the projection). Thus, model coordinate and PixelPos are not identical: The model coordinates are given in map coordinates. |
| In case of calling updatePositions() (that is, when changing the model coordinate), the model to image transformation is used to recompute the PixelPos. Correct behaviour. | In case of calling updatePositions() (that is, when changing the model coordinate), the affine model to image transformation is used to recompute the PixelPos. Correct behaviour. |
| Now attaching GCP-based GeoCoding. | Now attaching GCP-based GeoCoding. |
| Now, the map to image transformation still is not affine and therefore the identity is used for model to image transformations. This is the same transformation as before, so we still obtain the expected behaviour. | Now, the map to image transformation is affine no more. Therefore, the identity is used for model to image transformation, which is different to the affine model to image transformation used before. Thus, the already stored model coordinates are not recomputed to image coordinates. Wrong behaviour. |
Q&A
Why not always use image CS as model CS?
What is the real problem?
Can a fourth coordinate solve the problem?
Why do we have to use an affine transformation for image to model coordinates conversion?
Java Graphics only support affine transformations.
Is it possible to use only a single coordinate and derive the others from it on the fly?
No. We have to store at least the model coordinate for the view and the GeoPos in case of GCPs.
Why is the map coordinate not stored?
The map coordinate should be used when exporting the placemarks to a shapefile. This is probably a bug.