Issue Details (XML | Word | Printable)

Key: GEOT-422
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Justin Deoliveira
Reporter: myriam benkirane
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
GeoTools

Build Graph

Created: 12/Feb/05 09:26 AM   Updated: 27/Oct/06 01:53 PM
Component/s: ext graph
Affects Version/s: 2.0.RC1
Fix Version/s: 2.2.0

Environment: XP Pro


 Description  « Hide
Hello

Please i m using the class linegraphbuilder to build a graph from a shapefile. this is the code i used:

LineGraphBuilder lgb = new LineGraphBuilder();

FeatureSource fs = this.frame.mapPane.getMapContext().getLayer(0).getFeatureSource();
FeatureResults fr = fs.getFeatures();
FeatureCollection fc = fr.collection();
FeatureIterator f = fc.features();

//envelope - The bounding box that encloses the unvalidated data
Envelope envelope = fc.getBounds();

while (f.hasNext())
{
Feature ft = f.next();
if (envelope.contains(ft.getBounds())) { lgb.add(ft); }
}
org.geotools.graph.Graph g = lgb.build();

but what i read in the documentation is that add() function work with feature with linestring geometry, however the feature that are extracted from the shapefile are of type MultilineString

So is there a way to solve this problem or i can not use at all the class linegraphbuilder

thanks in advance



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order

Jody Garnett added a comment - 05/Mar/06 06:25 PM
This appears to be ready to close, you may consider it a documenation request by the looks of it.