properties, (TemporalDatum) datum, (TimeCS) cs); } else if (crs instanceof ImageCRS) { modified = crsFactory.createImageCRS(properties, (ImageDatum) datum, (AffineCS) cs); } else if (crs instanceof EngineeringCRS) { modified =
/** * Parses an {@code "ImageCRS"} (WKT 2) element. The syntax is given by * <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#79">WKT 2 specification §12</a>. * * @param mode {@link #FIRST}, {@link #OPTIONAL} or {@link #MANDATORY}. * @param parent the parent element. * @return the {@code "ImageCRS"} element as an {@link ImageCRS} object. * @throws ParseException if the {@code "ImageCRS"} element can not be parsed. */ private ImageCRS parseImageCRS(final int mode, final Element parent) throws ParseException { final Element element = parent.pullElement(mode, WKTKeywords.ImageCRS); if (element == null) { return null; } final String name = element.pullString("name"); final ImageDatum datum = parseImageDatum(MANDATORY, element); final Unit<?> unit = parseUnit(element); final CoordinateSystem cs; try { cs = parseCoordinateSystem(element, WKTKeywords.Cartesian, 2, false, unit, datum); final Map<String,?> properties = parseMetadataAndClose(element, name, datum); if (cs instanceof AffineCS) { return crsFactory.createImageCRS(properties, datum, (AffineCS) cs); } } catch (FactoryException exception) { throw element.parseFailed(exception); } throw element.illegalCS(cs); }
/** * Parses an {@code "ImageCRS"} (WKT 2) element. The syntax is given by * <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#79">WKT 2 specification §12</a>. * * @param mode {@link #FIRST}, {@link #OPTIONAL} or {@link #MANDATORY}. * @param parent the parent element. * @return the {@code "ImageCRS"} element as an {@link ImageCRS} object. * @throws ParseException if the {@code "ImageCRS"} element can not be parsed. */ private ImageCRS parseImageCRS(final int mode, final Element parent) throws ParseException { final Element element = parent.pullElement(mode, WKTKeywords.ImageCRS); if (element == null) { return null; } final String name = element.pullString("name"); final ImageDatum datum = parseImageDatum(MANDATORY, element); final Unit<?> unit = parseUnit(element); final CoordinateSystem cs; try { cs = parseCoordinateSystem(element, WKTKeywords.Cartesian, 2, false, unit, datum); final Map<String,?> properties = parseMetadataAndClose(element, name, datum); if (cs instanceof AffineCS) { return crsFactory.createImageCRS(properties, datum, (AffineCS) cs); } } catch (FactoryException exception) { throw element.parseFailed(exception); } throw element.illegalCS(cs); }