org.deegree_impl.io.shpapi
Class SHP2WKS

java.lang.Object
  extended byorg.deegree_impl.io.shpapi.SHP2WKS

public class SHP2WKS
extends java.lang.Object

the class SHP2WKS transforms a polygon structure read from a shape-file
into a WKSLinearPolygon specified by the sf-specifications

Last changes:
14.12.1999 ap: import clauses added
08.02.2000 ap: method transformPoint(..) declared and implemented
21.03.2000 ap: method: transformMultiPoint(..) declared and implemented
21.03.2000 ap: method: transformPolyLine(..) declared and implemented

Version:
21.03.2000
Author:
Andreas Poth

Constructor Summary
SHP2WKS()
           
 
Method Summary
private  boolean ccw(SHPPoint[] ring)
           
private  GM_Envelope getRange(SHPPoint[] ring, int[] pts)
          method: getRange(LinearRing ring, int[] pts)
returns the range envelope of a polygon. after calling getRange
the array pts contains the indieces of the points corresponding
to the left, top, right and bottom of the range envelope.
private  boolean isInsideRing(GM_Position[] ring, GM_Position point)
          method: private boolean isInsideRing(GM_Point[] ring, GM_Point point)
checks if a point is inside a polygon. the algorithm is taken from:
http://www.ics.uci.edu/~eppstein/161/960307.html#intest
 GM_Point[] transformMultiPoint(CS_CoordinateSystem srs, SHPMultiPoint shpmultipoint)
          method: GM_Point[] transformMultiPoint(CS_CoordinateSystem srs,
SHPMultiPoint shpmultipoint))
transforms a SHPMultiPoint to a WKSGeometry
gets a multipoint that should be transformed
 GM_Point transformPoint(CS_CoordinateSystem crs, SHPPoint shppoint)
          method: GM_Point transformPoint(CS_CoordinateSystem srs,
SHPPoint shppoint))
transforms a SHPPoint to a WKSGeometry
gets a point that should be transformed
 GM_Surface[] transformPolygon(CS_CoordinateSystem crs, SHPPolygon shppolygon)
          transforms the SHPPolygon to a WKSGeometry
gets the polygon that should be transformed
 GM_Curve[] transformPolyLine(CS_CoordinateSystem crs, SHPPolyLine shppolyline)
          method: GM_Point[][] transformPolyLine(CS_CoordinateSystem srs,
SHPPolyLine shppolyline))
transforms a SHPPolyLine to a WKSGeometry
gets a polyline that should be transformed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHP2WKS

public SHP2WKS()
Method Detail

transformPoint

public GM_Point transformPoint(CS_CoordinateSystem crs,
                               SHPPoint shppoint)
method: GM_Point transformPoint(CS_CoordinateSystem srs,
SHPPoint shppoint))
transforms a SHPPoint to a WKSGeometry
gets a point that should be transformed


transformMultiPoint

public GM_Point[] transformMultiPoint(CS_CoordinateSystem srs,
                                      SHPMultiPoint shpmultipoint)
method: GM_Point[] transformMultiPoint(CS_CoordinateSystem srs,
SHPMultiPoint shpmultipoint))
transforms a SHPMultiPoint to a WKSGeometry
gets a multipoint that should be transformed


transformPolyLine

public GM_Curve[] transformPolyLine(CS_CoordinateSystem crs,
                                    SHPPolyLine shppolyline)
method: GM_Point[][] transformPolyLine(CS_CoordinateSystem srs,
SHPPolyLine shppolyline))
transforms a SHPPolyLine to a WKSGeometry
gets a polyline that should be transformed


getRange

private GM_Envelope getRange(SHPPoint[] ring,
                             int[] pts)
method: getRange(LinearRing ring, int[] pts)
returns the range envelope of a polygon. after calling getRange
the array pts contains the indieces of the points corresponding
to the left, top, right and bottom of the range envelope.


ccw

private boolean ccw(SHPPoint[] ring)
Parameters:
ring -
Returns:

isInsideRing

private boolean isInsideRing(GM_Position[] ring,
                             GM_Position point)
method: private boolean isInsideRing(GM_Point[] ring, GM_Point point)
checks if a point is inside a polygon. the algorithm is taken from:
http://www.ics.uci.edu/~eppstein/161/960307.html#intest


transformPolygon

public GM_Surface[] transformPolygon(CS_CoordinateSystem crs,
                                     SHPPolygon shppolygon)
transforms the SHPPolygon to a WKSGeometry
gets the polygon that should be transformed