本文整理汇总了Java中org.geotools.data.Query.getCoordinateSystem方法的典型用法代码示例。如果您正苦于以下问题:Java Query.getCoordinateSystem方法的具体用法?Java Query.getCoordinateSystem怎么用?Java Query.getCoordinateSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geotools.data.Query
的用法示例。
在下文中一共展示了Query.getCoordinateSystem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: adaptQuery
import org.geotools.data.Query; //导入方法依赖的package包/类
/**
* Transforms the query applying the definition query in this layer, removes reprojection
* since data stores cannot be trusted
* @param query
* @param schema TODO
*
* @throws IOException
*/
protected Query adaptQuery(Query query, SimpleFeatureType schema) throws IOException {
// if needed, reproject the filter to the native srs
Query newQuery = makeDefinitionQuery(query, schema);
// // see if the CRS got xfered over
// // a. old had a CRS, new doesnt
// boolean requireXferCRS = (newQuery.getCoordinateSystem() == null)
// && (query.getCoordinateSystem() != null);
//
// if ((newQuery.getCoordinateSystem() != null) && (query.getCoordinateSystem() != null)) {
// //b. both have CRS, but they're different
// requireXferCRS = !(newQuery.getCoordinateSystem().equals(query.getCoordinateSystem()));
// }
//
// if (requireXferCRS) {
// //carry along the CRS
// if (!(newQuery instanceof Query)) {
// newQuery = new Query(newQuery);
// }
//
// ((Query) newQuery).setCoordinateSystem(query.getCoordinateSystem());
// }
//JD: this is a huge hack... but its the only way to ensure that we
// we get what we ask for ... which is not reprojection, since
// datastores are unreliable in this aspect we dont know if they will
// reproject or not.
// AA: added force coordinate system reset as well, since we cannot
// trust GT2 datastores there neither.
if ( newQuery.getCoordinateSystemReproject() != null ) {
newQuery.setCoordinateSystemReproject(null);
}
if ( newQuery.getCoordinateSystem() != null ) {
newQuery.setCoordinateSystem(null);
}
return newQuery;
}
示例2: equals
import org.geotools.data.Query; //导入方法依赖的package包/类
/**
* Equality based on propertyNames, maxFeatures, filter, typeName and
* version.
*
* <p>
* Changing the handle does not change the meaning of the Query.
* </p>
*
* @param obj
* Other object to compare against
*
* @return <code>true</code> if <code>obj</code> matches this filter
*/
@Override
public boolean equals(final Object obj) {
if ((obj == null) || !(obj instanceof Query)) {
return false;
}
if (this == obj) {
return true;
}
final Query other = (Query) obj;
return Arrays.equals(getPropertyNames(), other.getPropertyNames())
&& (retrieveAllProperties() == other.retrieveAllProperties())
&& (getMaxFeatures() == other.getMaxFeatures())
&& ((getFilter() == null) ? (other.getFilter() == null)
: getFilter().equals(other.getFilter()))
&& ((getTypeName() == null) ? (other.getTypeName() == null)
: getTypeName().equals(other.getTypeName()))
&& ((getVersion() == null) ? (other.getVersion() == null)
: getVersion().equals(other.getVersion()))
&& ((getCoordinateSystem() == null) ? (other
.getCoordinateSystem() == null) : getCoordinateSystem()
.equals(other.getCoordinateSystem()))
&& ((getCoordinateSystemReproject() == null) ? (other
.getCoordinateSystemReproject() == null)
: getCoordinateSystemReproject().equals(
other.getCoordinateSystemReproject()));
}
示例3: buildSqlQuery
import org.geotools.data.Query; //导入方法依赖的package包/类
protected String buildSqlQuery(Query query) throws IOException {
StringBuilder sql = new StringBuilder("SELECT ");
//column names
selectColumns(getSchema(), null, query, sql);
sql.setLength(sql.length() - 1);
// from
sql.append(" FROM ");
sql.append(typeName);
//filtering
Filter filter = query.getFilter();
if (filter != null && !Filter.INCLUDE.equals(filter)) {
sql.append(" WHERE ");
//encode filter
CoordinateReferenceSystem queryCrs = (query.getCoordinateSystem() != null) ? query.getCoordinateSystem() : query.getCoordinateSystemReproject();
filter(getSchema(), filter, sql, queryCrs);
}
//sorting
sort(getSchema(), query.getSortBy(), null, sql);
// finally encode limit/offset, if necessary
applyLimitOffset(sql, query);
return sql.toString();
}