public static MeshCoords createMeshCoords(Sector sector) { double aspect = sector.getDeltaLonDegrees() / sector.getDeltaLatDegrees(); float width = 100.0f; float height = (float) (width * aspect); return new MeshCoords(0f, 0f, height, width); }
private static AffineTransform createTransform(Sector source, MeshCoords destination) { java.awt.geom.AffineTransform transform = new java.awt.geom.AffineTransform(); transform.translate(destination.left, destination.bottom); transform.scale( (destination.right - destination.left) / source.getDeltaLonDegrees(), (destination.top - destination.bottom) / source.getDeltaLatDegrees()); transform.translate(-source.getMinLongitude().degrees, -source.getMinLatitude().degrees); return transform; }