Query for Geometry Index count within the Geometry Envelope

@param envelope
geometry envelope
@return count
186538
public long count(GeometryEnvelope envelope) {
		long count = 0;

		QueryBuilder<GeometryIndex, GeometryIndexKey> qb = queryBuilder(envelope);
		try {
			count = qb.countOf();
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to query for Geometry Index count. GeoPackage: "
							+ geoPackage.getName() + ", Table Name: "
							+ tableName + ", Column Name: " + columnName, e);
		}

		return count;
	}
1164926
public final int pageX() {
    if (getTouches() != null && getTouches().length() > 0) {
      return getTouches().get(0).getPageX();
    } else {
      return getClientX() + GQuery.document.getScrollLeft();
    }
  }
1331546
public static int nvgraphTriangleCount(
        nvgraphHandle handle, 
        nvgraphGraphDescr graph_descr, 
        long[] result)
    {
        return checkResult(nvgraphTriangleCountNative(handle, graph_descr, result));
    }
818074
@Override
	public long dynamicQueryCount(DynamicQuery dynamicQuery,
		Projection projection) {
		return commerceTierPriceEntryPersistence.countWithDynamicQuery(dynamicQuery,
			projection);
	}
1306952
public int countSubColumns(K key, SN superColumnName, N start,
      N end, int max) {
    SubCountQuery<K, SN, N> query = HFactory.createSubCountQuery(
        keyspace, keySerializer, topSerializer, subSerializer);
    query.setKey(key);
    query.setColumnFamily(columnFamily);
    query.setSuperColumn(superColumnName);
    query.setRange(start, end, max);
    return query.execute().get();
  }
472729
@Override
	public long dynamicQueryCount(DynamicQuery dynamicQuery,
		Projection projection) {
		return commerceOrderPersistence.countWithDynamicQuery(dynamicQuery,
			projection);
	}
887717
public static int getFirstGeometryFieldIndex(ResultSet resultSet) throws SQLException {
        ResultSetMetaData meta = resultSet.getMetaData();
        int columnCount = meta.getColumnCount();
        for (int i = 1; i <= columnCount; i++) {
            if (meta.getColumnTypeName(i).equalsIgnoreCase("geometry")) {
                return i;
            }
        }
        return -1;
    }
639557
@Override
	public long dynamicQueryCount(DynamicQuery dynamicQuery,
		Projection projection) {
		return commerceShippingMethodPersistence.countWithDynamicQuery(dynamicQuery,
			projection);
	}
1097392
public int getQueryCacheCount(String mapName) {
        Map<String, InternalQueryCache<K, V>> queryCacheRegistry = queryCacheRegistryPerMap.get(mapName);
        if (queryCacheRegistry == null) {
            return 0;
        }
        return queryCacheRegistry.size();
    }
567523
public int count()
        throws EFapsException
    {
        initialize(false);
        final Select select = this.selection.getInstSelects().get(Selection.BASEPATH);
        return select.getObjects(this).size();
    }
607209
public long count(BoundingBox boundingBox) {
		long count = 0;
		switch (getIndexedType()) {
		case GEOPACKAGE:
			count = featureTableIndex.count(boundingBox);
			break;
		case RTREE:
			count = rTreeIndexTableDao.count(boundingBox);
			break;
		default:
			count = manualFeatureQuery.count(boundingBox);
		}
		return count;
	}
1373370
public GeometryIndex populate(TableIndex tableIndex, long geomId,
			GeometryEnvelope envelope) {

		GeometryIndex geometryIndex = new GeometryIndex();
		geometryIndex.setTableIndex(tableIndex);
		geometryIndex.setGeomId(geomId);
		geometryIndex.setMinX(envelope.getMinX());
		geometryIndex.setMaxX(envelope.getMaxX());
		geometryIndex.setMinY(envelope.getMinY());
		geometryIndex.setMaxY(envelope.getMaxY());
		if (envelope.hasZ()) {
			geometryIndex.setMinZ(envelope.getMinZ());
			geometryIndex.setMaxZ(envelope.getMaxZ());
		}
		if (envelope.hasM()) {
			geometryIndex.setMinM(envelope.getMinM());
			geometryIndex.setMaxM(envelope.getMaxM());
		}
		return geometryIndex;
	}
1307177
private GeometryEnvelope readEnvelope(int envelopeIndicator,
			ByteReader reader) {

		GeometryEnvelope envelope = null;

		if (envelopeIndicator > 0) {

			// Read x and y values and create envelope
			double minX = reader.readDouble();
			double maxX = reader.readDouble();
			double minY = reader.readDouble();
			double maxY = reader.readDouble();

			boolean hasZ = false;
			Double minZ = null;
			Double maxZ = null;

			boolean hasM = false;
			Double minM = null;
			Double maxM = null;

			// Read z values
			if (envelopeIndicator == 2 || envelopeIndicator == 4) {
				hasZ = true;
				minZ = reader.readDouble();
				maxZ = reader.readDouble();
			}

			// Read m values
			if (envelopeIndicator == 3 || envelopeIndicator == 4) {
				hasM = true;
				minM = reader.readDouble();
				maxM = reader.readDouble();
			}

			envelope = new GeometryEnvelope(hasZ, hasM);

			envelope.setMinX(minX);
			envelope.setMaxX(maxX);
			envelope.setMinY(minY);
			envelope.setMaxY(maxY);

			if (hasZ) {
				envelope.setMinZ(minZ);
				envelope.setMaxZ(maxZ);
			}

			if (hasM) {
				envelope.setMinM(minM);
				envelope.setMaxM(maxM);
			}
		}

		return envelope;
	}
180516
public static List<LasLevel> getLasLevels( ASpatialDb db, int levelNum, Envelope envelope ) throws Exception {
        String tableName = TABLENAME + levelNum;
        List<LasLevel> lasLevels = new ArrayList<>();
        String sql = "SELECT " + COLUMN_GEOM + "," + //
                COLUMN_ID + "," + COLUMN_SOURCE_ID + "," + COLUMN_AVG_ELEV + "," + //
                COLUMN_MIN_ELEV + "," + //
                COLUMN_MAX_ELEV + "," + //
                COLUMN_AVG_INTENSITY + "," + //
                COLUMN_MIN_INTENSITY + "," + //
                COLUMN_MAX_INTENSITY;

        sql += " FROM " + tableName;

        if (envelope != null) {
            double x1 = envelope.getMinX();
            double y1 = envelope.getMinY();
            double x2 = envelope.getMaxX();
            double y2 = envelope.getMaxY();
            sql += " WHERE " + db.getSpatialindexBBoxWherePiece(tableName, null, x1, y1, x2, y2);
        }

        String _sql = sql;
        IGeometryParser gp = db.getType().getGeometryParser();
        return db.execOnConnection(conn -> {
            try (IHMStatement stmt = conn.createStatement(); IHMResultSet rs = stmt.executeQuery(_sql)) {
                while( rs.next() ) {
                    LasLevel lasLevel = new LasLevel();
                    lasLevel.level = levelNum;
                    int i = 1;
                    Geometry geometry = gp.fromResultSet(rs, i++);
                    if (geometry instanceof Polygon) {
                        Polygon polygon = (Polygon) geometry;
                        lasLevel.polygon = polygon;
                        lasLevel.id = rs.getLong(i++);
                        lasLevel.sourceId = rs.getLong(i++);
                        lasLevel.avgElev = rs.getDouble(i++);
                        lasLevel.minElev = rs.getDouble(i++);
                        lasLevel.maxElev = rs.getDouble(i++);
                        lasLevel.avgIntensity = rs.getShort(i++);
                        lasLevel.minIntensity = rs.getShort(i++);
                        lasLevel.maxIntensity = rs.getShort(i++);
                        lasLevels.add(lasLevel);
                    }
                }
                return lasLevels;
            }
        });

    }
571102
@Pure
	public int indexOf(RoadSegment segment) {
		int count = 0;
		int index;
		for (final RoadPath p : this.paths) {
			index = p.indexOf(segment);
			if (index >= 0) {
				return count + index;
			}
			count += p.size();
		}
		return -1;
	}
486318
public int index(boolean force) {
		int count = 0;
		if (force || !isIndexed()) {
			getOrCreateExtension();
			TableIndex tableIndex = getOrCreateTableIndex();
			createOrClearGeometryIndices();
			geoPackage.unindexGeometryIndexTable();
			count = indexTable(tableIndex);
			geoPackage.indexGeometryIndexTable();
		}
		return count;
	}
1080163
public int count() {
        int n = 0;
        for (ConcurrentMap<?, ?> bag : registry.values()) {
            n += bag.size();
        }
        return n;
    }