/** * Create a Point from the given coordinates. * * @param lon The x axis value. Longitude in a geographic projection. * @param lat The y axis value. Latitude in a geographic projection. * @param alt The z axis value. Altitude in a geographic projection. * @return Point instance. */ public static Point from(double lon, double lat, double alt) { return new Point(new SinglePosition(lon, lat, alt)); }
/** * Create a Point from the given coordinates. * * @param lon The x axis value. Longitude in a geographic projection. * @param lat The y axis value. Latitude in a geographic projection. * @param alt The z axis value. Altitude in a geographic projection. * @return Point instance. */ public static Point from(double lon, double lat, double alt) { return new Point(new SinglePosition(lon, lat, alt)); }
@Override public Positions positions() { Positions positions = new SinglePosition(Double.NaN, Double.NaN, Double.NaN); for (Geometry<?> geometry : this.geometries) { positions.merge(geometry.positions()); } return positions; }
@Override public Positions positions() { Positions positions = new SinglePosition(Double.NaN, Double.NaN, Double.NaN); for (Geometry<?> geometry : this.geometries) { positions.merge(geometry.positions()); } return positions; }
private static Positions parseSinglePosition(JsonReader in) throws IOException { double lon = in.nextDouble(); double lat = in.nextDouble(); double alt = Double.NaN; if (in.hasNext()) { alt = in.nextDouble(); } // Skip eventual other dimensions while (in.peek() != JsonToken.END_ARRAY) { in.skipValue(); } return new SinglePosition(lon, lat, alt); }
private static Positions parseSinglePosition(JsonReader in) throws IOException { double lon = in.nextDouble(); double lat = in.nextDouble(); double alt = Double.NaN; if (in.hasNext()) { alt = in.nextDouble(); } // Skip eventual other dimensions while (in.peek() != JsonToken.END_ARRAY) { in.skipValue(); } return new SinglePosition(lon, lat, alt); }