public static ProjectedCoordinateReferenceSystem mkProjected(CrsId srid, LinearUnit unit) { return new ProjectedCoordinateReferenceSystem(srid, "Generic 2D Projected", mkGeographic(Unit.DEGREE), Projection.UNKNOWN, new ArrayList<>(), new CartesianCoordinateSystem2D(new StraightLineAxis("X", CoordinateSystemAxisDirection.EAST, unit), new StraightLineAxis("Y", CoordinateSystemAxisDirection.NORTH, unit))); }
/** * Implementation to decode a Projected CRS. * * @return The <code>ProjectedCoordinateReferenceSystem</code> that is decoded from the WKT. */ private ProjectedCoordinateReferenceSystem decodeProjectedCrs() { String crsName = decodeName(); matchesElementSeparator(); Geographic2DCoordinateReferenceSystem geogcs = decodeGeographicCrs(); matchesElementSeparator(); Unit unit; Projection projection; List<CrsParameter> parameters; // spatial_reference.sql contains both variants of ProjCRS Wkt if (currentToken == CrsWktVariant.UNIT) { unit = decodeUnit(true); projection = decodeProjection(); parameters = decodeOptionalParameters(); } else { projection = decodeProjection(); parameters = decodeOptionalParameters(); unit = decodeUnit(true); } CoordinateSystemAxis[] twinAxes = decodeOptionalAxes(2, unit, ProjectedCoordinateReferenceSystem.class); Extension extension = decodeOptionalExtension(); CrsId crsId = decodeOptionalAuthority(srid); matchesCloseList(); return new ProjectedCoordinateReferenceSystem(crsId, crsName, geogcs, projection, parameters, new CartesianCoordinateSystem2D((StraightLineAxis)twinAxes[0], (StraightLineAxis)twinAxes[1]), extension); }