blob: 964c8bfb5a797883623ebf37d5a4a30447ea1a68 [file] [log] [blame]
/**
* Copyright (C) 2010 IBM Corporation
*/
package org.eclipse.stem.loggers.imagewriter.logger.projections;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
/**
* Interface to provide support for multiple differing
* types of map projections. The main purpose of implementations
* is to support point transformations from geo coordinates (latitude and longitude)
* into a target projection coordinate system (and reverse, if possible).
*
*/
public interface IMapProjection
{
/**
* Boundaries of the map projection
* @return
*/
public Rectangle getBounds();
/**
* Sets the default origin point of the projection, if supported
* @param origin
*/
public void setOrigin(double lat, double lon);
/**
* Transform a point from geo coordinates into the target
* coordinate system using a fixed projection. If the projection
* is origin-dependent, then the default (or previously set)
* origin is used.
*
* @param coord Point value to transform
* @return New transformed point
*/
public double[] project(double lat, double lon);
/**
* Transform and distort a point from geo coordinates into the target
* coordinate system using a fixed projection. If the projection
* is origin-dependent, use the specified origin.
*
* @param coord Point value to transform
* @param origin Origin point of the projection (might be optional)
* @param distort Whether to perform additional distortion
* @return New transformed point
*/
public double[] project(double lat, double lon, double lat0, double lon0, boolean distort);
/**
* Performs an inverse projection from the current projection
* back to a base geographic coordinate. If the projection is
* origin-dependent, then use the default (or previously set)
* origin value.
*
* WARNING
* If the value passed to {@link #inverseProject(Point2D)}inverseProject
* is the result of a previous {@link #project(Point2D)} and the
* origin has changed, the values may not be equal.
*
* @param coord Projected point to transform
* @return Unprojected geographic coordinate
*/
public double[] inverseProject(double lat, double lon);
/**
* Performs an inverse projection from the current projection
* back to a base geographic coordinate. If the projection is
* origin-dependent, then use specified origin parameter.
*
* WARNING
* If the value passed to {@link #inverseProject(Point2D)}inverseProject
* is the result of a previous {@link #project(Point2D)} and the
* origin has changed, the values may not be equal.
*
* @param coord Projected point to transform
* @param origin Origin point of the projection (might be optional)
* @param distort Whether to perform additional distortion
* @return Unprojected geographic coordinate
*/
public double[] inverseProject(double lat, double lon, double lat0, double lon0, boolean distort);
}