本文整理了Java中org.geotools.util.factory.Hints.getSystemDefault()
方法的一些代码示例,展示了Hints.getSystemDefault()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hints.getSystemDefault()
方法的具体详情如下:
包路径:org.geotools.util.factory.Hints
类名称:Hints
方法名:getSystemDefault
[英]Returns the hint GeoTools#getDefaultHints for the specified key.
[中]返回指定键的提示GeoTools#getDefaultHints。
代码示例来源:origin: geoserver/geoserver
@BeforeClass
public static final void setUpReferencing() throws Exception {
// do we need to reset the referencing subsystem and reorient it with lon/lat order?
if (System.getProperty("org.geotools.referencing.forceXY") == null
|| !"http".equals(Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING))) {
System.setProperty("org.geotools.referencing.forceXY", "true");
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http");
}
}
代码示例来源:origin: geoserver/geoserver
Object o = Hints.getSystemDefault(Hints.EXECUTOR_SERVICE);
if (o != null && o instanceof ExecutorService) {
final ThreadPoolExecutor executor = (ThreadPoolExecutor) o;
代码示例来源:origin: geoserver/geoserver
System.setProperty("org.geotools.referencing.forceXY", "true");
if (Boolean.TRUE.equals(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER))) {
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http");
代码示例来源:origin: geotools/geotools
/**
* Convenience method checking if EWKT encoding should be enabled in ECQL, or not
*
* @return
*/
public static boolean isEwktEncodingEnabled() {
Object value = Hints.getSystemDefault(Hints.ENCODE_EWKT);
if (value == null) {
return true;
}
return Boolean.TRUE.equals(value);
}
代码示例来源:origin: geotools/geotools
private static void updateForcedLonLat() {
boolean forcedLonLat = false;
try {
forcedLonLat =
Boolean.getBoolean("org.geotools.referencing.forceXY")
|| Boolean.TRUE.equals(
Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER));
} catch (Exception e) {
// all right it was a best effort attempt
LOGGER.log(Level.FINE, "Failed to determine if we are in forced lon/lat mode", e);
}
FORCED_LON_LAT = new AtomicBoolean(forcedLonLat);
}
代码示例来源:origin: geotools/geotools
/**
* Gathers the tolerance for floating point comparisons
*
* @return The tolerance set in the hints, or its default value if not set
*/
private double getTolerance() {
Double tol = ((Double) Hints.getSystemDefault(Hints.COMPARISON_TOLERANCE));
if (tol == null) return Hints.COMPARISON_TOLERANCE.getDefault();
else return tol;
}
}
代码示例来源:origin: geotools/geotools
/**
* 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;
}
代码示例来源:origin: geoserver/geoserver
|| !"http".equals(Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING))) {
System.setProperty("org.geotools.referencing.forceXY", "true");
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http");
代码示例来源:origin: geotools/geotools
public String encode(Object object, String value) throws Exception {
final Date date = (Date) object;
Object hint = Hints.getSystemDefault(Hints.LOCAL_DATE_TIME_HANDLING);
Calendar calendar;
if (Boolean.TRUE.equals(hint)) {
calendar = Calendar.getInstance();
} else {
calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
}
calendar.clear();
calendar.setTimeInMillis(date.getTime());
return DatatypeConverterImpl.getInstance().printDate(calendar);
}
}
代码示例来源:origin: geotools/geotools
/** Constructs an authority factory using the specified hints and priority. */
public CoordinateOperationFactoryUsingWKT(final Hints userHints, final int priority) {
super(userHints, priority);
factories = ReferencingFactoryContainer.instance(userHints);
// Search for user CRS_AUTHORITY_EXTRA_DIRECTORY hint, or use system default value.
Object directoryHint = null;
if (userHints != null && userHints.get(Hints.CRS_AUTHORITY_EXTRA_DIRECTORY) != null) {
directoryHint = userHints.get(Hints.CRS_AUTHORITY_EXTRA_DIRECTORY);
} else if (Hints.getSystemDefault(Hints.CRS_AUTHORITY_EXTRA_DIRECTORY) != null) {
directoryHint = Hints.getSystemDefault(Hints.CRS_AUTHORITY_EXTRA_DIRECTORY);
}
if (directoryHint != null) {
directory = directoryHint.toString();
hints.put(Hints.CRS_AUTHORITY_EXTRA_DIRECTORY, directory);
} else {
directory = null;
}
}
代码示例来源:origin: geotools/geotools
value = Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING);
代码示例来源:origin: geotools/geotools
/**
* Gets the max amount amount of features to keep in memory from the query and system hints
*
* @param query
* @return
*/
static int getMaxFeatures(Query query) {
Hints hints = null;
if (query != null) {
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 maxFeatures;
}
代码示例来源:origin: geotools/geotools
/**
* 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
}
}
代码示例来源:origin: geotools/geotools
public String printDate(Calendar arg0) {
Object hint = Hints.getSystemDefault(Hints.LOCAL_DATE_TIME_HANDLING);
if (Boolean.TRUE.equals(hint)) {
return new XsLocalDateFormat().format(arg0);
}
return new XsDateFormat().format(arg0);
}
代码示例来源:origin: geotools/geotools
private String convertToString(Object unconvertedValue) {
String textValue = null;
if (unconvertedValue instanceof Calendar) {
Calendar cal = (Calendar) unconvertedValue;
textValue = DatatypeConverterImpl.getInstance().printDateTime(cal);
} else if (unconvertedValue instanceof java.sql.Date) {
DatatypeConverterImpl converter = DatatypeConverterImpl.getInstance();
Object hint = Hints.getSystemDefault(Hints.LOCAL_DATE_TIME_HANDLING);
Calendar cal;
if (Boolean.TRUE.equals(hint)) {
cal = Calendar.getInstance();
} else {
cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
}
cal.setTimeInMillis(((java.util.Date) unconvertedValue).getTime());
textValue = converter.printDate(cal);
} else if (unconvertedValue instanceof java.util.Date) {
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
cal.setTimeInMillis(((java.util.Date) unconvertedValue).getTime());
DatatypeConverterImpl converter = DatatypeConverterImpl.getInstance();
if (unconvertedValue instanceof java.sql.Time) {
textValue = converter.printTime(cal);
} else {
// java.util.Date and java.sql.TimeStamp
textValue = converter.printDateTime(cal);
}
}
return textValue;
}
}
代码示例来源:origin: geotools/geotools
Double tolerance = (Double) hints.get(Hints.RESAMPLE_TOLERANCE);
if (tolerance == null) {
tolerance = (Double) Hints.getSystemDefault(Hints.RESAMPLE_TOLERANCE);
代码示例来源:origin: geotools/geotools
tolerance = (Double) Hints.getSystemDefault(Hints.RESAMPLE_TOLERANCE);
代码示例来源:origin: geotools/geotools
/** Tests the {@link HTTP_AuthorityFactory#defaultAxisOrderHints} method. */
@Test
public void testAxisOrderHints() {
// The following are required for proper execution of the remaining of this test.
assertNull(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER));
assertNull(Hints.getSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING));
// Standard behavior should be to set FORCE_LONGITUDE_FIRST_AXIS_ORDER to false.
assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http"));
try {
// The hints should be ignored.
Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http"));
// The hints should be honored.
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http");
assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http"));
// The hints should be ignored.
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "urn");
assertFalse(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http"));
// The hints should be honored.
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http, urn");
assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http"));
// The hints should be honored.
Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "urn, http");
assertTrue(HTTP_AuthorityFactory.defaultAxisOrderHints(null, "http"));
} finally {
Hints.removeSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER);
Hints.removeSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING);
}
}
内容来源于网络,如有侵权,请联系作者删除!