Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-02-01 Thread Sunburned Surveyor
Thanks for the patch Michael. Thanks for testing it out Larry. Landon On Sat, Jan 30, 2010 at 10:00 PM, Larry Reeder wrote: >> I could not reproduce the problem with mixed geometry, but found a bug >> (NPE) for null non-numeric attributes. >> I think the NPE you get is due to this bug (null attr

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-30 Thread Larry Reeder
> I could not reproduce the problem with mixed geometry, but found a bug > (NPE) for null non-numeric attributes. > I think the NPE you get is due to this bug (null attributes) and not due > to empty geometry collections. > I committed the change. > When you'll have time, please, can you tell me it

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-30 Thread Michaël Michaud
Hi Larry Reeder, >> Not too bad. Could you fill a bug report so that we remember there is a >> fix to do on this plugin. >> > Sure, done. > I could not reproduce the problem with mixed geometry, but found a bug (NPE) for null non-numeric attributes. I think the NPE you get is due to this

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-29 Thread Larry Reeder
>> > Not too bad. Could you fill a bug report so that we remember there is a > fix to do on this plugin. Sure, done. > Did you already use the "Edit>Extract>Extract by geometry type" PlugIn ? > It is perfectly suited to handle shapefile with heterogeneous geometries. > I'd prefer this solution fr

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Michaël Michaud
Hi Larry, Nice to hear you already tested GeometryCollection solution. > to work, except Tools-->Statistics-->Layer Attribute Statistics, which > threw the following NPE: > > java.lang.NullPointerException > at > org.openjump.core.apitools.FeatureCollectionTools.getMeanOrModeForAttributes(F

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Larry Reeder
I'm not real happy with my "create a geometry around the origin" hack for the DB Query Plugin, and it would be awesome if OJ had some way to represent null geometries. I tweaked my DB Query plugin to return empty geometry collections as suggested, and everything seemed to work fine with a set of

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Michaël Michaud
Martin Davis a écrit : > I think in the past I"ve used the convention that null geometry is > represented as GEOMETRYCOLLECTION EMPTY. That way most or all of the > JUMP functions should still work, but the user doesn't have to try and > distinguish between a real geometry and one which is just

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Michaël Michaud
Hi, > I don't recall that OpenJUMP can handle having a feature with no > geometry. If nothing else, I think it would choke the renderer and > would throw a null pointer exception. I could be wrong. Maybe one of > the other programmers can comment. > I think the same thing > I suppose it would be

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Michaël Michaud
Rahkonen Jukka a écrit : > Hi, > > It would be a correct behaviour to get nulls instead of zeros, I hope you can > fix it. But check what happens if some attribute in a table or in the result > set of a query contains only NULLs. The attribute field should still appear > to OpenJUMP layer schem

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Martin Davis
I don't think selecting features with null geometry should be a problem. As you say, this can only be done in the Attribute View, not spatially - but the behaviour of the selected feature should be pretty straightforward. It's in the selection set, but just isn't displayed. Another issue w

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Sunburned Surveyor
Well, maybe we need to put together a list of places where OpenJUMP might choke on a null geometry, and then we can test a fix. Here is a start: 1) When the feature is about to be rendered. 2) When the user attempts to select the feature on the screen from the attribute table. 3) When the user at

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Martin Davis
I think in the past I"ve used the convention that null geometry is represented as GEOMETRYCOLLECTION EMPTY. That way most or all of the JUMP functions should still work, but the user doesn't have to try and distinguish between a real geometry and one which is just a placeholder for null. Idea

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Sunburned Surveyor
I don't use OpenJUMP with databases, but these are interesting issues. Jukka wrote: "So what do developers think about what to do with features which do not have geometry? I am remembering that JUMP itself does not necessarily need geometry and I am rather sure that I have even seen such things i

Re: [JPP-Devel] Null handling in OJ and in PlugIns

2010-01-28 Thread Rahkonen Jukka
Hi, It would be a correct behaviour to get nulls instead of zeros, I hope you can fix it. But check what happens if some attribute in a table or in the result set of a query contains only NULLs. The attribute field should still appear to OpenJUMP layer schema, and it should be of a correct dat