use of com.revolsys.geometry.cs.Authority in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystems method loadArea.
private static void loadArea() {
try (ChannelReader reader = newChannelReader("area")) {
while (true) {
final int code = reader.getInt();
final String name = reader.getStringUtf8ByteCount();
final double minX = reader.getDouble();
final double minY = reader.getDouble();
final double maxX = reader.getDouble();
final double maxY = reader.getDouble();
final boolean deprecated = readBoolean(reader);
final Authority authority = new EpsgAuthority(code);
BoundingBox boundingBox;
if (Double.isFinite(minX) || Double.isFinite(minX) || Double.isFinite(minX) || Double.isFinite(minX)) {
boundingBox = new BoundingBoxDoubleXY(minX, minY, maxX, maxY);
} else {
boundingBox = BoundingBox.empty();
}
final Area area = new Area(name, boundingBox, authority, deprecated);
AREA_BY_ID.put(code, area);
}
} catch (final NoSuchResourceException e) {
} catch (final WrappedException e) {
if (Exceptions.isException(e, EOFException.class)) {
} else {
throw e;
}
}
}
use of com.revolsys.geometry.cs.Authority in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystems method getCrsId.
public static int getCrsId(final CoordinateSystem coordinateSystem) {
final Authority authority = coordinateSystem.getAuthority();
if (authority != null) {
final String name = authority.getName();
final String code = authority.getCode();
if (name.equals("EPSG")) {
return Integer.parseInt(code);
}
}
return 0;
}
use of com.revolsys.geometry.cs.Authority in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystems method getCrsName.
public static String getCrsName(final CoordinateSystem coordinateSystem) {
final Authority authority = coordinateSystem.getAuthority();
final String name = authority.getName();
final String code = authority.getCode();
if (name.equals("EPSG")) {
return name + ":" + code;
} else {
return null;
}
}
use of com.revolsys.geometry.cs.Authority in project com.revolsys.open by revolsys.
the class EpsgCsWktWriter method write.
public static void write(final PrintWriter out, final PrimeMeridian primeMeridian) {
if (primeMeridian != null) {
out.print(",PRIMEM[");
write(out, primeMeridian.getName());
out.write(',');
final double longitude = primeMeridian.getLongitude();
write(out, longitude);
final Authority authority = primeMeridian.getAuthority();
write(out, authority);
out.write(']');
}
}
use of com.revolsys.geometry.cs.Authority in project com.revolsys.open by revolsys.
the class EpsgCsWktWriter method write.
public static void write(final PrintWriter out, final GeographicCoordinateSystem coordinateSystem) {
if (coordinateSystem != null) {
out.print("GEOGCS[");
write(out, coordinateSystem.getCoordinateSystemName());
final GeodeticDatum geodeticDatum = coordinateSystem.getDatum();
write(out, geodeticDatum);
final PrimeMeridian primeMeridian = coordinateSystem.getPrimeMeridian();
write(out, primeMeridian);
final AngularUnit unit = coordinateSystem.getAngularUnit();
write(out, unit);
final Authority authority = coordinateSystem.getAuthority();
write(out, authority);
out.write(']');
}
}
Aggregations