private static Geometry insertVertexInMultipoint ( Geometry g , Point vertexPoint ) { ArrayList < Point > geoms = new ArrayList < Point > ( ) ; for ( int i = 0 ; i < g . getNumGeometries ( ) ; i ++ ) { Point geom = ( Point ) g . getGeometryN ( i ) ; geoms . add ( geom ) ; } geoms . add ( FACTORY . createPoint ( new Coordinate ( vertexPoint . getX ( ) , vertexPoint . getY ( ) ) ) ) ; return FACTORY . createMultiPoint ( GeometryFactory . toPointArray ( geoms ) ) ; }
Adds a Point into a MultiPoint geometry .