Filters on gridded patrol queries don't exclude patrol types
With a grid query coverage maps filtered to show just one patrol type still include other patrols, but with zero (rather than null) values). This is counter-intuitive. Th situtaitojn with patrol coverage is different from calculating grids of encounter rats (where you want to see zero values for cells that were entered, but nothing observed). For patrols you want to be able to see coverage for just a single patrol type (or transport type, mandate, etc) without the zero values being shown for other patrol types.
Leave a comment
Sure, we went around in circles a few times with this (I think with Emma mainly) and settled on this option which shows 0s where any patrol went, even if the data is filtered out to 0 and nulls where patrols never went at all.
I believe we also talked about having another filter or query type that will do as you are saying above, but we thought that would be very confusing to the user. Much like our "distance" vs "total distance" encounter rate options give you more flexibility but add complexity for the user.
So, it's up to the partnership or UC etc to determine if this is wanted and how we should implement it to be most easily understood by users.
I believe we also talked about having another filter or query type that will do as you are saying above, but we thought that would be very confusing to the user. Much like our "distance" vs "total distance" encounter rate options give you more flexibility but add complexity for the user.
So, it's up to the partnership or UC etc to determine if this is wanted and how we should implement it to be most easily understood by users.
In 6.0.a5, this error came up when creating a patrol grid query.
patrolGridQuery.txt
Image not found...
patrolGridQuery.txt
Image not found...
Using 6.0.a6, I created a patrol grid query (see attached) to test the ticket and encountered an error. The error did not occur when "Change Rate" wasn't used.
Query Definition
1676_000022.xml
Image not found...
java.lang.IllegalStateException: Invalid value for counting patrols.
!STACK 0
org.hibernate.exception.GenericJDBCException: error executing work
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:319)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2340)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2325)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.executeQuery(DerbyGridEngine.java:144)
at org.wcs.smart.query.common.engine.QueryExecutor.executeQuery(QueryExecutor.java:61)
at org.wcs.smart.query.common.ui.GriddedEditor$3.run(GriddedEditor.java:179)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.sql.SQLException: java.lang.IllegalStateException: Invalid value for counting patrols.
at org.wcs.smart.patrol.query.engine.DerbyGridEngine$1.execute(DerbyGridEngine.java:241)
at org.hibernate.jdbc.WorkExecutor.executeWork(WorkExecutor.java:37)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2321)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2318)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:314)
... 6 more
Caused by: java.lang.IllegalStateException: Invalid value for counting patrols.
at org.wcs.smart.patrol.query.engine.grids.PatrolCntValueComputer.computeValue(PatrolCntValueComputer.java:62)
at org.wcs.smart.patrol.query.engine.grids.PatrolCntValueComputer.computeValue(PatrolCntValueComputer.java:1)
at org.wcs.smart.query.common.engine.GriddedLineIntersector.computeIntersect(GriddedLineIntersector.java:114)
at com.vividsolutions.jts.algorithm.LineIntersector.computeIntersection(LineIntersector.java:248)
at com.vividsolutions.jts.geomgraph.index.SegmentIntersector.addIntersections(SegmentIntersector.java:163)
at com.vividsolutions.jts.geomgraph.index.MonotoneChainEdge.computeIntersectsForChain(MonotoneChainEdge.java:131)
at com.vividsolutions.jts.geomgraph.index.MonotoneChainEdge.computeIntersectsForChain(MonotoneChainEdge.java:151)
at com.vividsolutions.jts.geomgraph.index.MonotoneChainEdge.computeIntersectsForChain(MonotoneChainEdge.java:112)
at com.vividsolutions.jts.geomgraph.index.MonotoneChain.computeIntersections(MonotoneChain.java:53)
at com.vividsolutions.jts.geomgraph.index.SimpleMCSweepLineIntersector.processOverlaps(SimpleMCSweepLineIntersector.java:159)
at com.vividsolutions.jts.geomgraph.index.SimpleMCSweepLineIntersector.computeIntersections(SimpleMCSweepLineIntersector.java:139)
at com.vividsolutions.jts.geomgraph.index.SimpleMCSweepLineIntersector.computeIntersections(SimpleMCSweepLineIntersector.java:82)
at org.wcs.smart.query.common.engine.GridAnalysisEngine.rasterizeLinestring(GridAnalysisEngine.java:183)
at org.wcs.smart.query.common.engine.GridAnalysisEngine.rasterizeLinestring(GridAnalysisEngine.java:113)
at org.wcs.smart.query.common.engine.GridAnalysisEngine.rasterizeTrack(GridAnalysisEngine.java:108)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.computePatrolTrack(DerbyGridEngine.java:670)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.computePatrolValue(DerbyGridEngine.java:615)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.getGridResults(DerbyGridEngine.java:318)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.getItems(DerbyGridEngine.java:297)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.access$3(DerbyGridEngine.java:260)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine$1.execute(DerbyGridEngine.java:185)
... 10 more
Query Definition
1676_000022.xml
Image not found...
java.lang.IllegalStateException: Invalid value for counting patrols.
!STACK 0
org.hibernate.exception.GenericJDBCException: error executing work
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:319)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2340)
at org.hibernate.internal.SessionImpl.doWork(SessionImpl.java:2325)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.executeQuery(DerbyGridEngine.java:144)
at org.wcs.smart.query.common.engine.QueryExecutor.executeQuery(QueryExecutor.java:61)
at org.wcs.smart.query.common.ui.GriddedEditor$3.run(GriddedEditor.java:179)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.sql.SQLException: java.lang.IllegalStateException: Invalid value for counting patrols.
at org.wcs.smart.patrol.query.engine.DerbyGridEngine$1.execute(DerbyGridEngine.java:241)
at org.hibernate.jdbc.WorkExecutor.executeWork(WorkExecutor.java:37)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2321)
at org.hibernate.internal.SessionImpl$1.accept(SessionImpl.java:2318)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.coordinateWork(JdbcCoordinatorImpl.java:314)
... 6 more
Caused by: java.lang.IllegalStateException: Invalid value for counting patrols.
at org.wcs.smart.patrol.query.engine.grids.PatrolCntValueComputer.computeValue(PatrolCntValueComputer.java:62)
at org.wcs.smart.patrol.query.engine.grids.PatrolCntValueComputer.computeValue(PatrolCntValueComputer.java:1)
at org.wcs.smart.query.common.engine.GriddedLineIntersector.computeIntersect(GriddedLineIntersector.java:114)
at com.vividsolutions.jts.algorithm.LineIntersector.computeIntersection(LineIntersector.java:248)
at com.vividsolutions.jts.geomgraph.index.SegmentIntersector.addIntersections(SegmentIntersector.java:163)
at com.vividsolutions.jts.geomgraph.index.MonotoneChainEdge.computeIntersectsForChain(MonotoneChainEdge.java:131)
at com.vividsolutions.jts.geomgraph.index.MonotoneChainEdge.computeIntersectsForChain(MonotoneChainEdge.java:151)
at com.vividsolutions.jts.geomgraph.index.MonotoneChainEdge.computeIntersectsForChain(MonotoneChainEdge.java:112)
at com.vividsolutions.jts.geomgraph.index.MonotoneChain.computeIntersections(MonotoneChain.java:53)
at com.vividsolutions.jts.geomgraph.index.SimpleMCSweepLineIntersector.processOverlaps(SimpleMCSweepLineIntersector.java:159)
at com.vividsolutions.jts.geomgraph.index.SimpleMCSweepLineIntersector.computeIntersections(SimpleMCSweepLineIntersector.java:139)
at com.vividsolutions.jts.geomgraph.index.SimpleMCSweepLineIntersector.computeIntersections(SimpleMCSweepLineIntersector.java:82)
at org.wcs.smart.query.common.engine.GridAnalysisEngine.rasterizeLinestring(GridAnalysisEngine.java:183)
at org.wcs.smart.query.common.engine.GridAnalysisEngine.rasterizeLinestring(GridAnalysisEngine.java:113)
at org.wcs.smart.query.common.engine.GridAnalysisEngine.rasterizeTrack(GridAnalysisEngine.java:108)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.computePatrolTrack(DerbyGridEngine.java:670)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.computePatrolValue(DerbyGridEngine.java:615)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.getGridResults(DerbyGridEngine.java:318)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.getItems(DerbyGridEngine.java:297)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine.access$3(DerbyGridEngine.java:260)
at org.wcs.smart.patrol.query.engine.DerbyGridEngine$1.execute(DerbyGridEngine.java:185)
... 10 more