Converts a way with potential inner ways to a JTS geometry.

@param way       the way
@param innerWays the inner ways or null
@return the JTS geometry
761020
public static Geometry toJtsGeometry(TDWay way, List<TDWay> innerWays) {
        if (way == null) {
            LOGGER.warning("way is null");
            return null;
        }

        if (way.isForcePolygonLine()) {
            // may build a single line string if inner ways are empty
            return buildMultiLineString(way, innerWays);
        }

        if (way.getShape() != TDWay.LINE || innerWays != null && innerWays.size() > 0) {
            // Have to be careful here about polygons and lines again, the problem with
            // polygons is that a certain direction is forced, so we do not want to reverse
            // closed lines that are not meant to be polygons
            // may contain holes if inner ways are not empty
            Polygon polygon = buildPolygon(way, innerWays);
            if (polygon.isValid()) {
                return polygon;
            }
            return repairInvalidPolygon(polygon);
        }
        // not a closed line
        return buildLineString(way);
    }
938425
public DirectionsRoute toDirectionRoute() {

    return DirectionsRoute.builder()
      .legs(legs())
      .geometry(geometry())
      .weightName(weightName())
      .weight(weight())
      .duration(duration())
      .distance(distance())
      .routeOptions(routeOptions())
      .voiceLanguage(voiceLanguage())
      .build();
  }
1357430
public java.util.List<GatewayInfo> getGateways() {
        if (gateways == null) {
            gateways = new com.amazonaws.internal.SdkInternalList<GatewayInfo>();
        }
        return gateways;
    }
344565
public JoinDescription nested(EntityPath<?>... paths) {
        for (EntityPath<?> path : paths) {
            nested(J.left(path));
        }

        return this;
    }
1017786
public static GeometryCriterion buildGeometryCriterion(final Geometry geometry, final MapWidget mapWidget,
			VectorLayer layer) {
		List<String> layers;
		if (null == layer) {
			layers = getVisibleServerLayerIds(mapWidget.getMapModel());
		} else {
			layers = new ArrayList<String>();
			layers.add(layer.getServerLayerId());
		}
		return new GeometryCriterion(layers, GeometryConverter.toDto(geometry));
	}
849159
public static Geometry reverse3DLine(Geometry geometry, String order) {
        if(geometry == null){
            return null;
        }
        if (geometry instanceof LineString) {
            return reverse3D((LineString) geometry, order);
        } else if (geometry instanceof MultiLineString) {
            return reverse3D((MultiLineString) geometry, order);
        }
        return null;
    }
606797
public java.util.List<VpnGateway> getVpnGateways() {
        if (vpnGateways == null) {
            vpnGateways = new com.amazonaws.internal.SdkInternalList<VpnGateway>();
        }
        return vpnGateways;
    }
1278473
public Javalin ws(@NotNull String path, @NotNull Consumer<WsHandler> ws) {
        return ws(path, ws, new HashSet<>());
    }
961653
@Pure
	public void toPath2D(Path2d path) {
		// loop on parts and build the path to draw
		for (final BusItinerary iti : busItineraries()) {
			iti.toPath2D(path);
		}
	}
226634
protected ReadOnlyListWrapper<PathElementType> innerTypesProperty() {
		if (this.types == null) {
			this.types = new ReadOnlyListWrapper<>(this, MathFXAttributeNames.TYPES,
					FXCollections.observableList(new ArrayList<>()));
		}
		return this.types;
	}
197448
public static <T extends Geometry> JTSGeometryExpression<T> asJTSGeometry(T value) {
        return asJTSGeometry(Expressions.constant(value));
    }
965323
public Geometry execute(Geometry geometry) {
		if (geometry instanceof Polygon) {
			Polygon polygon = (Polygon) geometry;
			if (geometry.isEmpty()) {
				return null;
			} else {
				LinearRing[] interiorRings = new LinearRing[polygon.getNumInteriorRing() + 1];
				int count = 0;
				for (int n = 0; n < interiorRings.length; n++) {
					if (n == index) {
						interiorRings[n] = ring;
					} else {
						interiorRings[n] = polygon.getInteriorRingN(count);
					}
				}
				return geometry.getGeometryFactory().createPolygon(polygon.getExteriorRing(), interiorRings);
			}
		}
		return null;
	}
975751
private static org.geomajas.gwt.client.spatial.geometry.Geometry[] convertGeometries(Geometry geometry,
			org.geomajas.gwt.client.spatial.geometry.Geometry[] geometries) {
		for (int i = 0; i < geometries.length; i++) {
			geometries[i] = toGwt(geometry.getGeometries()[i]);
		}
		return geometries;
	}
426581
@Override
    public INDArray arange(double begin, double end, double step) {
        return Nd4j.create(ArrayUtil.toDoubles(ArrayUtil.range((int) begin, (int) end,  (int)step)));
    }
256155
public VectorTile toDto(InternalTile tile) throws GeomajasException {
		if (null != tile) {
			VectorTile dto = new VectorTile();
			dto.setClipped(tile.isClipped());
			dto.setCode(tile.getCode());
			dto.setCodes(tile.getCodes());
			dto.setScreenHeight(tile.getScreenHeight());
			dto.setScreenWidth(tile.getScreenWidth());
			dto.setFeatureContent(tile.getFeatureContent());
			dto.setLabelContent(tile.getLabelContent());
			dto.setContentType(tile.getContentType());
			return dto;
		}
		return null;
	}
35701
@SuppressWarnings("unchecked")
	@Pure
	public Tree<RoadPolyline, ?> getInternalTree() {
		if (this.roadSegments instanceof GISTreeSet<?, ?>) {
			return ((GISTreeSet<RoadPolyline, ?>) this.roadSegments).getTree();
		}
		return null;
	}
807306
public static Geometry toDto(org.geomajas.gwt.client.spatial.geometry.Geometry geometry) {
		if (geometry == null) {
			return null;
		}
		int srid = geometry.getSrid();
		int precision = geometry.getPrecision();

		Geometry dto;
		if (geometry instanceof Point) {
			dto = new Geometry(Geometry.POINT, srid, precision);
			dto.setCoordinates(geometry.getCoordinates());
		} else if (geometry instanceof LinearRing) {
			dto = new Geometry(Geometry.LINEAR_RING, srid, precision);
			dto.setCoordinates(geometry.getCoordinates());
		} else if (geometry instanceof LineString) {
			dto = new Geometry(Geometry.LINE_STRING, srid, precision);
			dto.setCoordinates(geometry.getCoordinates());
		} else if (geometry instanceof Polygon) {
			dto = new Geometry(Geometry.POLYGON, srid, precision);
			Polygon polygon = (Polygon) geometry;
			if (!polygon.isEmpty()) {
				Geometry[] geometries = new Geometry[polygon.getNumInteriorRing() + 1];
				for (int i = 0; i < geometries.length; i++) {
					if (i == 0) {
						geometries[i] = toDto(polygon.getExteriorRing());
					} else {
						geometries[i] = toDto(polygon.getInteriorRingN(i - 1));
					}
				}
				dto.setGeometries(geometries);
			}
		} else if (geometry instanceof MultiPoint) {
			dto = new Geometry(Geometry.MULTI_POINT, srid, precision);
			dto.setGeometries(convertGeometries(geometry));
		} else if (geometry instanceof MultiLineString) {
			dto = new Geometry(Geometry.MULTI_LINE_STRING, srid, precision);
			dto.setGeometries(convertGeometries(geometry));
		} else if (geometry instanceof MultiPolygon) {
			dto = new Geometry(Geometry.MULTI_POLYGON, srid, precision);
			dto.setGeometries(convertGeometries(geometry));
		} else {
			String msg = "GeometryConverter.toDto() unrecognized geometry type";
			Log.logServer(Log.LEVEL_ERROR, msg);
			throw new IllegalStateException(msg);
		}

		return dto;
	}