public SimpleFeature convertDwgPoint ( String typeName , String layerName , DwgPoint point , int id ) { double [ ] p = point . getPoint ( ) ; Point2D pto = new Point2D . Double ( p [ 0 ] , p [ 1 ] ) ; CoordinateList coordList = new CoordinateList ( ) ; Coordinate coord = new Coordinate ( pto . getX ( ) , pto . getY ( ) , 0.0 ) ; coordList . add ( coord ) ; SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder ( ) ; b . setName ( typeName ) ; b . setCRS ( crs ) ; b . add ( THE_GEOM , MultiPoint . class ) ; b . add ( LAYER , String . class ) ; SimpleFeatureType type = b . buildFeatureType ( ) ; SimpleFeatureBuilder builder = new SimpleFeatureBuilder ( type ) ; Geometry points = gF . createMultiPoint ( coordList . toCoordinateArray ( ) ) ; Object [ ] values = new Object [ ] { points , layerName } ; builder . addAll ( values ) ; return builder . buildFeature ( typeName + "." + id ) ; }
Builds a point feature from a dwg point .