question: public List < Point > readPoints ( String shapefile ) { List < Point > list = new ArrayList < Point > ( ) ; for ( SimpleFeature feature : ShapeFileReader . getAllFeatures ( shapefile ) ) { Geometry geo = ( Geometry ) feature . getDefaultGeometry ( ) ; if ( geo instanceof Point ) { Point ps = ( Point ) geo ; for ( int i = 0 ; i < ps . getNumGeometries ( ) ; i ++ ) { Point p = ( Point ) ps . getGeometryN ( i ) ; list . add ( p ) ; } } else { throw new RuntimeException ( "The shapefile does not contain Point(s)!" ) ; } } return list ; }
target:  Reads a point feature shapefile.