sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SIS-68) Remove LatLon class and replace with DirectPosition
Date Thu, 20 Dec 2012 09:45:13 GMT

    [ https://issues.apache.org/jira/browse/SIS-68?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13536895#comment-13536895
] 

Martin Desruisseaux commented on SIS-68:
----------------------------------------

Should we really port {{getShiftedLat()}} and {{getShiftedLon()}}? Adding +90° and +180°
to those values is basically a coordinate conversion operation: we take a point from one coordinate
space (the {{DirectPosition}} Coordinate Reference System) and we transform it into another
coordinate space (the screen coordinate system for example). Coordinate operations are the
job of separated classes, including a map projection framework among others.

The coordinate operation classes are not yet committed. However for linear transformation
like the {{getShiftedLat()}} and {{getShiftedLon()}} methods, the same effect can be obtained
using the {{java.awt.geom.AffineTransform}}:

{code:java}
// Needs to be constructed only once. It defines in a single place
// the shift that we want to apply to all point to be rendered.
AffineTransform posToScreen = AffineTransform.getTranslate(90, 180);

// Now, we can repeat the operation below for as many points as we want.
DirectPosition2D latlon = new DirectPosition2D(5, 30);
Point2D screen = posToScreen.transform(latlon, null);
{code}

The {{getNormLon()}} method is another story, since it doesn't change coordinate space (the
point is still geographically at the same place).

                
> Remove LatLon class and replace with DirectPosition
> ---------------------------------------------------
>
>                 Key: SIS-68
>                 URL: https://issues.apache.org/jira/browse/SIS-68
>             Project: Spatial Information Systems
>          Issue Type: Improvement
>          Components: geometry objects
>            Reporter: Chris A. Mattmann
>            Assignee: Chris A. Mattmann
>             Fix For: 0.3
>
>
> Port the following methods:
> {noformat}
>  * getShiftedLat() / getShiftedLon()
>  * getNormLon()
> {noformat}
> To DirectPosition, and remove LatLon class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message