On 8/24/2020 1:23 PM, Michaud Michael wrote:
> Just to precise what I fixed wrt. to what Ede is suggesting :
>
> I could not read spatialite files from QGis because GeometryColumn.isIndexed()
> returned null for some GeometryColumnsLayouts.
>
> I fixed it for OGC_OGR_LAYOUT (used by QGIS when exporting as spatialite), and
> for other unknown layouts (e.g. FDO_LAYOUT), I just stated that isIndexed =
> false to avoid NPE
>
> (i don't know how to get isIndexed information in this later case).
>
> Ede's point seems to be about GeometryColumn itself returning null. Looking at
> the code, I can't guarantee it is never null, but I don't know if it is 
> possible
> to produce a NPE with a normal utilisation of OpenJUMP.

the code suggests it. gc being NULL and accessing gc.isIndexed() will raise an 
NPE

https://sourceforge.net/p/jump-pilot/code/6383/tree/core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java#l157
is as follows

155 // test if geometry column is indexed, if so, builds special query 
according to type:
156 GeometryColumn gc = dsm.getGeometryColumn(query.getDatasetName(), 
query.getGeometryAttributeName());
157 // 2020-02-12: if info is not set, retrieve column index status here
158 if (gc.isIndexed() == null) {
159   dsm.setIndexInfo(datasetName, gc);
160 }

and the stack says
> java.lang.NullPointerException
> at
> com.vividsolutions.jump.datastore.spatialite.SpatialiteSQLBuilder.buildSpatialIndexFilter(SpatialiteSQLBuilder.java:157)

it can't be the comment in line 157, so it must be the following line must be 
gc being NULL in the gc.isIndexed() call. no other way this code might raise a 
NPE ;) seems obvious to me, but feel free to correct me.. cloudy at 21° ede






_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to