[Geotools-gt2-users] Re moving all features in a datastore...

2008-01-11 Thread leaffan
Hejhej, I've come up with a way to remove all features of a datastore... However, I'm quite sure that there are more efficient ways to do this, getting rid of this awkward iteration. Maybe someone can enlighten me. Thanks very much in advance. Markus Code, created for shapefiles...

Re: [Geotools-gt2-users] Re moving all features in a datastore...

2008-01-11 Thread Andrea Aime
leaffan ha scritto: Hejhej, I've come up with a way to remove all features of a datastore... However, I'm quite sure that there are more efficient ways to do this, getting rid of this awkward iteration. Maybe someone can enlighten me. FeatureStore stor = (FeatureStore)

Re: [Geotools-gt2-users] Re moving all features in a datastore...

2008-01-11 Thread Andrea Aime
leaffan ha scritto: Hejhej, I've come up with a way to remove all features of a datastore... However, I'm quite sure that there are more efficient ways to do this, getting rid of this awkward iteration. Maybe someone can enlighten me. FeatureStore stor = (FeatureStore)

[Geotools-gt2-users] Splitting LineStrings at their intersection

2008-01-11 Thread Chris
Hi, After loading a shapefile (ESRI), I created a graph using a DirectedLineStringGraphGenerator. The creation went fine but when using a DijkstraShortestPathFinder.getPath() on it, I noticed that there was a problem because it returned null. Apparently, the linestring graph generator does not

Re: [Geotools-gt2-users] Splitting LineStrings at their intersection

2008-01-11 Thread Justin Deoliveira
Hi Chris, I would have to mock up some data and test it but I dont think the problem is the method but in the management of the data structure. The code is modifying the same list it is iterating over... which is generally not a great idea. I recommend restructuring the algorithm so that when

Re: [Geotools-gt2-users] Splitting LineStrings at their intersection

2008-01-11 Thread Chris
I added some debug, and apparently, the LineString intersection is not due to my algorithm. It happens approximately 12 times in the first loop iteration, then it does not happen anymore. This was probably due to my shapefile. So I chose to ignore the LineString intersections and now my algorithm

Re: [Geotools-gt2-users] Splitting LineStrings at their intersection

2008-01-11 Thread Chris
I tried to use another Vector as you advised. This way, the size the the lines Vector is not changing while iterating on it. I'm joining the new code to this mail. It is taking quite some time (2-3 minutes) but this time I got an exception: java.lang.ClassCastException:

Re: [Geotools-gt2-users] Splitting LineStrings at their intersection

2008-01-11 Thread Justin Deoliveira
Chris wrote: I added some debug, and apparently, the LineString intersection is not due to my algorithm. It happens approximately 12 times in the first loop iteration, then it does not happen anymore. This was probably due to my shapefile. So I chose to ignore the LineString intersections