Re: [JPP-Devel] Shapefile reader

2009-05-11 Thread Michaël Michaud
Hi, Thank you for the answers about this topic. ShapefileReader is not great but it just works. I'll see what I can do to improve PolygonHandler a bit (following Martin's and Larry's recommendations). Moving to a recent geotools driver is another option which, I think, needs more work and more t

Re: [JPP-Devel] Shapefile reader

2009-05-11 Thread Larry Becker
BTW, the original thread is archived here: http://www.mail-archive.com/jump-pilot-devel@lists.sourceforge.net/msg04403.html Larry On Mon, May 11, 2009 at 3:57 PM, Larry Becker wrote: > When I last worked on the issue that is the topic of this thread (last year > sometime), I tried to use the geo

Re: [JPP-Devel] Shapefile reader

2009-05-11 Thread Larry Becker
When I last worked on the issue that is the topic of this thread (last year sometime), I tried to use the geotools code to solve the problem, but it seemed to be buggy so I abandoned it. I don't recall anything specific, but I did make the effort. regards, Larry On Mon, May 11, 2009 at 3:49 PM,

Re: [JPP-Devel] Shapefile reader

2009-05-11 Thread Edgar Soldin
if the current geotools (just checked they are 2.5.5 stable now) shapefile reader/writer is more advanced why not aiming on using it .. i once wrote a geotools reader/writer extension, that should be possible these days as well ... only problem was that I had to convert the data structure because i

Re: [JPP-Devel] Shapefile reader

2009-05-11 Thread Martin Davis
Michaël Michaud wrote: > Hi, > > As I tried to fix a bug in PolygonHandler (see end of e-mail), I noticed > some other strange pieces of code in this class. > > The ShapefileReader code is really horrific, IMHO. We grabbed it from an early release of GeoTools, and never upgraded it since it

Re: [JPP-Devel] Shapefile reader

2009-05-11 Thread Martin Davis
Michaël Michaud wrote: > > line 170 if(points.length == 0 || points.length > 3){ > I don't understand why 1 and 2 points rings are filtered and not 0 point > rings, but it may be necessary to hold some kind of empty geometries > Yes, 0 points are allowed to support empty geometries. -- Mart

Re: [JPP-Devel] Shapefile reader

2009-05-11 Thread Larry Becker
Hi Michaël, line 218 CGAlgorithms.isPointInRing(jPt, coordList) || > pointInList(jPt,coordList) > The second test is just paranoia that isPointInRing is not robust for non-fixed point math. I haven't scanned the jts code to see what it actually does. @Larry : I replaced a quick 'ring in ring' t

[JPP-Devel] Shapefile reader

2009-05-10 Thread Michaël Michaud
Hi, As I tried to fix a bug in PolygonHandler (see end of e-mail), I noticed some other strange pieces of code in this class. I'd like to clean it a bit, but it is a very useful class and I don't want to break a working code. If Larry or somebody else would be kind enough to check the following