@Override protected ExplicitSpatialTemporalQuery newConstraints() { return new ExplicitSpatialTemporalQuery(); }
public ExplicitSpatialTemporalQuery( final TemporalConstraints constraints, final Geometry queryGeometry, final String crsCode) { super(createSpatialTemporalConstraints(constraints, queryGeometry), queryGeometry, crsCode); }
/** * Supports multi-polygons and multiple temporal bounds. Creates all matchings between polygon and * temporal bounds. * * @param startTime * @param endTime * @param queryGeometry * @return */ private static Constraints createSpatialTemporalConstraints( final Interval[] intervals, final Geometry queryGeometry) { final Constraints geoConstraints = GeometryUtils.basicConstraintsFromGeometry(queryGeometry); final Constraints timeConstraints = createConstraints(intervals, false); return geoConstraints.merge(timeConstraints); }
/** * Supports multi-polygons and multiple temporal bounds. Creates all matchings between polygon and * temporal bounds. * * @param startTime * @param endTime * @param queryGeometry * @return */ private static Constraints createSpatialTemporalConstraints( final TemporalConstraints temporalConstraints, final Geometry queryGeometry) { final Constraints geoConstraints = GeometryUtils.basicConstraintsFromGeometry(queryGeometry); final Constraints timeConstraints = createConstraints(temporalConstraints, false); return geoConstraints.merge(timeConstraints); }
/** * Compose a time constraints. When the provided constraints do not fulfill the indexed * dimensions, compose constraints from statistics. * * @param featureType * @param timeDescriptors * @param statsMap * @param timeBoundsSet * @return */ public static Constraints composeTimeConstraints( final SimpleFeatureType featureType, final TimeDescriptors timeDescriptors, final Map<StatisticsId, InternalDataStatistics<SimpleFeature, ?, ?>> statsMap, final TemporalConstraintsSet timeBoundsSet) { final TemporalConstraints timeBounds = TimeUtils.getTemporalConstraintsForDescriptors(timeDescriptors, timeBoundsSet); return (timeBounds != null) && !timeBounds.isEmpty() ? ExplicitSpatialTemporalQuery.createConstraints(timeBounds, false) : new Constraints(getTimeConstraintsFromIndex(timeDescriptors, statsMap)); }
@Override public QueryConstraints build() { if ((crsCode != null) && (geometry == null)) { LOGGER.warn( "CRS code `" + crsCode + "` cannot be applied without a geometry. Ignoring CRS."); } if ((spatialCompareOp != null) && (geometry == null)) { LOGGER.warn( "Spatial compare operator `" + spatialCompareOp.name() + "` cannot be applied without a geometry. Ignoring compare operator."); } if (geometry != null) { // its at least spatial if (timeRanges.length > 0) { // its spatial-temporal return new SpatialTemporalQuery( new ExplicitSpatialTemporalQuery(timeRanges, geometry, crsCode, spatialCompareOp)); } return new SpatialQuery(new ExplicitSpatialQuery(geometry, crsCode, spatialCompareOp)); } else if (timeRanges.length > 0) { // its temporal only return new TemporalQuery(new ExplicitTemporalQuery(timeRanges)); } return new EverythingQuery(); } }
public ExplicitSpatialTemporalQuery( final Date startTime, final Date endTime, final Geometry queryGeometry) { super(createSpatialTemporalConstraints(startTime, endTime, queryGeometry), queryGeometry); }
return ExplicitSpatialTemporalQuery.createConstraints( startRange.asTemporalRange().union(endRange.asTemporalRange()), true); } else if (endRange != null) { return ExplicitSpatialTemporalQuery.createConstraints(endRange.asTemporalRange(), true); } else if (startRange != null) { return ExplicitSpatialTemporalQuery.createConstraints(startRange.asTemporalRange(), true); timeDescriptors.getTime().getLocalName()).build().getId())); if (timeStat != null) { return ExplicitSpatialTemporalQuery.createConstraints(timeStat.asTemporalRange(), true);
new ExplicitSpatialTemporalQuery(startDate, endDate, filterGeometry, crsCode));
public ExplicitSpatialTemporalQuery( final Date startTime, final Date endTime, final Geometry queryGeometry, final String crsCode) { super( createSpatialTemporalConstraints(startTime, endTime, queryGeometry), queryGeometry, crsCode); }
/** * If composed constraints matched statistics constraints, are empty or null, then return empty * constraint set. * * @param featureType * @param timeDescriptors * @param statsMap * @param timeBoundsSet * @return */ public static Constraints composeTimeBoundedConstraints( final SimpleFeatureType featureType, final TimeDescriptors timeDescriptors, final Map<StatisticsId, InternalDataStatistics<SimpleFeature, ?, ?>> statsMap, final TemporalConstraintsSet timeBoundsSet) { if ((timeBoundsSet == null) || timeBoundsSet.isEmpty() || !timeDescriptors.hasTime()) { return new Constraints(); } final TemporalConstraints boundsTemporalConstraints = TimeUtils.getTemporalConstraintsForDescriptors(timeDescriptors, timeBoundsSet); if (boundsTemporalConstraints.isEmpty()) { return new Constraints(); } final Constraints indexTimeConstraints = new Constraints(QueryIndexHelper.getTimeConstraintsFromIndex(timeDescriptors, statsMap)); final Constraints boundsTimeConstraints = ExplicitSpatialTemporalQuery.createConstraints(boundsTemporalConstraints, false); return (boundsTimeConstraints.matches(indexTimeConstraints)) ? new Constraints() : boundsTimeConstraints; }
/** * Applies the set of temporal constraints to the boundaries of the provided polygon. If a * multi-polygon is provided, then all matching combinations between temporal ranges and polygons * are explored. * * @param constraints * @param queryGeometry * @param compareOp */ public ExplicitSpatialTemporalQuery( final TemporalConstraints constraints, final Geometry queryGeometry, final CompareOperation compareOp) { super(createSpatialTemporalConstraints(constraints, queryGeometry), queryGeometry, compareOp); }
ExplicitSpatialTemporalQuery.createConstraints(temporalConstraints, false); constraints = geoConstraints.getConstraints().merge(timeConstraints);
public ExplicitSpatialTemporalQuery( final Interval[] intervals, final Geometry queryGeometry, final String crsCode, final CompareOperation compareOp) { super( createSpatialTemporalConstraints(intervals, queryGeometry), queryGeometry, crsCode, compareOp, // it seems like temporal should always use intersection and not // inherit from the spatial compare op BasicQueryCompareOperation.INTERSECTS); }
/** * If more then on polygon is supplied in the geometry, then the range of time is partnered with * each polygon constraint. Note: By default we are using same compareOp for 1D Time filtering as * the compareOp of the Spatial query by calling getBaseCompareOp() * * @param startTime * @param endTime * @param queryGeometry * @param compareOp */ public ExplicitSpatialTemporalQuery( final Date startTime, final Date endTime, final Geometry queryGeometry, final CompareOperation compareOp) { super( createSpatialTemporalConstraints(startTime, endTime, queryGeometry), queryGeometry, compareOp, compareOp.getBaseCompareOp()); }