From: Graham D. <gd...@re...> - 2005-08-02 23:46:47
|
Hi, I'm trying to figure out/fix why boolean filters are not working properly with geotools and WFS. I am testing with GeoServer and using GeoTools 2.1.x. When I make any simple literal WFS request, I am getting a null pointer exception, which has been previously posted on jira in April (http://jira.codehaus.org/browse/GEOT-494) but it seems no one has gotten anywhere with it. So I am mailing the list to see if anyone can help me with this problem. I am getting the same problem as listed in the jira bug above, except I am sending a WFS request instead of SLD (the line number in the code is slightly different too, but this is probably because a the jira bug is listed for version 2.1.M3 from April). My error output is: StackTrace: java.lang.NullPointerException at org.geotools.filter.CompareFilterImpl.contains(CompareFilterImpl.java:177) at org.geotools.data.FilteringFeatureReader.hasNext(FilteringFeatureReader.java:120) at org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:78) at org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:78) at org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:246) at org.vfny.geoserver.wfs.responses.FeatureResponse.execute(FeatureResponse.java:286) ... Since boolean filters aren't working properly, I wanted to test another simple filter, but it also gives me this null pointer error. The test request I am sending (not the boolean one) is this: <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" service="WFS" version="1.0.0" outputFormat="GML2" maxFeatures="100"> <wfs:Query typeName="MALtest:ortholayer"> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>IMAGE_ID</ogc:PropertyName> <ogc:Literal>23</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> </wfs:Query> </wfs:GetFeature> It appears the object leftObj in the GeoTools code ( Object leftObj = leftValue.getValue(feature); ) is causing the error, but I am not very familiar with this code. The leftValue object is refering to IMAGE_ID from my request and the rightValue object is the 23. I know that this problem did not occur in older versions of GeoTools because I am also testing on an older setup of GeoServer (which uses an older version of GeoTools although I am not sure which) and this null pointer error does not occur with the older version (in fact the above request works fine). Once I can get past this null pointer error with the newer GeoServer code, I can move on to try and fix the boolean filter problem. Is anyone familiar with this area of code that can help? BTW, if anyone is interested, the boolean filter request I have that doesn't work (it currently gives the same null pointer error as above, but with the older GeoTools code it always returns no results - which is wrong) is here: <?xml version="1.0" encoding="UTF-8"?> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" service="WFS" version="1.0.0" outputFormat="GML2" maxFeatures="100"> <wfs:Query typeName="MALtest:ortholayer"> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>IS_COLOUR</ogc:PropertyName> <ogc:Literal>false</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> </wfs:Query> </wfs:GetFeature> Thanks in advance to any help, -- Graham Davis Refractions Research Inc. gd...@re... |
From: <db...@op...> - 2005-08-03 13:53:36
|
If you could make a jira bug report with the shapefile, we can probably track down the problem. <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>IMAGE_ID</ogc:PropertyName> <ogc:Literal>23</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> I've used lots of filters very similiar to this, so its unlikely the actual parser - its probably something to do with how its interacting with the data. What type is IMAGE_ID - is it an integer or a string? dave ---------------------------------------------------------- This mail sent through IMP: https://webmail.limegroup.com/ |
From: David Z. <dav...@gm...> - 2005-08-03 03:23:19
|
This is the SAX based filter parser ... I don't know of anyone maintaining that version. David On 8/2/05, Graham Davis <gd...@re...> wrote: > Hi, >=20 > I'm trying to figure out/fix why boolean filters are not working > properly with geotools and WFS. I am testing with GeoServer and using > GeoTools 2.1.x. >=20 > When I make any simple literal WFS request, I am getting a null pointer > exception, which has been previously posted on jira in April > (http://jira.codehaus.org/browse/GEOT-494) but it seems no one has > gotten anywhere with it. So I am mailing the list to see if anyone can > help me with this problem. I am getting the same problem as listed in > the jira bug above, except I am sending a WFS request instead of SLD > (the line number in the code is slightly different too, but this is > probably because a the jira bug is listed for version 2.1.M3 from > April). My error output is: >=20 > StackTrace: java.lang.NullPointerException > at > org.geotools.filter.CompareFilterImpl.contains(CompareFilterImpl.java:177= ) > at > org.geotools.data.FilteringFeatureReader.hasNext(FilteringFeatureReader.j= ava:120) > at org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:7= 8) > at org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:7= 8) > at > org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.ja= va:246) > at > org.vfny.geoserver.wfs.responses.FeatureResponse.execute(FeatureResponse.= java:286) > ... >=20 > Since boolean filters aren't working properly, I wanted to test another > simple filter, but it also gives me this null pointer error. The test > request I am sending (not the boolean one) is this: >=20 > <?xml version=3D"1.0" encoding=3D"UTF-8"?> > <wfs:GetFeature xmlns:wfs=3D"http://www.opengis.net/wfs" > xmlns:ogc=3D"http://www.opengis.net/ogc" > xmlns:gml=3D"http://www.opengis.net/gml" service=3D"WFS" version=3D"1.0.= 0" > outputFormat=3D"GML2" maxFeatures=3D"100"> > <wfs:Query typeName=3D"MALtest:ortholayer"> > <ogc:Filter> > <ogc:PropertyIsEqualTo> > <ogc:PropertyName>IMAGE_ID</ogc:PropertyName> > <ogc:Literal>23</ogc:Literal> > </ogc:PropertyIsEqualTo> > </ogc:Filter> > </wfs:Query> > </wfs:GetFeature> >=20 > It appears the object leftObj in the GeoTools code ( Object leftObj =3D > leftValue.getValue(feature); ) is causing the error, but I am not very > familiar with this code. The leftValue object is refering to IMAGE_ID > from my request and the rightValue object is the 23. I know that this > problem did not occur in older versions of GeoTools because I am also > testing on an older setup of GeoServer (which uses an older version of > GeoTools although I am not sure which) and this null pointer error does > not occur with the older version (in fact the above request works > fine). Once I can get past this null pointer error with the newer > GeoServer code, I can move on to try and fix the boolean filter > problem. Is anyone familiar with this area of code that can help? >=20 > BTW, if anyone is interested, the boolean filter request I have that > doesn't work (it currently gives the same null pointer error as above, > but with the older GeoTools code it always returns no results - which is > wrong) is here: >=20 > <?xml version=3D"1.0" encoding=3D"UTF-8"?> > <wfs:GetFeature xmlns:wfs=3D"http://www.opengis.net/wfs" > xmlns:ogc=3D"http://www.opengis.net/ogc" > xmlns:gml=3D"http://www.opengis.net/gml" service=3D"WFS" version=3D"1.0.= 0" > outputFormat=3D"GML2" maxFeatures=3D"100"> > <wfs:Query typeName=3D"MALtest:ortholayer"> > <ogc:Filter> > <ogc:PropertyIsEqualTo> > <ogc:PropertyName>IS_COLOUR</ogc:PropertyName> > <ogc:Literal>false</ogc:Literal> > </ogc:PropertyIsEqualTo> > </ogc:Filter> > </wfs:Query> > </wfs:GetFeature> >=20 > Thanks in advance to any help, >=20 > -- > Graham Davis > Refractions Research Inc. > gd...@re... >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclic= k > _______________________________________________ > Geotools-devel mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-devel > |
From: Chris H. <ch...@op...> - 2005-08-03 10:04:32
|
I'm 95% sure this is not a problem with the filter parser - this code is in the actual filter handling code. I would say that it's a case sensitivity issue, since that's what that error generally is from (or from requesting an attribute that just isn't there), but I'm thrown off by the fact that it works in older versions. I think David Blasby changed the code around in that method a bit. We should have better error checking on the getValue call, to make sure it actually gets values back, and throw errors if it's asking for an attribute that is not in the feature. Basically what happens in the getValue call is that it gets the object for that expression. In the case of a literal (23), it just returns the literal. In the case of an AttributeExpression (IMAGE_ID), it calls feature.getAttribute(IMAGE_ID), which should return whatever value is there for the feature. I assume you're using a shapefile on the backend of GeoServer? You may try lower case image_id - but I feel like GeoServer does some checks before you get to that case. I could be wrong though. Chris Quoting David Zwiers <dav...@gm...>: > This is the SAX based filter parser ... I don't know of anyone > maintaining that version. > > David > > On 8/2/05, Graham Davis <gd...@re...> wrote: > > Hi, > > > > I'm trying to figure out/fix why boolean filters are not working > > properly with geotools and WFS. I am testing with GeoServer and > using > > GeoTools 2.1.x. > > > > When I make any simple literal WFS request, I am getting a null > pointer > > exception, which has been previously posted on jira in April > > (http://jira.codehaus.org/browse/GEOT-494) but it seems no one has > > gotten anywhere with it. So I am mailing the list to see if anyone > can > > help me with this problem. I am getting the same problem as listed > in > > the jira bug above, except I am sending a WFS request instead of > SLD > > (the line number in the code is slightly different too, but this is > > probably because a the jira bug is listed for version 2.1.M3 from > > April). My error output is: > > > > StackTrace: java.lang.NullPointerException > > at > > > org.geotools.filter.CompareFilterImpl.contains(CompareFilterImpl.java:177) > > at > > > org.geotools.data.FilteringFeatureReader.hasNext(FilteringFeatureReader.java:120) > > at > org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:78) > > at > org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:78) > > at > > > org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:246) > > at > > > org.vfny.geoserver.wfs.responses.FeatureResponse.execute(FeatureResponse.java:286) > > ... > > > > Since boolean filters aren't working properly, I wanted to test > another > > simple filter, but it also gives me this null pointer error. The > test > > request I am sending (not the boolean one) is this: > > > > <?xml version="1.0" encoding="UTF-8"?> > > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" > > xmlns:ogc="http://www.opengis.net/ogc" > > xmlns:gml="http://www.opengis.net/gml" service="WFS" > version="1.0.0" > > outputFormat="GML2" maxFeatures="100"> > > <wfs:Query typeName="MALtest:ortholayer"> > > <ogc:Filter> > > <ogc:PropertyIsEqualTo> > > <ogc:PropertyName>IMAGE_ID</ogc:PropertyName> > > <ogc:Literal>23</ogc:Literal> > > </ogc:PropertyIsEqualTo> > > </ogc:Filter> > > </wfs:Query> > > </wfs:GetFeature> > > > > It appears the object leftObj in the GeoTools code ( Object > leftObj = > > leftValue.getValue(feature); ) is causing the error, but I am not > very > > familiar with this code. The leftValue object is refering to > IMAGE_ID > > from my request and the rightValue object is the 23. I know that > this > > problem did not occur in older versions of GeoTools because I am > also > > testing on an older setup of GeoServer (which uses an older version > of > > GeoTools although I am not sure which) and this null pointer error > does > > not occur with the older version (in fact the above request works > > fine). Once I can get past this null pointer error with the newer > > GeoServer code, I can move on to try and fix the boolean filter > > problem. Is anyone familiar with this area of code that can help? > > > > BTW, if anyone is interested, the boolean filter request I have > that > > doesn't work (it currently gives the same null pointer error as > above, > > but with the older GeoTools code it always returns no results - > which is > > wrong) is here: > > > > <?xml version="1.0" encoding="UTF-8"?> > > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" > > xmlns:ogc="http://www.opengis.net/ogc" > > xmlns:gml="http://www.opengis.net/gml" service="WFS" > version="1.0.0" > > outputFormat="GML2" maxFeatures="100"> > > <wfs:Query typeName="MALtest:ortholayer"> > > <ogc:Filter> > > <ogc:PropertyIsEqualTo> > > <ogc:PropertyName>IS_COLOUR</ogc:PropertyName> > > <ogc:Literal>false</ogc:Literal> > > </ogc:PropertyIsEqualTo> > > </ogc:Filter> > > </wfs:Query> > > </wfs:GetFeature> > > > > Thanks in advance to any help, > > > > -- > > Graham Davis > > Refractions Research Inc. > > gd...@re... > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration > Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. > http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > _______________________________________________ > > Geotools-devel mailing list > > Geo...@li... > > https://lists.sourceforge.net/lists/listinfo/geotools-devel > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration > Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click > _______________________________________________ > Geotools-devel mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-devel > ---------------------------------------------------------- This mail sent through IMP: https://webmail.limegroup.com/ |
From: Graham D. <gd...@re...> - 2005-08-03 17:18:37
|
Thanks for the help so far regarding this problem. Dave - I've posted a Jira bug report for this bug and included the shapefile (http://jira.codehaus.org/browse/GEOT-648). IMAGE_ID is of type double. Chris - I've tried changing the case of the IMAGE_ID field, but if it is not all in caps then GeoServer doesn't find the reource period. When it is in caps GeoServer finds it fine, but the error occurs. I will continue trying to debug/fix the problem, but any help is appreciated. Thanks! Graham. Graham Davis wrote: > Hi, > > I'm trying to figure out/fix why boolean filters are not working > properly with geotools and WFS. I am testing with GeoServer and using > GeoTools 2.1.x. > When I make any simple literal WFS request, I am getting a null > pointer exception, which has been previously posted on jira in April > (http://jira.codehaus.org/browse/GEOT-494) but it seems no one has > gotten anywhere with it. So I am mailing the list to see if anyone > can help me with this problem. I am getting the same problem as > listed in the jira bug above, except I am sending a WFS request > instead of SLD (the line number in the code is slightly different too, > but this is probably because a the jira bug is listed for version > 2.1.M3 from April). My error output is: > > StackTrace: java.lang.NullPointerException > at > org.geotools.filter.CompareFilterImpl.contains(CompareFilterImpl.java:177) > > at > org.geotools.data.FilteringFeatureReader.hasNext(FilteringFeatureReader.java:120) > > at > org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:78) > at > org.geotools.data.MaxFeatureReader.hasNext(MaxFeatureReader.java:78) > at > org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:246) > > at > org.vfny.geoserver.wfs.responses.FeatureResponse.execute(FeatureResponse.java:286) > > ... > > Since boolean filters aren't working properly, I wanted to test > another simple filter, but it also gives me this null pointer error. > The test request I am sending (not the boolean one) is this: > > <?xml version="1.0" encoding="UTF-8"?> > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" > xmlns:ogc="http://www.opengis.net/ogc" > xmlns:gml="http://www.opengis.net/gml" service="WFS" version="1.0.0" > outputFormat="GML2" maxFeatures="100"> > <wfs:Query typeName="MALtest:ortholayer"> > <ogc:Filter> > <ogc:PropertyIsEqualTo> > <ogc:PropertyName>IMAGE_ID</ogc:PropertyName> > <ogc:Literal>23</ogc:Literal> > </ogc:PropertyIsEqualTo> > </ogc:Filter> > </wfs:Query> > </wfs:GetFeature> > > It appears the object leftObj in the GeoTools code ( Object leftObj = > leftValue.getValue(feature); ) is causing the error, but I am not > very familiar with this code. The leftValue object is refering to > IMAGE_ID from my request and the rightValue object is the 23. I know > that this problem did not occur in older versions of GeoTools because > I am also testing on an older setup of GeoServer (which uses an older > version of GeoTools although I am not sure which) and this null > pointer error does not occur with the older version (in fact the above > request works fine). Once I can get past this null pointer error with > the newer GeoServer code, I can move on to try and fix the boolean > filter problem. Is anyone familiar with this area of code that can help? > > BTW, if anyone is interested, the boolean filter request I have that > doesn't work (it currently gives the same null pointer error as above, > but with the older GeoTools code it always returns no results - which > is wrong) is here: > > <?xml version="1.0" encoding="UTF-8"?> > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" > xmlns:ogc="http://www.opengis.net/ogc" > xmlns:gml="http://www.opengis.net/gml" service="WFS" version="1.0.0" > outputFormat="GML2" maxFeatures="100"> > <wfs:Query typeName="MALtest:ortholayer"> > <ogc:Filter> > <ogc:PropertyIsEqualTo> > <ogc:PropertyName>IS_COLOUR</ogc:PropertyName> > <ogc:Literal>false</ogc:Literal> > </ogc:PropertyIsEqualTo> > </ogc:Filter> > </wfs:Query> > </wfs:GetFeature> > > Thanks in advance to any help, > -- Graham Davis Refractions Research Inc. gd...@re... |
From: Jody G. <jga...@re...> - 2005-08-03 17:21:42
|
Graham Davis wrote: > Thanks for the help so far regarding this problem. > > Dave - I've posted a Jira bug report for this bug and included the > shapefile (http://jira.codehaus.org/browse/GEOT-648). IMAGE_ID is of > type double. > Chris - I've tried changing the case of the IMAGE_ID field, but if it > is not all in caps then GeoServer doesn't find the reource period. > When it is in caps GeoServer finds it fine, but the error occurs. > > I will continue trying to debug/fix the problem, but any help is > appreciated. Thanks! Graham I ran into a problem with one of the Attribute expression implementations, it would always throw a null pointer exception when constructed with an AttributeType and a name, but worked when it was constructed with just a name. Jody |
From: Paul S. <pa...@to...> - 2005-08-04 09:12:45
|
Anyone estimated the memory requirements of the javax.units package? When instantiated Unit.getInstances() shows there are at least 760 unit objects in memory. Best regards, Paul. |
From: Martin D. <mar...@no...> - 2005-08-04 10:35:06
|
Paul Selormey a =E9crit : > Anyone estimated the memory requirements of the javax.units > package? Not as far as I know. But Unit object are small ones. I don't think that=20 760 of them is a big problem (for example plugin/epsg-wkt create=20 thousands of much bigger objects). However, the javax.units package will=20 be redone. If memory usage is an issue, maybe it will be adressed there. Martin. |
From: Paul S. <pa...@to...> - 2005-08-04 11:10:23
|
Thanks for the information. Having been proposed to the JCP, I thought such information/statistics exist somewhere. > Not as far as I know. But Unit object are small ones. I don't > think that 760 of them is a big problem (for example > plugin/epsg-wkt create thousands of much bigger objects). I do not know how the plugin/epsg-wkt works in GeoTools and never had the need to study it. I have, however, dealt with epsg database in GIS application, and never had to put thousands of big objects in memory. I only had to retrieve one or two CRS from the database, which itself is not in memory. > However, the javax.units package will be redone. If memory > usage is an issue, maybe it will be adressed there. Currently, I am trying to study the design to examine areas of improvements or redesign it. I have looked at the design in Jscience, since I could not find the new specification docs and it seems it might even be bigger due to its dependency on quantity objects. Best regards, Paul. |