Hello, Firstly, please format your messages and code snippets so that they are readable.
Have you looked at the GeoTools tutorials ? If not, the Feature Tutorial will get you started on creating features and feature types, adding them to a feature collection and saving them to file (a shapefile in that example). http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html Michael On 9 March 2012 10:24, for_science <[email protected]> wrote: > Hi guys, I am implementing an interpolation of trajectory points. So, > basically, I need to create several points along the azimuth from a starting > point to a destination point. The problem is, I can't add a created point to > a collection: SimpleFeatureType featureType = featureSource.getSchema(); > GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); > SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(featureType); > SimpleFeatureCollection collection = featureSource.getFeatures(); /* > Irrelevant code here ----------------------- */ Point2D newPt = > setPointByAzimuth(startingPointCoords, azimuth, distance_to_next_point); > Point pointToCollection = geometryFactory.createPoint(new > Coordinate(newPt.getX(), newPt.getY())); > featureBuilder.add(pointToCollection); //not quite sure what this does > SimpleFeature feature = featureBuilder.buildFeature(null); > collection.add(feature); However, when I run this, the collection size does > not change and nothing gets added to this collection. I am not sure what's > the problem here. Thanks, > ________________________________ > View this message in context: Problem creaing a point and adding it to > featureCollection > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > GeoTools-GT2-Users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ GeoTools-GT2-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
