我后面自己找了一下,创建udb文件可以这样子
DatasourceConnectionInfo info = new DatasourceConnectionInfo(); info.setEngineType(EngineType.UDB); info.setServer(filePath + "/" + fileNameWithoutExtension); // 尝试打开或创建数据源 Workspace workspace = new Workspace(); Datasource datasource = workspace.getDatasources().create(info); if (datasource == null) { // 如果数据源存在,创建失败则datasource为空,直接尝试打开它 datasource = workspace.getDatasources().open(info); }
2、多面循环裁剪
GeoRegion paintRegion = null; if (CollectionUtil.isNotEmpty(point2DList)) { paintRegion = new GeoRegion(); // 封装对应要裁剪的多边形的点 for (List<Point2dDto> point2dTempList : point2DList) { Point2Ds point2Ds = new Point2Ds(); for (Point2dDto point2dDto : point2dTempList) { point2Ds.add(new Point2D(point2dDto.getX(), point2dDto.getY())); } paintRegion.addPart(point2Ds); } }
...
// 最后进行裁剪
finalDataset = VectorClip.clipDatasetVector(datasetVector, paintRegion, true, false, datasourceDesc, finalName);
对应的代码还是得自己想一想才知道。。。。通过找官方demo和api,就是有点费脑。。。