/** * Gathers the tolerance for floating point comparisons * @return The tolerance set in the hints, or its default value if not set */ private static double getTolerance() { Double tol = ((Double) Hints.getSystemDefault(Hints.COMPARISON_TOLERANCE)); if(tol == null) return Hints.COMPARISON_TOLERANCE.getDefault(); else return tol; }
static SimpleFeatureReader getDelegateReader(SimpleFeatureReader reader, Query query) throws IOException { Hints hints = query.getHints(); int maxFeatures = 1000; if (hints != null && hints.get(Hints.MAX_MEMORY_SORT) != null) { maxFeatures = (Integer) hints.get(Hints.MAX_MEMORY_SORT); } else if (Hints.getSystemDefault(Hints.MAX_MEMORY_SORT) != null) { maxFeatures = (Integer) Hints.getSystemDefault(Hints.MAX_MEMORY_SORT); } return getDelegateReader(reader, query.getSortBy(), maxFeatures); }
/** * Checks if axis flipping is needed comparing axis order requested for the DataStore with query * crs. * * @param axisOrder * @param coordinateSystem * @return */ public static boolean invertAxisNeeded(String axisOrder, CoordinateReferenceSystem crs) { CRS.AxisOrder requestedAxis = CRS.getAxisOrder(crs); if (requestedAxis == CRS.AxisOrder.INAPPLICABLE) { boolean forcedLonLat = Boolean.getBoolean("org.geotools.referencing.forceXY") || Boolean.TRUE.equals( Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER)); if (forcedLonLat) { requestedAxis = CRS.AxisOrder.EAST_NORTH; } else { requestedAxis = CRS.AxisOrder.NORTH_EAST; } } if (WFSDataStoreFactory.AXIS_ORDER_NORTH_EAST.equals(axisOrder)) { return requestedAxis.equals(CRS.AxisOrder.EAST_NORTH); } else if (WFSDataStoreFactory.AXIS_ORDER_EAST_NORTH.equals(axisOrder)) { return requestedAxis.equals(CRS.AxisOrder.NORTH_EAST); } else { return false; // compliant, don't do anything } }
.equals(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER))) { Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http");
tolerance = (Double) Hints.getSystemDefault(Hints.RESAMPLE_TOLERANCE);