newQuery.setCoordinateSystemReproject(null); if (newQuery.getCoordinateSystem() != null) { newQuery.setCoordinateSystem(null);
protected FeatureReader<SimpleFeatureType, SimpleFeature> applyReprojectionDecorator( FeatureReader<SimpleFeatureType, SimpleFeature> reader, Query query, GetFeatureRequest request) { FeatureReader<SimpleFeatureType, SimpleFeature> tmp = reader; if (query.getCoordinateSystem() != null && !query.getCoordinateSystem() .equals(reader.getFeatureType().getCoordinateReferenceSystem())) { if (request.getSrsName() != null) { try { reader = new ForceCoordinateSystemFeatureReader( reader, query.getCoordinateSystem()); } catch (SchemaException e) { LOGGER.warning(e.toString()); reader = tmp; } } else { try { reader = new ReprojectFeatureReader(reader, query.getCoordinateSystem()); } catch (Exception e) { LOGGER.warning(e.toString()); reader = tmp; } } } return reader; }
result.setCoordinateSystem(userQuery.getCoordinateSystem()); result.setCoordinateSystemReproject(userQuery.getCoordinateSystemReproject()); result.setStartIndex(userQuery.getStartIndex());
/** * @return the WFS advertised bounds of the feature type if {@code Filter.INCLUDE == * query.getFilter()}, reprojected to the Query's crs, or {@code null} otherwise as it would * be too expensive to calculate. * @see FeatureSource#getBounds(Query) * @see org.geotools.data.store.ContentFeatureSource#getBoundsInternal(org.geotools.data.Query) */ @Override protected ReferencedEnvelope getBoundsInternal(Query query) throws IOException { if (!Filter.INCLUDE.equals(query.getFilter())) { return null; } final QName remoteTypeName = getRemoteTypeName(); final CoordinateReferenceSystem targetCrs; if (null == query.getCoordinateSystem()) { targetCrs = client.getDefaultCRS(remoteTypeName); } else { targetCrs = query.getCoordinateSystem(); } ReferencedEnvelope bounds = client.getBounds(remoteTypeName, targetCrs); return bounds; }
/** * Configure expected * * @param origional * @param query * @return */ public static SimpleFeatureType retype(SimpleFeatureType origional, Query query) { CoordinateReferenceSystem crs = null; if (query.getCoordinateSystem() != null) { crs = query.getCoordinateSystem(); } if (query.getCoordinateSystemReproject() != null) { crs = query.getCoordinateSystemReproject(); } return retype(origional, query.getPropertyNames(), crs); }
protected String getSupportedSrsName(GetFeatureRequest request, Query query) { String epsgCode = GML2EncodingUtils.epsgCode(query.getCoordinateSystem()); Set<String> supported = request.getStrategy().getSupportedCRSIdentifiers(request.getTypeName()); for (String supportedSrs : supported) { if (supportedSrs.endsWith(":" + epsgCode)) { return supportedSrs; } } return null; }
if (query.getCoordinateSystemReproject() != null) { cs = query.getCoordinateSystemReproject(); } else if (query.getCoordinateSystem() != null) { cs = query.getCoordinateSystem();
public SimpleFeatureType getQueryType(Query query) throws IOException { final String typeName = query.getTypeName(); final String propertyNames[] = query.getPropertyNames(); final FeatureTypeInfo typeInfo = typeInfoCache.getFeatureTypeInfo(typeName); final SimpleFeatureType completeSchema = typeInfo.getFeatureType(); SimpleFeatureType featureType = completeSchema; if (!query.retrieveAllProperties() || query.getCoordinateSystem() != null) { try { featureType = DataUtilities.createSubType( featureType, propertyNames, query.getCoordinateSystem()); } catch (SchemaException e) { LOGGER.log(Level.FINEST, e.getMessage(), e); throw new DataSourceException("Could not create Feature Type for query", e); } } return featureType; }
/** * Hashcode based on all parameters other than the handle. * * @return hascode for this Query */ @Override public int hashCode() { String[] n = getPropertyNames(); return ((n == null) ? (-1) : ((n.length == 0) ? 0 : (n.length | n[0].hashCode()))) | getMaxFeatures() | ((getFilter() == null) ? 0 : getFilter().hashCode()) | ((getTypeName() == null) ? 0 : getTypeName().hashCode()) | ((getVersion() == null) ? 0 : getVersion().hashCode()) | ((getCoordinateSystem() == null) ? 0 : getCoordinateSystem().hashCode()) | ((getCoordinateSystemReproject() == null) ? 0 : getCoordinateSystemReproject().hashCode()) | getStartIndex(); }
/** * Invert axis order in the given query filter, if needed. * * @param query */ private void invertAxisInFilterIfNeeded(Query query, SimpleFeatureType featureType) { CoordinateReferenceSystem crs = query.getCoordinateSystem(); if (crs == null) { crs = featureType.getCoordinateReferenceSystem(); } boolean invertXY = WFSConfig.invertAxisNeeded(client.getAxisOrderFilter(), crs); if (invertXY) { invertAxisInFilter(query); } }
if (query.getCoordinateSystemReproject() != null) { cs = query.getCoordinateSystemReproject(); } else if (query.getCoordinateSystem() != null) { cs = query.getCoordinateSystem(); if (query.getCoordinateSystem() != null) { originalCRS = query.getCoordinateSystem();
if (query.getCoordinateSystemReproject() != null) { cs = query.getCoordinateSystemReproject(); } else if (query.getCoordinateSystem() != null) { cs = query.getCoordinateSystem();
? (other.getVersion() == null) : getVersion().equals(other.getVersion())) && ((getCoordinateSystem() == null) ? (other.getCoordinateSystem() == null) : getCoordinateSystem().equals(other.getCoordinateSystem())) && ((getCoordinateSystemReproject() == null) ? (other.getCoordinateSystemReproject() == null)
: getVersion().equals(other.getVersion())) && ((getCoordinateSystem() == null) ? (other.getCoordinateSystem() == null) : getCoordinateSystem().equals(other.getCoordinateSystem())) && ((getCoordinateSystemReproject() == null) ? (other.getCoordinateSystemReproject() == null)
: getVersion().equals(other.getVersion())) && ((getCoordinateSystem() == null) ? (other.getCoordinateSystem() == null) : getCoordinateSystem().equals(other.getCoordinateSystem())) && ((getCoordinateSystemReproject() == null) ? (other.getCoordinateSystemReproject() == null)
FeatureTypes.transform( this.featureType, query.getCoordinateSystemReproject()); } else if (query.getCoordinateSystem() != null) { this.featureType = FeatureTypes.transform(this.featureType, query.getCoordinateSystem());
/** * Copy contructor. * * @param query the query to copy */ public Query(Query query) { this( query.getTypeName(), query.getNamespace(), query.getFilter(), query.getMaxFeatures(), query.getProperties(), query.getHandle()); this.sortBy = query.getSortBy(); this.coordinateSystem = query.getCoordinateSystem(); this.coordinateSystemReproject = query.getCoordinateSystemReproject(); this.version = query.getVersion(); this.hints = query.getHints(); this.startIndex = query.getStartIndex(); this.alias = query.getAlias(); this.joins = new ArrayList(); for (Join j : query.getJoins()) { this.joins.add(new Join(j)); } }
/** * Copy contructor, clones the state of a generic Query into a DefaultQuery * * @param query */ public DefaultQuery(Query query) { this( query.getTypeName(), query.getNamespace(), query.getFilter(), query.getMaxFeatures(), query.getProperties(), query.getHandle()); this.sortBy = query.getSortBy(); this.coordinateSystem = query.getCoordinateSystem(); this.coordinateSystemReproject = query.getCoordinateSystemReproject(); this.version = query.getVersion(); this.hints = query.getHints(); this.startIndex = query.getStartIndex(); this.alias = query.getAlias(); this.joins = query.getJoins(); } }
private Query namedQuery(Query query) { Query namedQuery = namedQuery( query.getFilter(), query.getMaxFeatures(), query instanceof JoiningQuery); namedQuery.setProperties(query.getProperties()); namedQuery.setCoordinateSystem(query.getCoordinateSystem()); namedQuery.setCoordinateSystemReproject(query.getCoordinateSystemReproject()); namedQuery.setHandle(query.getHandle()); namedQuery.setMaxFeatures(query.getMaxFeatures()); namedQuery.setStartIndex(query.getStartIndex()); namedQuery.setSortBy(query.getSortBy()); namedQuery.setHints(query.getHints()); if (query instanceof JoiningQuery) { ((JoiningQuery) namedQuery).setQueryJoins(((JoiningQuery) query).getQueryJoins()); ((JoiningQuery) namedQuery).setRootMapping(((JoiningQuery) query).getRootMapping()); } return namedQuery; }
newQuery.setFilter(unrolledFilter); newQuery.setProperties(propNames); newQuery.setCoordinateSystem(query.getCoordinateSystem()); newQuery.setCoordinateSystemReproject(query.getCoordinateSystemReproject()); newQuery.setHandle(query.getHandle());