no.geodata.maputil
Class CoordHelper

java.lang.Object
  extended by no.geodata.maputil.CoordHelper

public final class CoordHelper
extends Object


Field Summary
static double defaultNoCoord
           
 int defaultZoom
           
static int DPI
           
 int envFactor
           
 int iconOffsetHeigth
           
 int iconOffsetWidth
           
static int iconOverlapOffsetHeigth
           
static int iconOverlapOffsetWidth
           
static int iconPxSizeHeigth
           
static int iconPxSizeWidth
           
 int imgHeight
           
 double imgMeterSize
           
 int imgWidth
           
 double mapCenterCoordX
           
 double mapCenterCoordY
           
 int mapCenterPxX
           
 int mapCenterPxY
           
 double maxX
           
 double maxY
           
static double METERS_PR_INCH
           
 double minX
           
 double minY
           
static double panFactor
           
static double pixelSize
           
static long zoom_1
           
static long zoom_2
           
static long zoom_3
           
static long zoom_4
           
static long zoom_5
           
static long zoom_6
           
static long zoom_7
           
static int zoomCount
           
static double zoomFactor
           
 
Constructor Summary
CoordHelper()
          Creates a new instance of CoordHelper
 
Method Summary
 boolean checkCoords(List<ResultItem> companies)
          lopper igjennom listetreffet for å sjekke om noen av treffene inneholder koordinater
 ArrayList convertToPixelCoord(MapEnvelope me, Vector vMapPoints, boolean init)
          Converts real world coordinates to imagepixel coordinates.
 double getDefaultNoCoord()
           
 String getDefaultNoCoordString()
           
 String getDefaultZoom()
           
 int getDefaultZoomlevel()
           
 MapEnvelope getEnvelope()
          Returns MapEnvelope from given vector of company objects containing x and y coordinates.
 MapEnvelope getEnvelope(BasicResultItem item)
          Returns MapEnvelope from given company object containing x and y coordinate.
 MapEnvelope getEnvelope(List companies)
          Returns MapEnvelope from given list of company objects and converts coords to pixCoords
 MapEnvelope getEnvelope(List companies, int zoomlevel)
          Returns MapEnvelope from given list of company objects and converts coodrs to pixCoords.
 double getEnvFactor()
           
 double getIconOffsetHeigth()
           
 double getIconOffsetWidth()
           
 double getIconOverlapOffsetHeigth()
           
 double getIconOverlapOffsetWidth()
           
 double getIconPxSizeHeigth()
           
 double getIconPxSizeWidth()
           
 int getImgHeight()
           
 double getImgMeterSize()
           
 int getImgWidth()
           
 double getMapCenterCoordX()
           
 double getMapCenterCoordY()
           
 double getMapCenterPxX()
           
 double getMapCenterPxY()
           
 ArrayList getMapPoints(List companies, MapEnvelope me)
          Returns Arraylist of MapPoints including pix coordinates.
 double getPanFactor()
           
 double getPixelsize()
           
 int getZoomCount()
           
 double getZoomFactor()
           
 int getZoomLevel(MapEnvelope me)
          Returns zoomlevel for given zoomscale
 ArrayList getZoomLevels()
          Returns ArrayList containing all defined zoomlevels
 long getZoomScale(int zoom)
          Returns zoomscale for given zoomfactor
 long getZoomScale(MapEnvelope me)
          Returns zoomscale for given mapenvelope
 int getZoomScaleInt(MapEnvelope me)
           
 MapEnvelope makeEnvelope(double x, double y, int zoom)
          Generates MapEnvelope from given point, scale, imgwidth and imgheight
 MapEnvelope makeEnvelope(Vector vMapPoints)
          Generates MapEnvelope from a vector of points, imgwidth and imgheight.
 MapEnvelope makeEnvelope(Vector vMapPoints, int zoomlevel)
          Generates MapEnvelope from a vector of points, imgwidth and imgheight.
 Vector parseCoordString(String sCoord)
           
 void setDefaultZoomlevel(int defaultZoom)
           
 void setEnvFactor(int env)
           
 void setIconOffsetHeigth(int iconOffsetHeigth)
           
 void setIconOffsetWidth(int iconOffsetWidth)
           
 void setImgHeight(int imgHeigth)
           
 void setImgWidth(int imgWidth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zoom_1

public static final long zoom_1
See Also:
Constant Field Values

zoom_2

public static final long zoom_2
See Also:
Constant Field Values

zoom_3

public static final long zoom_3
See Also:
Constant Field Values

zoom_4

public static final long zoom_4
See Also:
Constant Field Values

zoom_5

public static final long zoom_5
See Also:
Constant Field Values

zoom_6

public static final long zoom_6
See Also:
Constant Field Values

zoom_7

public static final long zoom_7
See Also:
Constant Field Values

zoomCount

public static final int zoomCount
See Also:
Constant Field Values

defaultZoom

public int defaultZoom

imgWidth

public int imgWidth

imgHeight

public int imgHeight

envFactor

public int envFactor

iconPxSizeHeigth

public static final int iconPxSizeHeigth
See Also:
Constant Field Values

iconPxSizeWidth

public static final int iconPxSizeWidth
See Also:
Constant Field Values

iconOffsetHeigth

public int iconOffsetHeigth

iconOffsetWidth

public int iconOffsetWidth

iconOverlapOffsetWidth

public static final int iconOverlapOffsetWidth
See Also:
Constant Field Values

iconOverlapOffsetHeigth

public static final int iconOverlapOffsetHeigth
See Also:
Constant Field Values

mapCenterPxX

public int mapCenterPxX

mapCenterPxY

public int mapCenterPxY

panFactor

public static final double panFactor
See Also:
Constant Field Values

zoomFactor

public static final double zoomFactor
See Also:
Constant Field Values

defaultNoCoord

public static final double defaultNoCoord
See Also:
Constant Field Values

maxX

public double maxX

minX

public double minX

maxY

public double maxY

minY

public double minY

mapCenterCoordX

public double mapCenterCoordX

mapCenterCoordY

public double mapCenterCoordY

METERS_PR_INCH

public static final double METERS_PR_INCH
See Also:
Constant Field Values

DPI

public static final int DPI
See Also:
Constant Field Values

pixelSize

public static final double pixelSize
See Also:
Constant Field Values

imgMeterSize

public double imgMeterSize
Constructor Detail

CoordHelper

public CoordHelper()
Creates a new instance of CoordHelper

Method Detail

setDefaultZoomlevel

public void setDefaultZoomlevel(int defaultZoom)

getDefaultZoomlevel

public int getDefaultZoomlevel()

parseCoordString

public Vector parseCoordString(String sCoord)
Parameters:
sCoord - Coordinate string, x1,y1;x2,y2;x3,y3;x4,y4...osv.
Returns:
Vector containing MapPoint objects.

makeEnvelope

public MapEnvelope makeEnvelope(double x,
                                double y,
                                int zoom)
Generates MapEnvelope from given point, scale, imgwidth and imgheight

Parameters:
mp - MapPoint, centerpoint in map
Returns:
MapEnvelope,

getEnvelope

public MapEnvelope getEnvelope(BasicResultItem item)
Returns MapEnvelope from given company object containing x and y coordinate.

Returns:
MapEnvelope

getEnvelope

public MapEnvelope getEnvelope(List companies,
                               int zoomlevel)
Returns MapEnvelope from given list of company objects and converts coodrs to pixCoords.

Parameters:
companies - List of companies
zoomLevel - Minimum zoomlevel to use
Returns:
MapEnvelope

getEnvelope

public MapEnvelope getEnvelope(List companies)
Returns MapEnvelope from given list of company objects and converts coords to pixCoords

Parameters:
companies -
Returns:
MapEnvelope

checkCoords

public boolean checkCoords(List<ResultItem> companies)
lopper igjennom listetreffet for å sjekke om noen av treffene inneholder koordinater


getMapPoints

public ArrayList getMapPoints(List companies,
                              MapEnvelope me)
Returns Arraylist of MapPoints including pix coordinates.

Parameters:
companies -
companies -

getEnvelope

public MapEnvelope getEnvelope()
Returns MapEnvelope from given vector of company objects containing x and y coordinates.

Returns:
MapEnvelope

makeEnvelope

public MapEnvelope makeEnvelope(Vector vMapPoints)
Generates MapEnvelope from a vector of points, imgwidth and imgheight.

Parameters:
vMapPoints - list of pints
Returns:
MapEnvelope

makeEnvelope

public MapEnvelope makeEnvelope(Vector vMapPoints,
                                int zoomlevel)
Generates MapEnvelope from a vector of points, imgwidth and imgheight.

Parameters:
vMapPoints - vector containg MapPoints
Returns:
MapEnvelope,

convertToPixelCoord

public ArrayList convertToPixelCoord(MapEnvelope me,
                                     Vector vMapPoints,
                                     boolean init)
Converts real world coordinates to imagepixel coordinates. Eliminates points outside given MapEnvelope.

Parameters:
vMapPoints - Vector of real world map point coordinates
me -
init -

getZoomScale

public long getZoomScale(MapEnvelope me)
Returns zoomscale for given mapenvelope

Parameters:
me -
Returns:
zoomscale

getZoomScaleInt

public int getZoomScaleInt(MapEnvelope me)

getZoomLevel

public int getZoomLevel(MapEnvelope me)
Returns zoomlevel for given zoomscale

Returns:
zoomlevel

getZoomScale

public long getZoomScale(int zoom)
Returns zoomscale for given zoomfactor

Parameters:
zoom -
Returns:
zoomscale

getZoomLevels

public ArrayList getZoomLevels()
Returns ArrayList containing all defined zoomlevels

Returns:
zoomscale

getDefaultZoom

public String getDefaultZoom()

getImgWidth

public int getImgWidth()

getImgHeight

public int getImgHeight()

setImgWidth

public void setImgWidth(int imgWidth)

setImgHeight

public void setImgHeight(int imgHeigth)

getEnvFactor

public double getEnvFactor()

setEnvFactor

public void setEnvFactor(int env)

getZoomCount

public int getZoomCount()

getPanFactor

public double getPanFactor()

getZoomFactor

public double getZoomFactor()

getImgMeterSize

public double getImgMeterSize()

getMapCenterPxX

public double getMapCenterPxX()

getMapCenterPxY

public double getMapCenterPxY()

getMapCenterCoordX

public double getMapCenterCoordX()

getMapCenterCoordY

public double getMapCenterCoordY()

getDefaultNoCoord

public double getDefaultNoCoord()

getDefaultNoCoordString

public String getDefaultNoCoordString()

getPixelsize

public double getPixelsize()

getIconPxSizeHeigth

public double getIconPxSizeHeigth()

getIconPxSizeWidth

public double getIconPxSizeWidth()

getIconOffsetHeigth

public double getIconOffsetHeigth()

setIconOffsetHeigth

public void setIconOffsetHeigth(int iconOffsetHeigth)

getIconOffsetWidth

public double getIconOffsetWidth()

setIconOffsetWidth

public void setIconOffsetWidth(int iconOffsetWidth)

getIconOverlapOffsetWidth

public double getIconOverlapOffsetWidth()

getIconOverlapOffsetHeigth

public double getIconOverlapOffsetHeigth()


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.