/** * Returns the nth geometry of a geometry collection, or the geometry if the input is not a * collection. * * @param node xml element containing gml object(s) * @param number integer number as the index of nth geometry * @return geometry as a gml element * @throws QueryException query exception */ @Deterministic public ANode geometryN(final ANode node, final Int number) throws QueryException { final Geometry geo = checkGeo(node); final long n = number.itr(); if (n < 1 || n > geo.getNumGeometries()) throw GeoErrors.outOfRangeIdx(number); return gmlWriter(geo.getGeometryN((int) n - 1)); }