public static Geometry split ( Geometry geomA , Geometry geomB , double tolerance ) throws SQLException { if ( geomA instanceof Polygon ) { throw new SQLException ( "Split a Polygon by a line is not supported using a tolerance. \n" + "Please used ST_Split(geom1, geom2)" ) ; } else if ( geomA instanceof LineString ) { if ( geomB instanceof LineString ) { throw new SQLException ( "Split a line by a line is not supported using a tolerance. \n" + "Please used ST_Split(geom1, geom2)" ) ; } else if ( geomB instanceof Point ) { return splitLineWithPoint ( ( LineString ) geomA , ( Point ) geomB , tolerance ) ; } } else if ( geomA instanceof MultiLineString ) { if ( geomB instanceof LineString ) { throw new SQLException ( "Split a multiline by a line is not supported using a tolerance. \n" + "Please used ST_Split(geom1, geom2)" ) ; } else if ( geomB instanceof Point ) { return splitMultiLineStringWithPoint ( ( MultiLineString ) geomA , ( Point ) geomB , tolerance ) ; } } throw new SQLException ( "Split a " + geomA . getGeometryType ( ) + " by a " + geomB . getGeometryType ( ) + " is not supported." ) ; }
Split a geometry a according a geometry b using a snapping tolerance .