nl.itc.RIMapper
Class MakeSVG

java.lang.Object
  extended by nl.itc.RIMapper.MakeSVG

public class MakeSVG
extends Object

Converts SFS OGC geometry columns to Scalable Vector Graphics (SVG 1.1).
Uses Java Topology Suite (JTS 1.12) (http://sourceforge.net/projects/jts-topo-suite/)

©2004-2011 ITC - University of Twente, Faculty of Geo-Information Science and Earth Observation
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. see http://creativecommons.org/licenses/by-nc-sa/2.5/

Version:
2.2 [September 2011]
Author:
Barend Köbben - kobben@itc.nl

Field Summary
 double bboxHeight
           
 double bboxWidth
           
 String errorMessage
           
static String RIM_NAMESPACE
           
 double xMax
           
 double xMaxMap
           
 double xMin
           
 double xMinMap
           
 double yMax
           
 double yMaxMap
           
 double yMin
           
 double yMinMap
           
 
Constructor Summary
MakeSVG(DBconn theDBconn, boolean getGUI)
          method to instantiate a MakeSVG class.
 
Method Summary
 boolean isWithGUI()
           
 StringBuffer makeDefs(String[] fragmentNames, String[] fragmentTypes, String[] fragments)
          Creates the svg section, from dbase table FRAGMENTs and/or RIM XML nodes.
 StringBuffer makeFooter(String[] fragmentNames, String[] fragmentTypes, String[] fragments)
          Simple SVG footer.
 StringBuffer makeHeader(boolean MapExtentDefault, double BBxMin, double BByMin, double BBxMax, double BByMax, double FalseOriginX, double FalseOriginY, long Precision, String SVGRootFragmentName, String SVGRootFragment, int Width, int Height)
           
 StringBuffer makeLayer(String layerName, String PkeyStr, int nrLayerActions, String[] layerActionScopes, String[] layerActions, String layerType, String[] Classnames, String[] SVGstyles, String styleAttrib, boolean relativeMode, double FalseOriginX, double FalseOriginY, long Precision, String layerSQL)
          Uses JTS WKBreader to extract OGC Simple features of Layer layername and converts to SVG.
 StringBuffer makeLayerAnimated_animateMotion(String layerName, String PkeyStr, int nrLayerActions, String[] layerActionScopes, String[] layerActions, String layerType, String[] Classnames, String[] SVGstyles, boolean SVGmakeTrack, String SVGtrackStyle, long SVGanimDuration, String styleAttrib, boolean relativeMode, double FalseOriginX, double FalseOriginY, long Precision, String layerSQL, WMSTime myWMSTime)
          ################################################### TEST VERSION FOR ALTERNATIVE ANIMATION CONSTRUCT USING animateMotion Uses JTS WKBreader to extract OGC Simple features of Layer layername and converts to SVG.
 StringBuffer makeLayerAnimated(String layerName, String PkeyStr, int nrLayerActions, String[] layerActionScopes, String[] layerActions, String layerType, String[] Classnames, String[] SVGstyles, boolean SVGmakeTrack, String SVGtrackStyle, long SVGanimDuration, String styleAttrib, boolean relativeMode, double FalseOriginX, double FalseOriginY, long Precision, String layerSQL, WMSTime myWMSTime)
          ################################################### Uses JTS WKBreader to extract OGC Simple features of Layer layername and converts to SVG.
 StringBuffer makeScripts(String[] fragmentNames, String[] fragmentTypes, String[] fragments)
          Creates the ecmascript section, from dbase table FRAGMENTs and/or RIM XML nodes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RIM_NAMESPACE

public static final String RIM_NAMESPACE
See Also:
Constant Field Values

bboxHeight

public double bboxHeight

bboxWidth

public double bboxWidth

xMin

public double xMin

yMin

public double yMin

xMax

public double xMax

yMax

public double yMax

xMinMap

public double xMinMap

yMinMap

public double yMinMap

xMaxMap

public double xMaxMap

yMaxMap

public double yMaxMap

errorMessage

public String errorMessage
Constructor Detail

MakeSVG

public MakeSVG(DBconn theDBconn,
               boolean getGUI)
method to instantiate a MakeSVG class.

Parameters:
theDBconn - Database connection class (from DBconn) to be used
Method Detail

makeHeader

public StringBuffer makeHeader(boolean MapExtentDefault,
                               double BBxMin,
                               double BByMin,
                               double BBxMax,
                               double BByMax,
                               double FalseOriginX,
                               double FalseOriginY,
                               long Precision,
                               String SVGRootFragmentName,
                               String SVGRootFragment,
                               int Width,
                               int Height)
                        throws RIMapperException
Parameters:
MapExtentDefault -
BBxMin -
BByMin -
BBxMax -
BByMax -
FalseOriginX -
FalseOriginY -
Precision -
SVGRootFragmentName -
SVGRootFragment -
Width - (if 0, set to 100%)
Height - (if 0, set to 100%)
Returns:
StringBuffer with SVG code for Header
Throws:
RIMapperException

makeDefs

public StringBuffer makeDefs(String[] fragmentNames,
                             String[] fragmentTypes,
                             String[] fragments)
                      throws RIMapperException
Creates the svg section, from dbase table FRAGMENTs and/or RIM XML nodes.
The section contains:
  • SVG_FILTERs
  • SVG_SYMBOLs

Parameters:
fragmentNames -
fragmentTypes -
fragments -
Returns:
StringBuffer depicting the section
Throws:
RIMapperException

makeScripts

public StringBuffer makeScripts(String[] fragmentNames,
                                String[] fragmentTypes,
                                String[] fragments)
                         throws RIMapperException
Creates the ecmascript section, from dbase table FRAGMENTs and/or RIM XML nodes.

Parameters:
fragmentNames -
fragmentTypes -
fragments -
Returns:
StringBuffer depicting the ECMAscripts
Throws:
RIMapperException

makeFooter

public StringBuffer makeFooter(String[] fragmentNames,
                               String[] fragmentTypes,
                               String[] fragments)
                        throws RIMapperException
Simple SVG footer.

Returns:
A StringBuffer with the SVG footer
Throws:
RIMapperException

makeLayer

public StringBuffer makeLayer(String layerName,
                              String PkeyStr,
                              int nrLayerActions,
                              String[] layerActionScopes,
                              String[] layerActions,
                              String layerType,
                              String[] Classnames,
                              String[] SVGstyles,
                              String styleAttrib,
                              boolean relativeMode,
                              double FalseOriginX,
                              double FalseOriginY,
                              long Precision,
                              String layerSQL)
                       throws RIMapperException
Uses JTS WKBreader to extract OGC Simple features of Layer layername and converts to SVG.

Parameters:
layerName - the name (as used in wms_layers table)
PkeyStr -
nrLayerActions -
layerActionScopes -
layerActions -
layerType - "single" or "chorochromatic" or "animated"
Classnames - Array of classes, "defStyle" if style=single or no style requested
SVGstyles - Array of style names, 1 if style=single, "defStyle" if no style requested
styleAttrib - attributes for style(s): ALL attribs are added to SVG (rim:attrib) AND IF styletype = chorochromatic => 1st atrib = classifying attrib IF styletype = animate => 1st attrib = object identifier, 2nd = time attrib
relativeMode - true: use L=absolute lineto's (more precise); false: l=relative lineto's (more compact)
FalseOriginX -
FalseOriginY -
Precision -
layerSQL - The SQL for extracting layer data from the table
Returns:
A StringBuffer containing the SVG fragment for the layer
Throws:
RIMapperException

makeLayerAnimated

public StringBuffer makeLayerAnimated(String layerName,
                                      String PkeyStr,
                                      int nrLayerActions,
                                      String[] layerActionScopes,
                                      String[] layerActions,
                                      String layerType,
                                      String[] Classnames,
                                      String[] SVGstyles,
                                      boolean SVGmakeTrack,
                                      String SVGtrackStyle,
                                      long SVGanimDuration,
                                      String styleAttrib,
                                      boolean relativeMode,
                                      double FalseOriginX,
                                      double FalseOriginY,
                                      long Precision,
                                      String layerSQL,
                                      WMSTime myWMSTime)
                               throws RIMapperException
################################################### Uses JTS WKBreader to extract OGC Simple features of Layer layername and converts to SVG. Special case of MakeLayer for animated layers, only works for POINT data at present! ###################################################

Parameters:
layerName - the name (as used in wms_layers table)
PkeyStr -
nrLayerActions -
layerActionScopes -
layerActions -
layerType - "anim"
Classnames - Array of classes, "defStyle" if style=single or no style requested
SVGstyles - Array of style names, 1 if style=single, "defStyle" if no style requested
SVGmakeTrack - boolean true=include tracks, false = do not
SVGtrackStyle - String with SVG style for tracks
SVGanimDuration - int with initial animation duration (in seconds)
styleAttrib - attributes for style(s): ALL attribs are added to SVG (rim:attrib) AND IF styletype = chorochromatic => 1st atrib = classifying attrib IF styletype = animate => 1st attrib = object identifier, 2nd = time attrib
relativeMode - true: use L=absolute lineto's (more precise); false: l=relative lineto's (more compact)
FalseOriginX -
FalseOriginY -
Precision -
layerSQL - The SQL for extracting layer data from the table
myWMSTime - The WMSTime Object (period requested, etc)
Returns:
A StringBuffer containing the SVG fragment for the layer
Throws:
RIMapperException

isWithGUI

public boolean isWithGUI()
Returns:
the withGUI

makeLayerAnimated_animateMotion

public StringBuffer makeLayerAnimated_animateMotion(String layerName,
                                                    String PkeyStr,
                                                    int nrLayerActions,
                                                    String[] layerActionScopes,
                                                    String[] layerActions,
                                                    String layerType,
                                                    String[] Classnames,
                                                    String[] SVGstyles,
                                                    boolean SVGmakeTrack,
                                                    String SVGtrackStyle,
                                                    long SVGanimDuration,
                                                    String styleAttrib,
                                                    boolean relativeMode,
                                                    double FalseOriginX,
                                                    double FalseOriginY,
                                                    long Precision,
                                                    String layerSQL,
                                                    WMSTime myWMSTime)
                                             throws RIMapperException
################################################### TEST VERSION FOR ALTERNATIVE ANIMATION CONSTRUCT USING animateMotion Uses JTS WKBreader to extract OGC Simple features of Layer layername and converts to SVG. Special case of MakeLayer for animated layers, only works for POINT data at present! ###################################################

Parameters:
layerName - the name (as used in wms_layers table)
PkeyStr -
nrLayerActions -
layerActionScopes -
layerActions -
layerType - "anim"
Classnames - Array of classes, "defStyle" if style=single or no style requested
SVGstyles - Array of style names, 1 if style=single, "defStyle" if no style requested
SVGmakeTrack - boolean true=include tracks, false = do not
SVGtrackStyle - String with SVG style for tracks
SVGanimDuration - int with initial animation duration (in seconds)
styleAttrib - attributes for style(s): ALL attribs are added to SVG (rim:attrib) AND IF styletype = chorochromatic => 1st atrib = classifying attrib IF styletype = animate => 1st attrib = object identifier, 2nd = time attrib
relativeMode - true: use L=absolute lineto's (more precise); false: l=relative lineto's (more compact)
FalseOriginX -
FalseOriginY -
Precision -
layerSQL - The SQL for extracting layer data from the table
myWMSTime - The WMSTime Object (period requested, etc)
Returns:
A StringBuffer containing the SVG fragment for the layer
Throws:
RIMapperException