@Override public GridCoverage2D getGridCoverage() { try { // There is a serious standardization failure around the axis order of WGS84. See issue #1930. // GeoTools assumes strict EPSG axis order of (latitude, longitude) unless told otherwise. // Both NED and SRTM data use the longitude-first axis order, so OTP makes grid coverages // for unprojected DEMs assuming coordinates are in (longitude, latitude) order. Hints forceLongLat = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); GeoTiffFormat format = new GeoTiffFormat(); GeoTiffReader reader = format.getReader(path, forceLongLat); coverage = reader.read(null); LOG.info("Elevation model CRS is: {}", coverage.getCoordinateReferenceSystem2D()); } catch (IOException e) { throw new RuntimeException("Error getting coverage automatically. ", e); } return coverage; }
CoordinateReferenceSystem sourceCRS = featureSource.getInfo().getCRS(); Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", hints);
/** * Creates a new instance of {@code BasicFactories} with the specified set of hints. The * {@code hints} map should contains only the minimum set of hints, since this constructor * will keep a reference to all objects found in this map. * * @param hints The hints to be used for all factory creation, or {@code null} if none. */ public BasicFactories(final Map hints) { this.hints = (hints!=null) ? new Hints(hints) : null; }
/** * Creates a new instance of {@code BasicFactories} with the specified set of hints. The * {@code hints} map should contains only the minimum set of hints, since this constructor * will keep a reference to all objects found in this map. * * @param hints The hints to be used for all factory creation, or {@code null} if none. */ public BasicFactories(final Map hints) { this.hints = (hints!=null) ? new Hints(hints) : null; }
public Hints getHints() { if(hints == null) hints = new Hints(Collections.EMPTY_MAP); return hints; }
/** * Getter for {@link Hints} . * @return {@link Hints} provided at construction time to control {@link GridCoverageFactory} creation. * @uml.property name="hints" */ public synchronized Hints getHints() { return new Hints(hints); }
/** * Creates a new instance of GeoTiffReader * * @param input * the GeoTiff file * @throws DataSourceException */ public GeoTiffReader(Object input) throws DataSourceException { this(input, new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE)); }
/** * Returns an empty Hints set */ public Hints getHints() { return new Hints(Collections.EMPTY_MAP); } }
/** * Returns a default common factory instance. */ public static synchronized CommonFactory getDefault() { if (DEFAULT == null) { DEFAULT = new BasicFactories(new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE)); } return DEFAULT; }
/** * Returns a default common factory instance. */ public static synchronized BasicFactories getDefault() { if (DEFAULT == null) { DEFAULT = new BasicFactories(new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE)); } return DEFAULT; }
public GeoWaveRasterReader(final GeoWaveRasterConfig config) throws DataSourceException { super(new Object(), new Hints()); this.config = config; init(config); }
/** * Creates a {@link CRSUtils} which offers assistance when doing spatial opererations. Forcing XY means * that CRS axis ordering is considered lon/lat ordering, even if defined lat/lon. * * @return creates a reference helper which (strictly) handles referencing operations. * @throws IllegalStateException * if decoding default CRS fails. */ public static CRSUtils createEpsgForcedXYAxisOrder() { Hints hints = new Hints(FORCE_LONGITUDE_FIRST_AXIS_ORDER, TRUE); return createEpsgReferenceHelper(hints); }
public Coverage doOperation(ParameterValueGroup parameters, Hints hints) { return FilteredSubsampledGridCoverage2D .create(parameters, (hints instanceof Hints) ? (Hints) hints : new Hints(hints)); } }
try { Hints hints = new Hints(); hints.getList(); // adds to the stack Stack s = hints.getStack(); // return the stack int stackSize = s.size(); for (int i = 0; i < stackSize; i++) { System.out.println(s.pop()); // pop from the stack } } catch (IOException ex) { Logger.getLogger(JavaApplication18.class.getName()).log(Level.SEVERE, null, ex); }
/** * Creates a new instance using the specified hints. * * @param hints The hints, or {@code null} if none. */ public Operations(final RenderingHints hints) { if (hints != null && !hints.isEmpty()) { processor = CoverageProcessor.getInstance(new Hints(hints)); } // Otherwise, will creates the processor only when first needed. }
public Coverage doOperation(ParameterValueGroup parameters, Hints hints) { try { return ScaledGridCoverage2D .create(parameters, (hints instanceof Hints) ? (Hints) hints : new Hints(hints)); } catch (NoninvertibleTransformException e) { throw new CannotScaleException(Errors .format(ErrorKeys.NONINVERTIBLE_SCALING_TRANSFORM), e); } } }
@Override public void init() { GeometryHandler.instance = this; Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, isEastingFirstEpsgCode(getStorageEPSG())); this.crsAuthority = getCRSAuthorityFactory(this.authority, hints); }
@Override protected FeatureCollection getMatches(Filter filter) throws IOException { GranuleSource granules = reader.getGranules(null, true); Query q = new Query(null, filter); q.setHints(new Hints(StructuredCoverageViewReader.QUERY_FIRST_BAND, true)); return granules.getGranules(q); } }
@BeforeClass public static void setup() throws NoSuchAuthorityCodeException, FactoryException { Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", hints); PROJ_EPSG4326_CRS = (AbstractReferenceSystem) factory .createCoordinateReferenceSystem(PROJ_EPSG4326); PROJ_EQUIV_EPSG4326_CRS = (AbstractReferenceSystem) CRS.parseWKT(PROJ_EQUIV_EPSG4326); }
@BeforeClass public static void setup() throws NoSuchAuthorityCodeException, FactoryException { Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); CRSAuthorityFactory factory = ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", hints); PROJ_EPSG4326_CRS = (AbstractReferenceSystem) factory .createCoordinateReferenceSystem(PROJ_EPSG4326); PROJ_EQUIV_EPSG4326_CRS = (AbstractReferenceSystem) CRS.parseWKT(PROJ_EQUIV_EPSG4326); }