/** * Constructs a new {@code MetadataBuilder} using default factories. */ public MetadataBuilder() { this(FactoryGroup.createInstance(null)); }
parameters.parameter("false_northing").setValue(0.0); final FactoryGroup factories = FactoryGroup .createInstance(null); final Map properties = Collections.singletonMap("name", "WGS 84 / Antartic Polar Stereographic");
/** * Constructs the two-dimensional CRS. This is usually identical to the user-supplied CRS. * However, the user is allowed to specify a wider CRS (for example a 3D one which includes * a time axis), in which case we infer which axis apply to the 2D image, and constructs a * 2D CRS with only those axis. * * @return The coordinate reference system, or {@code null} if none. */ private CoordinateReferenceSystem createCRS2D() { if (!super.isDefined(CRS)) { return null; } final CoordinateReferenceSystem crs = super.getCoordinateReferenceSystem(); if (FACTORY_GROUP == null) { FACTORY_GROUP = FactoryGroup.createInstance(null); // No need to synchronize: this is not a big deal // if two FactoryGroup instances are created. } final CoordinateReferenceSystem crs2D; try { crs2D = FACTORY_GROUP.separate(crs, new int[] {axisDimensionX, axisDimensionY}); } catch (FactoryException exception) { final InvalidGridGeometryException e = new InvalidGridGeometryException( Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "crs", crs.getName())); e.initCause(exception); // TODO: inline in the constructor with J2SE 1.5. throw e; } assert crs2D.getCoordinateSystem().getDimension() == 2 : crs2D; return crs2D; }