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

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

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

Query.setCoordinateSystemReproject介绍

[英]Request that features retrieved by this Query be reprojected into the given coordinate system.

If used in conjunction with #setCoordinateSystem(CoordinateReferenceSystem) the reprojection will occur from the overridden coordinate system to the system specified here.
[中]请求将此查询检索到的特征重新投影到给定的坐标系中。
如果与#setCoordinateSystem(CoordinateReferenceSystem)一起使用,将从替代坐标系重新投影到此处指定的坐标系。

代码示例

代码示例来源:origin: opentripplanner/OpenTripPlanner

query.setCoordinateSystemReproject(WGS84);
SimpleFeatureCollection featureCollection = featureSource.getFeatures(query);

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

newQuery.setCoordinateSystemReproject(null);

代码示例来源:origin: opentripplanner/OpenTripPlanner

query.setCoordinateSystemReproject(WGS84);
SimpleFeatureCollection featureCollection = featureSource.getFeatures(query);

代码示例来源:origin: opentripplanner/OpenTripPlanner

query.setCoordinateSystemReproject(worldCRS);

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

result.setCoordinateSystemReproject(userQuery.getCoordinateSystemReproject());
result.setStartIndex(userQuery.getStartIndex());
result.setSortBy(userQuery.getSortBy());

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

this.mappedSource.getSchema().getCoordinateReferenceSystem(),
      this.reprojection)) {
query.setCoordinateSystemReproject(reprojection);

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

public void testReprojectFeaturesCrsFromQuery() throws Exception {
  Query query = new Query(Query.ALL);
  CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
  CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3005");
  query.setCoordinateSystemReproject(targetCRS);
  SimpleFeatureSource river = data.getFeatureSource("river");
  SimpleFeatureCollection features = river.getFeatures(query);
  SimpleFeatureCollection expectedFeatures = DataUtilities.collection(riverFeatures);
  testTransformedFeatures(expectedFeatures, features, sourceCRS, null, targetCRS);
}

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

public void testReprojectEnvelopeCrsFromQuery() throws Exception {
  Query query = new Query(Query.ALL);
  CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
  CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3005");
  query.setCoordinateSystemReproject(targetCRS);
  ReferencedEnvelope envelope = data.getFeatureSource("river").getBounds(query);
  assertEquals(targetCRS, envelope.getCoordinateReferenceSystem());
  assertEquals(
      new ReferencedEnvelope(riverBounds, sourceCRS).transform(targetCRS, true),
      envelope);
}

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

public void testSetReprojectFeaturesCrsFromQuery() throws Exception {
  Query query = new Query(Query.ALL);
  query.setCoordinateSystem(DefaultEngineeringCRS.GENERIC_2D);
  query.setCoordinateSystemReproject(DefaultEngineeringCRS.CARTESIAN_2D);
  CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
  SimpleFeatureSource river = data.getFeatureSource("river");
  SimpleFeatureCollection features = river.getFeatures(query);
  SimpleFeatureCollection expectedFeatures = DataUtilities.collection(riverFeatures);
  testTransformedFeatures(
      expectedFeatures,
      features,
      sourceCRS,
      DefaultEngineeringCRS.GENERIC_2D,
      DefaultEngineeringCRS.CARTESIAN_2D);
}

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

public void testSetReprojectEnvelopeCrsFromQuery() throws Exception {
  Query query = new Query(Query.ALL);
  query.setCoordinateSystem(DefaultEngineeringCRS.GENERIC_2D);
  query.setCoordinateSystemReproject(DefaultEngineeringCRS.CARTESIAN_2D);
  ReferencedEnvelope envelope = data.getFeatureSource("river").getBounds(query);
  assertEquals(DefaultEngineeringCRS.CARTESIAN_2D, envelope.getCoordinateReferenceSystem());
  assertEquals(
      new ReferencedEnvelope(riverBounds, DefaultEngineeringCRS.GENERIC_2D)
          .transform(DefaultEngineeringCRS.CARTESIAN_2D, true),
      envelope);
}

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

this.reprojection)) {
query.setCoordinateSystemReproject(null);

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

query.setCoordinateSystemReproject(reprojection);

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

newQuery.setProperties(propNames);
newQuery.setCoordinateSystem(query.getCoordinateSystem());
newQuery.setCoordinateSystemReproject(query.getCoordinateSystemReproject());
newQuery.setHandle(query.getHandle());
newQuery.setMaxFeatures(query.getMaxFeatures());

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

query.setCoordinateSystemReproject(getMapContent().getCoordinateReferenceSystem());
FeatureSource featureSource = getLayer().getFeatureSource();
Collection<PropertyDescriptor> descriptors = featureSource.getSchema().getDescriptors();

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

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;
}

代码示例来源:origin: org.geotools/gt-app-schema

query.setCoordinateSystemReproject(reprojection);

代码示例来源:origin: org.geomajas/geomajas-project-deskmanager

query.setCoordinateSystemReproject(targetCrs);

代码示例来源:origin: org.geotools/gt-app-schema

newQuery.setProperties(propNames);
newQuery.setCoordinateSystem(query.getCoordinateSystem());
newQuery.setCoordinateSystemReproject(query.getCoordinateSystemReproject());
newQuery.setHandle(query.getHandle());
newQuery.setMaxFeatures(query.getMaxFeatures());

代码示例来源:origin: org.geotools/gt-app-schema

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.setSortBy(query.getSortBy());
  namedQuery.setHints(query.getHints());
  if (query instanceof JoiningQuery) {
    ((JoiningQuery) namedQuery).setQueryJoins(((JoiningQuery) query).getQueryJoins());
  }
  return namedQuery;
}

代码示例来源:origin: org.geotools/gt-swing

query.setCoordinateSystemReproject(getMapContent().getCoordinateReferenceSystem());
FeatureSource featureSource = getLayer().getFeatureSource();
Collection<PropertyDescriptor> descriptors = featureSource.getSchema().getDescriptors();

相关文章