This problem has been reported before, and I was unable to reproduce. I am not sure if a bug was opened in the issue tracker.
There are a number of strategies for selecting content in response to a mouse click. When selecting a polygon we could do a quick point in polygon test, when selecting a point or line we should probably consider the bounding box represented by the pixel. As part of selecting content we need to constructor a filter - that queries against the correct geometry. Could you use a debugger, or print using System out, the filter that is being generated? The shapefile code is going to scan through this filter to try and figure out what bounds are being queried (and make use of its spatial index) before doing the much slower geometry check. This shapefile code is failing with a null pointer exception and we will need to look at the filter to see what it is working against in order to create a good bug report. -- Jody Garnett On 22 August 2015 at 11:49, Augustin Doury <augustindo...@gmail.com> wrote: > Hi all, > > Working on the SelectionLab tutorial [1], I have an exception similar > to this post (2014) [2] : I get a null pointer exception when I use > the 'select tool' to click on a feature. Specifically, the exception > is raised on the call to selectedFeatures.features(), in the method > "void selectFeatures(MapMouseEvent ev)". > > The messages [2] don't really give a solution to this specific > problem. I'm novice to Geotools so maybe I missed something. > > I just would like the user able to choose a line A and a line B in a > line shapefile by clicking on it. I searched for hours, hope somebody > could help (again) ! > > Augustin > > [1] > http://docs.geotools.org/latest/userguide/tutorial/map/style.html#selection > [2] http://sourceforge.net/p/geotools/mailman/message/32035075/ > > > ------------------------------------------------------------------------------ > _______________________________________________ > GeoTools-GT2-Users mailing list > GeoTools-GT2-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >
------------------------------------------------------------------------------
_______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users