/** * The x-axis coordinate in map units (degree, kilometer, meter, mile, foot * and inch). If your map is in a geographic projection, this will be the * Longitude. Otherwise, it will be the x coordinate of the map location in * your map units. * * @return the x-axis value of this point. */ public double lon() { return positions().lon(); }
/** * The x-axis coordinate in map units (degree, kilometer, meter, mile, foot * and inch). If your map is in a geographic projection, this will be the * Longitude. Otherwise, it will be the x coordinate of the map location in * your map units. * * @return the x-axis value of this point. */ public double lon() { return positions().lon(); }
protected com.vividsolutions.jts.geom.LineString toJtsLineString(LineString src) { return this.geometryFactory.createLineString( StreamSupport.stream(src.positions().children().spliterator(), false) .map(sp -> new Coordinate(sp.lon(), sp.lat(), sp.alt())) .toArray(Coordinate[]::new) ); }
protected com.vividsolutions.jts.geom.LinearRing toJtsLinearRing(LinearRing src) { return this.geometryFactory.createLinearRing( StreamSupport.stream(src.positions().children().spliterator(), false) .map(sp -> new Coordinate(sp.lon(), sp.lat(), sp.alt())) .toArray(Coordinate[]::new) ); }
protected com.vividsolutions.jts.geom.LineString toJtsLineString(LineString src) { return this.geometryFactory.createLineString( StreamSupport.stream(src.positions().children().spliterator(), false) .map(sp -> new Coordinate(sp.lon(), sp.lat(), sp.alt())) .toArray(Coordinate[]::new) ); }
protected com.vividsolutions.jts.geom.LinearRing toJtsLinearRing(LinearRing src) { return this.geometryFactory.createLinearRing( StreamSupport.stream(src.positions().children().spliterator(), false) .map(sp -> new Coordinate(sp.lon(), sp.lat(), sp.alt())) .toArray(Coordinate[]::new) ); }
@Override protected boolean matchesSafely(SinglePosition item) { return item.lon() == lon && item.lat() == lat; }
@Override public void write(JsonWriter out, Positions value) throws IOException { if (value == null) { out.nullValue(); } else { out.beginArray(); if (value instanceof SinglePosition) { SinglePosition sp = (SinglePosition) value; out.value(sp.lon()); out.value(sp.lat()); if (!Double.isNaN(sp.alt())) { out.value(sp.alt()); } } else { for (Positions child : value.children()) { write(out, child); } } out.endArray(); } }
@Override public void write(JsonWriter out, Positions value) throws IOException { if (value == null) { out.nullValue(); } else { out.beginArray(); if (value instanceof SinglePosition) { SinglePosition sp = (SinglePosition) value; out.value(sp.lon()); out.value(sp.lat()); if (!Double.isNaN(sp.alt())) { out.value(sp.alt()); } } else { for (Positions child : value.children()) { write(out, child); } } out.endArray(); } }
@Override protected boolean matchesSafely(SinglePosition item) { return item.lon() == lon && item.lat() == lat && item.alt() == alt; }