com.ontimize.util.gis.common
Class GisUtilities

java.lang.Object
  extended by com.ontimize.util.gis.common.GisUtilities

public class GisUtilities
extends java.lang.Object

Class with static methods of extended use on the internal gis processes


Field Summary
static java.lang.String GEOMETRY
           
static boolean loggerExists
           
static java.lang.String RASTER
           
 
Constructor Summary
GisUtilities()
           
 
Method Summary
static void addLog(java.lang.Object o, int level)
          Add the current message to the gis log
static byte[] bufferedImageToByteArray(java.awt.image.BufferedImage img)
          Converts a buffered image to a byte array
static java.awt.image.BufferedImage byteArrayToBufferedImage(byte[] byteArray)
          Converts a byte array to a buffered image
static java.awt.image.BufferedImage byteArrayToVolatileImage(byte[] byteArray)
          Converts a byte array to a volatile image
static com.vividsolutions.jts.geom.Envelope[] calculateRemainingBoxes(com.vividsolutions.jts.geom.Envelope prevBoundingBox, com.vividsolutions.jts.geom.Envelope postBoundingBox)
          Obtains the intersected envelopes obtained from two given bounding boxes, used to improve the request of data when using a gis panel in panning state
static boolean checkDataIsInKeyList(java.util.Hashtable data, java.util.List<java.lang.Object> keyList, java.lang.String keyName)
          Check if the data record has some of the given keys
static boolean checkTransparentRasterLayer(IGisLayer layer)
          Check if the given layer has a transparent WMS server as data provider
static java.util.List<IGisLayer> cloneLayersList(java.util.List<IGisLayer> layersList)
          Get a copy of the given layers list
static com.ontimize.db.EntityResult convertByteArraysToImages(com.ontimize.db.EntityResult data)
          Converts the byte arrays inside an EntityResult to buffered images, those array must be inside de EntityResult using the key "raster"
static java.util.List<java.util.Hashtable> convertHashtableToLayerData(java.util.Hashtable data)
          Convert the given Hashtable with data to a data array
static com.ontimize.db.EntityResult convertLayerDataToEntityResult(java.util.List<java.util.Hashtable> layerData)
          Conver the given data list to a Ontimize EntityResult
static com.vividsolutions.jts.geom.Envelope copyEnvelopeAndExpand(com.vividsolutions.jts.geom.Envelope area, double distance)
          Get a copy of the given envelope and expands its extension with the given distance value
static java.awt.image.BufferedImage createBuffer(int width, int height, int transparency)
          Creates a buffered image based on the machine graphics environment.
static boolean deleteDir(java.io.File dir)
           
static java.util.Hashtable entityResultToHashtable(com.ontimize.db.EntityResult res)
          Convert the Ontimize EntityResult to a Hashtable
static java.util.Hashtable expandInitParamsWithDefault(java.lang.String className, java.util.Hashtable initParams)
          Expand the init class parameters with the parameters defined on the Ontimize xml parameters definition file
static com.vividsolutions.jts.geom.Envelope[] fragmentArea(com.vividsolutions.jts.geom.Envelope totalArea, boolean fragmentation, double fragmentSide)
          Fragment the given area in smaller parts in order to request data, considering the size of each part a double value
static com.vividsolutions.jts.geom.Envelope[] fragmentAreas(com.vividsolutions.jts.geom.Envelope[] totalAreas, boolean fragmentation, double fragmentSide)
          Separate the given request areas into smaller areas
static com.vividsolutions.jts.geom.Envelope[] fragmentIntegerArea(com.vividsolutions.jts.geom.Envelope totalArea, boolean fragmentation, double fragmentSide)
          Fragment the given area in smaller parts in order to request data, considering the size of each part an integer value
static ICacheElement getCacheClassNameFromDataProvider(IDataProviderDefinition dataProvider)
          Gets the cache class instance from the related data provider parameter
static java.util.Hashtable getCacheParametersFromDataProvider(IDataProviderDefinition dataProvider)
           
static java.awt.Rectangle getClipBoundsForEnvelope(com.vividsolutions.jts.geom.Envelope dataBBox, com.vividsolutions.jts.geom.Envelope boundingBox, java.awt.Rectangle panelRect, double strokeWidth)
          Get the clip bounds for the data area defined at the current gis map viewer
static int[] getCoordinateLocationOnPanel(com.vividsolutions.jts.geom.Coordinate coordinate, com.vividsolutions.jts.geom.Envelope boundingBox, java.awt.Rectangle bounds)
          Get the screen location for the given geographic coordinate
static double[] getCursorLocation(java.awt.event.MouseEvent ev, com.vividsolutions.jts.geom.Envelope boundingBox, java.awt.Rectangle bounds)
          Gets the geographic cursor location
static java.util.List<java.lang.String> getDataProviderKeysFromLayer(IGisLayer layer)
          Return the list of key columns name related to the data provider of a given layer
static java.util.Hashtable getDefaultLabelList()
          Get the default label list
static com.vividsolutions.jts.geom.Envelope getEnvelopeForClipBounds(java.awt.Rectangle clip, com.vividsolutions.jts.geom.Envelope boundingBox, java.awt.Rectangle panelRect)
          Get the map envelope for the given clip bounds at the actual map viewer
static com.vividsolutions.jts.geom.Envelope getEnvelopeFromDataRecord(java.util.Map recordData)
          Get the envelope values from the geographic data stored on the given data record
static com.vividsolutions.jts.geom.Envelope getEnvelopeFromFilters(java.lang.Object appliedFilters)
          Return the bounding box envelope from defined filters
static com.vividsolutions.jts.geom.Envelope[] getEnvelopesFromFilters(java.lang.Object appliedFilters)
          Return the bounding boxes envelopes from defined filters
static long getFileSize(java.io.File folder)
          Get folder size in bytes
static boolean getForceQueryValueFromFilters(java.lang.Object appliedFilters)
          Return the "force server query" value from defined filters
static boolean getFragmentRequestEnabled(IGisLayer layer)
          Check if the current layer has requests fragmentation enabled
static int getFragmentSize(IGisLayer layer)
          Gets the fragment side size expressed on the given gis layer
static com.vividsolutions.jts.geom.Geometry getGeometryFromEnvelope(com.vividsolutions.jts.geom.Envelope actualRecordBBox)
          Transforms a given bounding box to geometry format
static java.lang.String getGeometryTypeFromLayer(IGisLayer layer)
          Return the geometry type name related to a given layer
static java.util.List<java.lang.String> getKeyColumnsFromLayer(IGisLayer layer)
          Get the key column names for the given layer data provider
static java.util.List<java.lang.String> getKeysFromDataProviderParameters(java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
          Return the list of key columns name related to the data provider of a given layer
static java.lang.Object getLayerIdFromLayerKeys(java.lang.Object layerKeys)
          Gets the layer id inside the layer heys hashtable
static java.lang.Object getLayersConfigurationIdFromLayerKeys(java.lang.Object layerKeys)
          Gets the layer configuration id inside the layer heys hashtable
static double getNearestPixelSize(double prevPixelSize, java.lang.String scales)
          Gets the nearest pizel size
static java.lang.Double getPixelSizeFromFilters(java.lang.Object appliedFilters)
          Return the pixel size value from defined filters
static double[] getPointLocation(java.awt.Point point, com.vividsolutions.jts.geom.Envelope boundingBox, java.awt.Rectangle bounds)
          Get the geographic point location for the given area
static java.util.Vector<java.lang.String> getVisibleColumns(java.util.List<java.util.Hashtable> layerData, IGisLayer layer)
          Get the layer visible columns used to show on the filter definition table
static boolean layerIsInValidScale(double pixelSize, IGisLayer layer)
          Checks is given layer can be visible for the actual scale
static com.vividsolutions.jts.geom.Envelope[] orderAreasByDistanceToCenter(double centerX, double centerY, com.vividsolutions.jts.geom.Envelope[] areasArray)
          Rearranges the bounding boxes array from nearest to farthest from a given location
static com.vividsolutions.jts.geom.Envelope parseBBoxFromString(java.lang.String bboxString)
          Get bounding box definition from given string representation
static com.vividsolutions.jts.geom.Envelope parseDefaultBBoxFromPreferenceList(java.lang.String bboxesListString)
          Get the default viewer bounding box from the preferred bounding boxes list
static int[] parseDimensionFromString(java.lang.String dimensionsString)
          Get dimension from given string representation
static java.util.Hashtable parseFiltersFromString(java.lang.String filtersRepresentation)
          Parse the defined filters from its corresponding text definition
static double[] parseScales(java.lang.String scalesString)
          Transforms and string format scales definition to its corresponding array
static java.lang.String parseStringFromBBox(com.vividsolutions.jts.geom.Envelope bbox)
          Get the string representation of a given bounding box
static java.lang.String parseStringFromFilters(java.util.Hashtable filters)
          Get the string representation for the filters Hashtable
static java.io.InputStream parseStringToInputSream(java.lang.String xml)
          Parse a xml definition with UTF-8 coding in String format to an InputStream
static com.vividsolutions.jts.geom.Envelope[] prevFragmentArea(com.vividsolutions.jts.geom.Envelope totalArea, boolean fragmentation, double fragmentSide)
          Fragment the given area in smaller parts in order to request data
static boolean recordHasParentKeys(java.util.Hashtable<java.lang.String,java.lang.Object> recordData, java.util.Hashtable<java.lang.String,java.lang.Object> keys)
          Cehck if the current data contains the given parent keys
static void setFiltersEnvelope(java.lang.Object appliedFilters, com.vividsolutions.jts.geom.Envelope newBBox)
          Sets the bounding box envelope for the given filters
static void setLogging(boolean logging)
           
static void showGisMonitorWindow(IGisViewer gisViewer)
           
static boolean showOnMouseClickAction(IGisLayer gisLayer, java.util.List<java.util.Hashtable> layerData, com.vividsolutions.jts.geom.Geometry location, double pixelSize, double selectionPrecission, IGisViewer gisViewer, java.awt.event.MouseEvent ev)
          Show the onMouseClick action for the given map panel configuration
static boolean showOnMouseOverAction(IGisLayer gisLayer, java.util.List<java.util.Hashtable> layerData, com.vividsolutions.jts.geom.Geometry location, double pixelSize, IGisViewer gisViewer, java.awt.event.MouseEvent ev)
          Show the onMouseOver action for the given map panel configuration
static boolean validDataForFilters(java.util.Hashtable recordValues, java.lang.Object filters)
          Check if the data is valid according to the filters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggerExists

public static boolean loggerExists

RASTER

public static final java.lang.String RASTER
See Also:
Constant Field Values

GEOMETRY

public static final java.lang.String GEOMETRY
See Also:
Constant Field Values
Constructor Detail

GisUtilities

public GisUtilities()
Method Detail

setLogging

public static void setLogging(boolean logging)

deleteDir

public static boolean deleteDir(java.io.File dir)

getFileSize

public static long getFileSize(java.io.File folder)
Get folder size in bytes

Parameters:
folder - Interest folder
Returns:
Folder size in bytes

parseFiltersFromString

public static java.util.Hashtable parseFiltersFromString(java.lang.String filtersRepresentation)
Parse the defined filters from its corresponding text definition

Parameters:
filtersRepresentation - String defining the filters to sue
Returns:
Filters Hashtable

parseStringFromFilters

public static java.lang.String parseStringFromFilters(java.util.Hashtable filters)
Get the string representation for the filters Hashtable

Parameters:
filters - Hashtable containing the filters
Returns:
String representation

getDefaultLabelList

public static java.util.Hashtable getDefaultLabelList()
                                               throws java.lang.Exception
Get the default label list

Returns:
Default Hashtable label list
Throws:
java.lang.Exception

expandInitParamsWithDefault

public static java.util.Hashtable expandInitParamsWithDefault(java.lang.String className,
                                                              java.util.Hashtable initParams)
Expand the init class parameters with the parameters defined on the Ontimize xml parameters definition file

Parameters:
className - Class name to get the parameters
initParams - Initial parameters for the class
Returns:
Grouped parameters

checkTransparentRasterLayer

public static boolean checkTransparentRasterLayer(IGisLayer layer)
Check if the given layer has a transparent WMS server as data provider

Parameters:
layer - Interest layer
Returns:
WMS transparency state

getEnvelopeForClipBounds

public static com.vividsolutions.jts.geom.Envelope getEnvelopeForClipBounds(java.awt.Rectangle clip,
                                                                            com.vividsolutions.jts.geom.Envelope boundingBox,
                                                                            java.awt.Rectangle panelRect)
Get the map envelope for the given clip bounds at the actual map viewer

Parameters:
clip - Clip bounds
boundingBox - Actual map viewer bounding box
panelRect - Actual map viewer panel dimension
Returns:
Bounding box corresponding to the clip bounds

getClipBoundsForEnvelope

public static java.awt.Rectangle getClipBoundsForEnvelope(com.vividsolutions.jts.geom.Envelope dataBBox,
                                                          com.vividsolutions.jts.geom.Envelope boundingBox,
                                                          java.awt.Rectangle panelRect,
                                                          double strokeWidth)
Get the clip bounds for the data area defined at the current gis map viewer

Parameters:
dataBBox - Data bounding box
boundingBox - Map viewer bounding box
panelRect - Map viewer panel dimension
strokeWidth - Actual map viewer stroke width
Returns:
Gis map viewer clip bounds for the given data bounding box

convertLayerDataToEntityResult

public static com.ontimize.db.EntityResult convertLayerDataToEntityResult(java.util.List<java.util.Hashtable> layerData)
Conver the given data list to a Ontimize EntityResult

Parameters:
layerData - List containing data
Returns:
EntityResult containing data

convertHashtableToLayerData

public static java.util.List<java.util.Hashtable> convertHashtableToLayerData(java.util.Hashtable data)
Convert the given Hashtable with data to a data array

Parameters:
data - Hashtable containing data
Returns:
List containing data

entityResultToHashtable

public static java.util.Hashtable entityResultToHashtable(com.ontimize.db.EntityResult res)
Convert the Ontimize EntityResult to a Hashtable

Parameters:
res - data EntityResult to convert
Returns:
data Hashtable

getVisibleColumns

public static java.util.Vector<java.lang.String> getVisibleColumns(java.util.List<java.util.Hashtable> layerData,
                                                                   IGisLayer layer)
Get the layer visible columns used to show on the filter definition table

Parameters:
layerData - Actual layer data
layer - Layer identifier
Returns:
Visible columns list

createBuffer

public static java.awt.image.BufferedImage createBuffer(int width,
                                                        int height,
                                                        int transparency)
Creates a buffered image based on the machine graphics environment.

Parameters:
width - Image width in pixels
height - Image height in pixels
transparency - Image transparency
Returns:
buffered image with the given parameters

cloneLayersList

public static java.util.List<IGisLayer> cloneLayersList(java.util.List<IGisLayer> layersList)
Get a copy of the given layers list

Parameters:
layersList - Layers list to copy
Returns:
Cloned layers list

convertByteArraysToImages

public static com.ontimize.db.EntityResult convertByteArraysToImages(com.ontimize.db.EntityResult data)
Converts the byte arrays inside an EntityResult to buffered images, those array must be inside de EntityResult using the key "raster"

Parameters:
data - EntityResult containing the bytes array data using the key "raster"
Returns:
EntityResult with the byte array data converted to buffered images

byteArrayToBufferedImage

public static java.awt.image.BufferedImage byteArrayToBufferedImage(byte[] byteArray)
                                                             throws java.lang.Exception
Converts a byte array to a buffered image

Parameters:
byteArray - byte array to convert
Returns:
The buffered image
Throws:
ImageFormatException
java.io.IOException
java.lang.Exception

byteArrayToVolatileImage

public static java.awt.image.BufferedImage byteArrayToVolatileImage(byte[] byteArray)
                                                             throws java.lang.Exception
Converts a byte array to a volatile image

Parameters:
byteArray - byte array to convert
Returns:
The volatile image
Throws:
ImageFormatException
java.io.IOException
java.lang.Exception

bufferedImageToByteArray

public static byte[] bufferedImageToByteArray(java.awt.image.BufferedImage img)
                                       throws java.lang.Exception
Converts a buffered image to a byte array

Parameters:
img - image to convert
Returns:
The buffered image
Throws:
ImageFormatException
java.io.IOException
java.lang.Exception

parseBBoxFromString

public static com.vividsolutions.jts.geom.Envelope parseBBoxFromString(java.lang.String bboxString)
Get bounding box definition from given string representation

Parameters:
bboxString - Bounding box string representation
Returns:
Bounding box in Envelope format

fragmentAreas

public static com.vividsolutions.jts.geom.Envelope[] fragmentAreas(com.vividsolutions.jts.geom.Envelope[] totalAreas,
                                                                   boolean fragmentation,
                                                                   double fragmentSide)
Separate the given request areas into smaller areas

Parameters:
totalAreas - List of areas to fragment
fragmentation - Fragmentation enabling
fragmentSide - Side in map units of each individual fragment
Returns:
Fragmented areas list

prevFragmentArea

public static com.vividsolutions.jts.geom.Envelope[] prevFragmentArea(com.vividsolutions.jts.geom.Envelope totalArea,
                                                                      boolean fragmentation,
                                                                      double fragmentSide)
Fragment the given area in smaller parts in order to request data

Parameters:
totalArea - Total bounding box to fragment
fragmentation - Value to set fragmentation enabled or not
fragmentSide - Size in width and height of each fragment
Returns:
Array with the resulting fragments

fragmentArea

public static com.vividsolutions.jts.geom.Envelope[] fragmentArea(com.vividsolutions.jts.geom.Envelope totalArea,
                                                                  boolean fragmentation,
                                                                  double fragmentSide)
Fragment the given area in smaller parts in order to request data, considering the size of each part a double value

Parameters:
totalArea - Total bounding box to fragment
fragmentation - Value to set fragmentation enabled or not
fragmentSide - Size in width and height of each fragment
Returns:
Array with the resulting fragments

fragmentIntegerArea

public static com.vividsolutions.jts.geom.Envelope[] fragmentIntegerArea(com.vividsolutions.jts.geom.Envelope totalArea,
                                                                         boolean fragmentation,
                                                                         double fragmentSide)
Fragment the given area in smaller parts in order to request data, considering the size of each part an integer value

Parameters:
totalArea - Total bounding box to fragment
fragmentation - Value to set fragmentation enabled or not
fragmentSide - Size in width and height of each fragment
Returns:
Array with the resulting fragments

orderAreasByDistanceToCenter

public static com.vividsolutions.jts.geom.Envelope[] orderAreasByDistanceToCenter(double centerX,
                                                                                  double centerY,
                                                                                  com.vividsolutions.jts.geom.Envelope[] areasArray)
Rearranges the bounding boxes array from nearest to farthest from a given location

Parameters:
centerX - X coordinate of the given location
centerY - Y coordinate of the given location
areasArray - Array of bounding boxes to rearrange
Returns:
Rearranged bounding boxes array

parseDimensionFromString

public static int[] parseDimensionFromString(java.lang.String dimensionsString)
Get dimension from given string representation

Parameters:
dimensionsString - Dimension string representation
Returns:
Dimension integer array representation

parseStringFromBBox

public static java.lang.String parseStringFromBBox(com.vividsolutions.jts.geom.Envelope bbox)
Get the string representation of a given bounding box

Parameters:
bbox - Bounding box to parse
Returns:
String definition for the given bounding box

getEnvelopesFromFilters

public static com.vividsolutions.jts.geom.Envelope[] getEnvelopesFromFilters(java.lang.Object appliedFilters)
Return the bounding boxes envelopes from defined filters

Parameters:
appliedFilters - Hashtable with the defined filters
Returns:
Bounding boxes obtained from the filters

getEnvelopeFromFilters

public static com.vividsolutions.jts.geom.Envelope getEnvelopeFromFilters(java.lang.Object appliedFilters)
Return the bounding box envelope from defined filters

Parameters:
appliedFilters - Hashtable with the defined filters
Returns:
Bounding box obtained from the filters

getForceQueryValueFromFilters

public static boolean getForceQueryValueFromFilters(java.lang.Object appliedFilters)
Return the "force server query" value from defined filters

Parameters:
appliedFilters - Hashtable with the defined filters
Returns:
Force server query value

getPixelSizeFromFilters

public static java.lang.Double getPixelSizeFromFilters(java.lang.Object appliedFilters)
Return the pixel size value from defined filters

Parameters:
appliedFilters - Hashtable with the defined filters
Returns:
Pixel size obtained from the filters

setFiltersEnvelope

public static void setFiltersEnvelope(java.lang.Object appliedFilters,
                                      com.vividsolutions.jts.geom.Envelope newBBox)
Sets the bounding box envelope for the given filters

Parameters:
appliedFilters - Hashtable with the defined filters
newBBox - New bounding box

getLayerIdFromLayerKeys

public static java.lang.Object getLayerIdFromLayerKeys(java.lang.Object layerKeys)
Gets the layer id inside the layer heys hashtable

Parameters:
layerKeys - Hashtable containing the layer id and its related layers configuration id
Returns:
Layer identifier

getLayersConfigurationIdFromLayerKeys

public static java.lang.Object getLayersConfigurationIdFromLayerKeys(java.lang.Object layerKeys)
Gets the layer configuration id inside the layer heys hashtable

Parameters:
layerKeys - Hashtable containing the layer id and its related layers configuration id
Returns:
Layer configuration identifier

getGeometryFromEnvelope

public static com.vividsolutions.jts.geom.Geometry getGeometryFromEnvelope(com.vividsolutions.jts.geom.Envelope actualRecordBBox)
Transforms a given bounding box to geometry format

Parameters:
actualRecordBBox - Bouding box to transform
Returns:
Bounding box in geometry format

parseStringToInputSream

public static java.io.InputStream parseStringToInputSream(java.lang.String xml)
Parse a xml definition with UTF-8 coding in String format to an InputStream

Parameters:
xml - String xml definition

getNearestPixelSize

public static double getNearestPixelSize(double prevPixelSize,
                                         java.lang.String scales)
Gets the nearest pizel size

Parameters:
prevPixelSize - Actual pixel size
scales - Available pixel sizes array
Returns:
Request pixel size

parseScales

public static double[] parseScales(java.lang.String scalesString)
Transforms and string format scales definition to its corresponding array

Parameters:
scalesString - Definition of the scales array in String format
Returns:
Scales array

getDataProviderKeysFromLayer

public static java.util.List<java.lang.String> getDataProviderKeysFromLayer(IGisLayer layer)
Return the list of key columns name related to the data provider of a given layer

Parameters:
layer - Layer definition
Returns:
List of data provider keys

getKeyColumnsFromLayer

public static java.util.List<java.lang.String> getKeyColumnsFromLayer(IGisLayer layer)
Get the key column names for the given layer data provider

Parameters:
layer - Layer to get keys
Returns:
Array with the column names

getKeysFromDataProviderParameters

public static java.util.List<java.lang.String> getKeysFromDataProviderParameters(java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
Return the list of key columns name related to the data provider of a given layer

Parameters:
parameters - Data provider parameters hashtable
Returns:
List of data provider keys

getGeometryTypeFromLayer

public static java.lang.String getGeometryTypeFromLayer(IGisLayer layer)
Return the geometry type name related to a given layer

Parameters:
layer - Layer definition
Returns:
Geometry type name

calculateRemainingBoxes

public static com.vividsolutions.jts.geom.Envelope[] calculateRemainingBoxes(com.vividsolutions.jts.geom.Envelope prevBoundingBox,
                                                                             com.vividsolutions.jts.geom.Envelope postBoundingBox)
Obtains the intersected envelopes obtained from two given bounding boxes, used to improve the request of data when using a gis panel in panning state

Parameters:
prevBoundingBox - Previous panel bounding box
postBoundingBox - Posterior panel bounding box
Returns:
Intersected bounding boxes

addLog

public static void addLog(java.lang.Object o,
                          int level)
Add the current message to the gis log

Parameters:
o - Message to log
level - Message priority level

layerIsInValidScale

public static boolean layerIsInValidScale(double pixelSize,
                                          IGisLayer layer)
Checks is given layer can be visible for the actual scale

Parameters:
pixelSize - Actual pixel size, which gives us the actual map scale
layer - Layer to check scales

getCacheClassNameFromDataProvider

public static ICacheElement getCacheClassNameFromDataProvider(IDataProviderDefinition dataProvider)
Gets the cache class instance from the related data provider parameter

Parameters:
dataProvider - Data provider definition
Returns:
Cache element instance

getCacheParametersFromDataProvider

public static java.util.Hashtable getCacheParametersFromDataProvider(IDataProviderDefinition dataProvider)

getFragmentRequestEnabled

public static boolean getFragmentRequestEnabled(IGisLayer layer)
Check if the current layer has requests fragmentation enabled

Parameters:
layer - Gis layer
Returns:
Fragmentation enabled

getFragmentSize

public static int getFragmentSize(IGisLayer layer)
Gets the fragment side size expressed on the given gis layer

Parameters:
layer - Gis layer
Returns:
Fragment side size in map units

validDataForFilters

public static boolean validDataForFilters(java.util.Hashtable recordValues,
                                          java.lang.Object filters)
Check if the data is valid according to the filters

Parameters:
recordValues - Data pending of validation
filters - Filters to validate data
Returns:
Valid data

getCursorLocation

public static double[] getCursorLocation(java.awt.event.MouseEvent ev,
                                         com.vividsolutions.jts.geom.Envelope boundingBox,
                                         java.awt.Rectangle bounds)
Gets the geographic cursor location

Parameters:
ev - MouseEvent indicating the mouse position on the gis panel
boundingBox - Map panel bounding box
bounds - Map panel size
Returns:
Mouse location on map reference system: [x,y] or [lon, lat]

getPointLocation

public static double[] getPointLocation(java.awt.Point point,
                                        com.vividsolutions.jts.geom.Envelope boundingBox,
                                        java.awt.Rectangle bounds)
Get the geographic point location for the given area

Parameters:
point - Point location on screen coordinates
boundingBox - Map panel bounding box
bounds - Map panel size
Returns:
Point location on map reference system: [x, y] or [lon, lat]

getCoordinateLocationOnPanel

public static int[] getCoordinateLocationOnPanel(com.vividsolutions.jts.geom.Coordinate coordinate,
                                                 com.vividsolutions.jts.geom.Envelope boundingBox,
                                                 java.awt.Rectangle bounds)
Get the screen location for the given geographic coordinate

Parameters:
coordinate - Geographic coordinate
boundingBox - Map panel bounding box
bounds - Map panel size
Returns:
Screen location fo the given coordinate: [x,y]

recordHasParentKeys

public static boolean recordHasParentKeys(java.util.Hashtable<java.lang.String,java.lang.Object> recordData,
                                          java.util.Hashtable<java.lang.String,java.lang.Object> keys)
Cehck if the current data contains the given parent keys

Parameters:
recordData - Data to validate
keys - Parent keys
Returns:
Data record has the given parent keys

checkDataIsInKeyList

public static boolean checkDataIsInKeyList(java.util.Hashtable data,
                                           java.util.List<java.lang.Object> keyList,
                                           java.lang.String keyName)
Check if the data record has some of the given keys

Parameters:
data - Data record
keyList - List of possible key values
keyName - Field name containing the interest key
Returns:
Data is in list

showOnMouseOverAction

public static boolean showOnMouseOverAction(IGisLayer gisLayer,
                                            java.util.List<java.util.Hashtable> layerData,
                                            com.vividsolutions.jts.geom.Geometry location,
                                            double pixelSize,
                                            IGisViewer gisViewer,
                                            java.awt.event.MouseEvent ev)
Show the onMouseOver action for the given map panel configuration

Parameters:
gisLayer - Layer for the action
layerData - Related layer data
location - Geographic coordinate for the mouse in the map panel
pixelSize - Map panel pixel size on map units / pixel
gisViewer - Gis viewer interface
ev - Actual mouseEvent provoking the action
Returns:
Action is committed

showOnMouseClickAction

public static boolean showOnMouseClickAction(IGisLayer gisLayer,
                                             java.util.List<java.util.Hashtable> layerData,
                                             com.vividsolutions.jts.geom.Geometry location,
                                             double pixelSize,
                                             double selectionPrecission,
                                             IGisViewer gisViewer,
                                             java.awt.event.MouseEvent ev)
Show the onMouseClick action for the given map panel configuration

Parameters:
gisLayer - Layer for the action
layerData - Related layer data
location - Geographic coordinate for the mouse in the map panel
pixelSize - Map panel pixel size on map units / pixel
gisViewer - Gis viewer interface
ev - Actual mouseEvent provoking the action
Returns:
Action is committed

parseDefaultBBoxFromPreferenceList

public static com.vividsolutions.jts.geom.Envelope parseDefaultBBoxFromPreferenceList(java.lang.String bboxesListString)
Get the default viewer bounding box from the preferred bounding boxes list

Parameters:
bboxesListString - Bookmarked bounding boxes list definition
Returns:
Default bounding box

copyEnvelopeAndExpand

public static com.vividsolutions.jts.geom.Envelope copyEnvelopeAndExpand(com.vividsolutions.jts.geom.Envelope area,
                                                                         double distance)
Get a copy of the given envelope and expands its extension with the given distance value

Parameters:
area - Envelope to expand
distance - Expansion distance
Returns:
Expanded envelope

getEnvelopeFromDataRecord

public static com.vividsolutions.jts.geom.Envelope getEnvelopeFromDataRecord(java.util.Map recordData)
Get the envelope values from the geographic data stored on the given data record

Parameters:
recordData - Data record, usually a Hashtable
Returns:
Request Envelope

showGisMonitorWindow

public static void showGisMonitorWindow(IGisViewer gisViewer)