private static CoordinateReferenceSystem getCRS(final Expression e1, final Expression e2) { return GeometryUtils.getDefaultCRS(); }
@Override public AdapterPersistenceEncoding encode( final SimpleFeature entry, final CommonIndexModel indexModel) { if (transform != null) { return super.encode( GeometryUtils.crsTransform(entry, reprojectedFeatureType, transform), indexModel); } return super.encode(entry, indexModel); }
@Override public Geometry readField(final byte[] fieldData) { if ((fieldData == null) || (fieldData.length < 1)) { return null; } return GeometryUtils.geometryFromBinary( fieldData, GeometryUtils.MAX_GEOMETRY_PRECISION, FieldUtils.SERIALIZATION_VERSION); }
public static CoordinateReferenceSystem getIndexCrs(final Index[] indices) { CoordinateReferenceSystem indexCrs = null; for (final Index primaryindx : indices) { // for first iteration if (indexCrs == null) { indexCrs = getIndexCrs(primaryindx); } else { if (primaryindx.getIndexModel() instanceof CustomCrsIndexModel) { // check if indexes have different CRS if (!indexCrs.equals(((CustomCrsIndexModel) primaryindx.getIndexModel()).getCrs())) { LOGGER.error("Multiple indices with different CRS is not supported"); throw new RuntimeException("Multiple indices with different CRS is not supported"); } else { if (!indexCrs.equals(getDefaultCRS())) { LOGGER.error("Multiple indices with different CRS is not supported"); throw new RuntimeException("Multiple indices with different CRS is not supported"); } } } } } return indexCrs; }
final CoordinateReferenceSystem inputIndexCrs = GeometryUtils.getIndexCrs(inputPrimaryIndex); final String inputCrsCode = GeometryUtils.getCrsCode(inputIndexCrs); outputIndexCrs = GeometryUtils.getIndexCrs(outputPrimaryIndex); outputCrsCode = GeometryUtils.getCrsCode(outputIndexCrs); } else { final SpatialDimensionalityTypeProvider sdp = new SpatialDimensionalityTypeProvider(); final ExtractGeometryFilterVisitorResult geoAndCompareOpData = (ExtractGeometryFilterVisitorResult) filter.accept( new ExtractGeometryFilterVisitor(GeometryUtils.getDefaultCRS(), geometryAttribute), null); bbox = geoAndCompareOpData.getGeometry(); if ((bbox != null) && !bbox.equals(GeometryUtils.infinity())) { bldr = bldr.constraints(
query = TestUtils.featureToQuery( GeometryUtils.crsTransform( feature, SimpleFeatureTypeBuilder.retype(feature.getFeatureType(), crsTransform), CRS.findMathTransform(GeometryUtils.getDefaultCRS(), crsTransform, true)), null, GeometryUtils.getCrsCode(crsTransform), useDuring);
final CoordinateReferenceSystem indexCrs = GeometryUtils.getIndexCrs(index); if (!indexCrs.equals(sourceCrs)) { try { if (indexCrs.equals(GeometryUtils.getDefaultCRS())) { bounds = GeometryUtils.basicConstraintSetFromEnvelope( projectedReferenceEnvelope).getIndexConstraints(indexStrategy); } else { bounds = GeometryUtils.getBoundsFromEnvelope(projectedReferenceEnvelope);
final Geometry geometry = geometryAndCompareOp.getGeometry(); final GeoConstraintsWrapper geoConstraints = GeometryUtils.basicGeoConstraintsWrapperFromGeometry(geometry); if (GeometryUtils.getDefaultCRS().equals( adapter.getFeatureType().getCoordinateReferenceSystem())) { baseQuery = new ExplicitSpatialQuery(constraints, geometry, extractedCompareOp); constraints, geometry, GeometryUtils.getCrsCode(adapter.getFeatureType().getCoordinateReferenceSystem()), extractedCompareOp, BasicQueryCompareOperation.INTERSECTS);
GeometryUtils.buffer( GeometryUtils.getDefaultCRS(), filter.getExpression2().evaluate(extraData, Geometry.class), filter.getDistanceUnits(), && (filter.getExpression1() instanceof Literal)) { final Pair<Geometry, Double> geometryAndDegrees = GeometryUtils.buffer( GeometryUtils.getDefaultCRS(), filter.getExpression1().evaluate(extraData, Geometry.class), filter.getDistanceUnits(),
(ExtractGeometryFilterVisitorResult) filter.accept( new ExtractGeometryFilterVisitor( GeometryUtils.getDefaultCRS(), geometryAttribute), null); if ((bbox != null) && !bbox.equals(GeometryUtils.infinity())) { bldr.constraints( bldr.constraintsFactory().spatialTemporalConstraints().spatialConstraints(
final Coordinate[] geoCoords = geometry.getCoordinates(); final List<Polygon> polygons = new LinkedList<>(); final Geometry world = world(geometry.getFactory(), GeometryUtils.getDefaultCRS());
String indexCrsCode = reprojectedFeatureType == null ? null : GeometryUtils.getCrsCode(reprojectedFeatureType.getCoordinateReferenceSystem()); for (final Index primaryindx : indices) {
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings() public static CoordinateReferenceSystem getDefaultCRS() { if (defaultCrsSingleton == null) { // avoid sync penalty if we can synchronized (MUTEX_DEFAULT_CRS) { // have to do this inside the sync to avoid double init if (defaultCrsSingleton == null) { try { initClassLoader(); defaultCrsSingleton = CRS.decode(DEFAULT_CRS_STR, true); } catch (final Exception e) { LOGGER.error("Unable to decode " + DEFAULT_CRS_STR + " CRS", e); defaultCrsSingleton = DefaultGeographicCRS.WGS84; } } } } return defaultCrsSingleton; }
protected CoordinateReferenceSystem getCrsForCoverage(final String coverageName) { CoordinateReferenceSystem crs = crsCache.get(coverageName); if (crs != null) { return crs; } final AdapterToIndexMapping adapterMapping = geowaveAdapterIndexMappingStore.getIndicesForAdapter(getAdapterId(coverageName)); final Index[] indices = adapterMapping.getIndices(geowaveIndexStore); if ((indices != null) && (indices.length > 0)) { crs = GeometryUtils.getIndexCrs(indices[0]); crsCache.put(coverageName, crs); } return crs; }
private Geometry infinity() { return GeometryUtils.infinity(); }
DateUtilities.parseISO("2005-05-17T19:32:56Z"), DateUtilities.parseISO("2005-05-17T22:32:56Z")).spatialConstraints( GeometryUtils.buffer( GeometryUtils.getDefaultCRS(), GeometryUtils.GEOMETRY_FACTORY.createPoint( new Coordinate(-77.03521, 38.8895)), DateUtilities.parseISO("2005-05-19T19:32:56Z"), DateUtilities.parseISO("2005-05-19T22:32:56Z")).spatialConstraints( GeometryUtils.buffer( GeometryUtils.getDefaultCRS(), GeometryUtils.GEOMETRY_FACTORY.createPoint( new Coordinate(-77.03521, 38.8895)),
private BasicQuery composeQuery( final GeoConstraintsWrapper geoConstraints, final Constraints temporalConstraints) { // TODO: this actually doesn't boost performance much, if at // all, and one key is missing - the query geometry has to be // topologically equivalent to its envelope and the ingested // geometry has to be topologically equivalent to its envelope // this could be kept as a statistic on ingest, but considering // it doesn't boost performance it may not be worthwhile // pursuing // if (geoConstraints.isConstraintsMatchGeometry()) { // return new BasicQuery( // geoConstraints.getConstraints().merge( // temporalConstraints)); // } // else { return new ExplicitSpatialQuery( geoConstraints.getConstraints().merge(temporalConstraints), geoConstraints.getGeometry(), GeometryUtils.getCrsCode( components.getAdapter().getFeatureType().getCoordinateReferenceSystem())); // } }
public QueryConstraints cqlConstraints(final String cqlExpression) { try { GeometryUtils.initClassLoader(); } catch (final MalformedURLException e) { LOGGER.error("Unable to initialize GeoTools class loader", e); } try { final Filter cqlFilter = ECQL.toFilter(cqlExpression); return new OptimalCQLQuery(cqlFilter); } catch (final CQLException e) { LOGGER.error("Unable to parse CQL expresion", e); } return null; }
final CoordinateReferenceSystem indexCrs = GeometryUtils.getIndexCrs(index); final ReferencedEnvelope mapExtent = new ReferencedEnvelope(
public static MathTransform transformFromCrs(final CoordinateReferenceSystem crs) { MathTransform mathTransform = null; if (crs != null) { try { mathTransform = CRS.findMathTransform(GeometryUtils.getDefaultCRS(), crs, true); } catch (final FactoryException e) { LOGGER.warn("Unable to create coordinate reference system transform", e); } } return mathTransform; }