org.geotools.data.Query.getCoordinateSystem()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中org.geotools.data.Query.getCoordinateSystem方法的一些代码示例,展示了Query.getCoordinateSystem的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getCoordinateSystem方法的具体详情如下:
包路径:org.geotools.data.Query
类名称:Query
方法名:getCoordinateSystem

Query.getCoordinateSystem介绍

[英]Get the coordinate system to use as an override for features retrieved by this Query.
[中]获取要用作此查询检索的要素替代的坐标系。

代码示例

代码示例来源:origin: geoserver/geoserver

  1. newQuery.setCoordinateSystemReproject(null);
  2. if (newQuery.getCoordinateSystem() != null) {
  3. newQuery.setCoordinateSystem(null);

代码示例来源:origin: geotools/geotools

  1. protected FeatureReader<SimpleFeatureType, SimpleFeature> applyReprojectionDecorator(
  2. FeatureReader<SimpleFeatureType, SimpleFeature> reader,
  3. Query query,
  4. GetFeatureRequest request) {
  5. FeatureReader<SimpleFeatureType, SimpleFeature> tmp = reader;
  6. if (query.getCoordinateSystem() != null
  7. && !query.getCoordinateSystem()
  8. .equals(reader.getFeatureType().getCoordinateReferenceSystem())) {
  9. if (request.getSrsName() != null) {
  10. try {
  11. reader =
  12. new ForceCoordinateSystemFeatureReader(
  13. reader, query.getCoordinateSystem());
  14. } catch (SchemaException e) {
  15. LOGGER.warning(e.toString());
  16. reader = tmp;
  17. }
  18. } else {
  19. try {
  20. reader = new ReprojectFeatureReader(reader, query.getCoordinateSystem());
  21. } catch (Exception e) {
  22. LOGGER.warning(e.toString());
  23. reader = tmp;
  24. }
  25. }
  26. }
  27. return reader;
  28. }

代码示例来源:origin: geoserver/geoserver

  1. result.setCoordinateSystem(userQuery.getCoordinateSystem());
  2. result.setCoordinateSystemReproject(userQuery.getCoordinateSystemReproject());
  3. result.setStartIndex(userQuery.getStartIndex());

代码示例来源:origin: geotools/geotools

  1. /**
  2. * @return the WFS advertised bounds of the feature type if {@code Filter.INCLUDE ==
  3. * query.getFilter()}, reprojected to the Query's crs, or {@code null} otherwise as it would
  4. * be too expensive to calculate.
  5. * @see FeatureSource#getBounds(Query)
  6. * @see org.geotools.data.store.ContentFeatureSource#getBoundsInternal(org.geotools.data.Query)
  7. */
  8. @Override
  9. protected ReferencedEnvelope getBoundsInternal(Query query) throws IOException {
  10. if (!Filter.INCLUDE.equals(query.getFilter())) {
  11. return null;
  12. }
  13. final QName remoteTypeName = getRemoteTypeName();
  14. final CoordinateReferenceSystem targetCrs;
  15. if (null == query.getCoordinateSystem()) {
  16. targetCrs = client.getDefaultCRS(remoteTypeName);
  17. } else {
  18. targetCrs = query.getCoordinateSystem();
  19. }
  20. ReferencedEnvelope bounds = client.getBounds(remoteTypeName, targetCrs);
  21. return bounds;
  22. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Configure expected
  3. *
  4. * @param origional
  5. * @param query
  6. * @return
  7. */
  8. public static SimpleFeatureType retype(SimpleFeatureType origional, Query query) {
  9. CoordinateReferenceSystem crs = null;
  10. if (query.getCoordinateSystem() != null) {
  11. crs = query.getCoordinateSystem();
  12. }
  13. if (query.getCoordinateSystemReproject() != null) {
  14. crs = query.getCoordinateSystemReproject();
  15. }
  16. return retype(origional, query.getPropertyNames(), crs);
  17. }

代码示例来源:origin: geotools/geotools

  1. protected String getSupportedSrsName(GetFeatureRequest request, Query query) {
  2. String epsgCode = GML2EncodingUtils.epsgCode(query.getCoordinateSystem());
  3. Set<String> supported =
  4. request.getStrategy().getSupportedCRSIdentifiers(request.getTypeName());
  5. for (String supportedSrs : supported) {
  6. if (supportedSrs.endsWith(":" + epsgCode)) {
  7. return supportedSrs;
  8. }
  9. }
  10. return null;
  11. }

代码示例来源:origin: geotools/geotools

  1. if (query.getCoordinateSystemReproject() != null) {
  2. cs = query.getCoordinateSystemReproject();
  3. } else if (query.getCoordinateSystem() != null) {
  4. cs = query.getCoordinateSystem();

代码示例来源:origin: geotools/geotools

  1. public SimpleFeatureType getQueryType(Query query) throws IOException {
  2. final String typeName = query.getTypeName();
  3. final String propertyNames[] = query.getPropertyNames();
  4. final FeatureTypeInfo typeInfo = typeInfoCache.getFeatureTypeInfo(typeName);
  5. final SimpleFeatureType completeSchema = typeInfo.getFeatureType();
  6. SimpleFeatureType featureType = completeSchema;
  7. if (!query.retrieveAllProperties() || query.getCoordinateSystem() != null) {
  8. try {
  9. featureType =
  10. DataUtilities.createSubType(
  11. featureType, propertyNames, query.getCoordinateSystem());
  12. } catch (SchemaException e) {
  13. LOGGER.log(Level.FINEST, e.getMessage(), e);
  14. throw new DataSourceException("Could not create Feature Type for query", e);
  15. }
  16. }
  17. return featureType;
  18. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Hashcode based on all parameters other than the handle.
  3. *
  4. * @return hascode for this Query
  5. */
  6. @Override
  7. public int hashCode() {
  8. String[] n = getPropertyNames();
  9. return ((n == null) ? (-1) : ((n.length == 0) ? 0 : (n.length | n[0].hashCode())))
  10. | getMaxFeatures()
  11. | ((getFilter() == null) ? 0 : getFilter().hashCode())
  12. | ((getTypeName() == null) ? 0 : getTypeName().hashCode())
  13. | ((getVersion() == null) ? 0 : getVersion().hashCode())
  14. | ((getCoordinateSystem() == null) ? 0 : getCoordinateSystem().hashCode())
  15. | ((getCoordinateSystemReproject() == null)
  16. ? 0
  17. : getCoordinateSystemReproject().hashCode())
  18. | getStartIndex();
  19. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Invert axis order in the given query filter, if needed.
  3. *
  4. * @param query
  5. */
  6. private void invertAxisInFilterIfNeeded(Query query, SimpleFeatureType featureType) {
  7. CoordinateReferenceSystem crs = query.getCoordinateSystem();
  8. if (crs == null) {
  9. crs = featureType.getCoordinateReferenceSystem();
  10. }
  11. boolean invertXY = WFSConfig.invertAxisNeeded(client.getAxisOrderFilter(), crs);
  12. if (invertXY) {
  13. invertAxisInFilter(query);
  14. }
  15. }

代码示例来源:origin: geotools/geotools

  1. if (query.getCoordinateSystemReproject() != null) {
  2. cs = query.getCoordinateSystemReproject();
  3. } else if (query.getCoordinateSystem() != null) {
  4. cs = query.getCoordinateSystem();
  5. if (query.getCoordinateSystem() != null) {
  6. originalCRS = query.getCoordinateSystem();

代码示例来源:origin: geotools/geotools

  1. if (query.getCoordinateSystemReproject() != null) {
  2. cs = query.getCoordinateSystemReproject();
  3. } else if (query.getCoordinateSystem() != null) {
  4. cs = query.getCoordinateSystem();

代码示例来源:origin: geotools/geotools

  1. ? (other.getVersion() == null)
  2. : getVersion().equals(other.getVersion()))
  3. && ((getCoordinateSystem() == null)
  4. ? (other.getCoordinateSystem() == null)
  5. : getCoordinateSystem().equals(other.getCoordinateSystem()))
  6. && ((getCoordinateSystemReproject() == null)
  7. ? (other.getCoordinateSystemReproject() == null)

代码示例来源:origin: geotools/geotools

  1. : getVersion().equals(other.getVersion()))
  2. && ((getCoordinateSystem() == null)
  3. ? (other.getCoordinateSystem() == null)
  4. : getCoordinateSystem().equals(other.getCoordinateSystem()))
  5. && ((getCoordinateSystemReproject() == null)
  6. ? (other.getCoordinateSystemReproject() == null)

代码示例来源:origin: geotools/geotools

  1. : getVersion().equals(other.getVersion()))
  2. && ((getCoordinateSystem() == null)
  3. ? (other.getCoordinateSystem() == null)
  4. : getCoordinateSystem().equals(other.getCoordinateSystem()))
  5. && ((getCoordinateSystemReproject() == null)
  6. ? (other.getCoordinateSystemReproject() == null)

代码示例来源:origin: geotools/geotools

  1. FeatureTypes.transform(
  2. this.featureType, query.getCoordinateSystemReproject());
  3. } else if (query.getCoordinateSystem() != null) {
  4. this.featureType =
  5. FeatureTypes.transform(this.featureType, query.getCoordinateSystem());

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Copy contructor.
  3. *
  4. * @param query the query to copy
  5. */
  6. public Query(Query query) {
  7. this(
  8. query.getTypeName(),
  9. query.getNamespace(),
  10. query.getFilter(),
  11. query.getMaxFeatures(),
  12. query.getProperties(),
  13. query.getHandle());
  14. this.sortBy = query.getSortBy();
  15. this.coordinateSystem = query.getCoordinateSystem();
  16. this.coordinateSystemReproject = query.getCoordinateSystemReproject();
  17. this.version = query.getVersion();
  18. this.hints = query.getHints();
  19. this.startIndex = query.getStartIndex();
  20. this.alias = query.getAlias();
  21. this.joins = new ArrayList();
  22. for (Join j : query.getJoins()) {
  23. this.joins.add(new Join(j));
  24. }
  25. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Copy contructor, clones the state of a generic Query into a DefaultQuery
  3. *
  4. * @param query
  5. */
  6. public DefaultQuery(Query query) {
  7. this(
  8. query.getTypeName(),
  9. query.getNamespace(),
  10. query.getFilter(),
  11. query.getMaxFeatures(),
  12. query.getProperties(),
  13. query.getHandle());
  14. this.sortBy = query.getSortBy();
  15. this.coordinateSystem = query.getCoordinateSystem();
  16. this.coordinateSystemReproject = query.getCoordinateSystemReproject();
  17. this.version = query.getVersion();
  18. this.hints = query.getHints();
  19. this.startIndex = query.getStartIndex();
  20. this.alias = query.getAlias();
  21. this.joins = query.getJoins();
  22. }
  23. }

代码示例来源:origin: geotools/geotools

  1. private Query namedQuery(Query query) {
  2. Query namedQuery =
  3. namedQuery(
  4. query.getFilter(), query.getMaxFeatures(), query instanceof JoiningQuery);
  5. namedQuery.setProperties(query.getProperties());
  6. namedQuery.setCoordinateSystem(query.getCoordinateSystem());
  7. namedQuery.setCoordinateSystemReproject(query.getCoordinateSystemReproject());
  8. namedQuery.setHandle(query.getHandle());
  9. namedQuery.setMaxFeatures(query.getMaxFeatures());
  10. namedQuery.setStartIndex(query.getStartIndex());
  11. namedQuery.setSortBy(query.getSortBy());
  12. namedQuery.setHints(query.getHints());
  13. if (query instanceof JoiningQuery) {
  14. ((JoiningQuery) namedQuery).setQueryJoins(((JoiningQuery) query).getQueryJoins());
  15. ((JoiningQuery) namedQuery).setRootMapping(((JoiningQuery) query).getRootMapping());
  16. }
  17. return namedQuery;
  18. }

代码示例来源:origin: geotools/geotools

  1. newQuery.setFilter(unrolledFilter);
  2. newQuery.setProperties(propNames);
  3. newQuery.setCoordinateSystem(query.getCoordinateSystem());
  4. newQuery.setCoordinateSystemReproject(query.getCoordinateSystemReproject());
  5. newQuery.setHandle(query.getHandle());

相关文章