private static Geometry shadowLine ( LineString lineString , double [ ] shadowOffset , GeometryFactory factory , boolean doUnion ) { Coordinate [ ] coords = lineString . getCoordinates ( ) ; Collection < Polygon > shadows = new ArrayList < Polygon > ( ) ; createShadowPolygons ( shadows , coords , shadowOffset , factory ) ; if ( ! doUnion ) { return factory . buildGeometry ( shadows ) ; } else { if ( ! shadows . isEmpty ( ) ) { CascadedPolygonUnion union = new CascadedPolygonUnion ( shadows ) ; Geometry result = union . union ( ) ; result . apply ( new UpdateZCoordinateSequenceFilter ( 0 , 1 ) ) ; return result ; } return null ; } }
Compute the shadow for a linestring