使用产品:iobject java linux64 11.0.1.21420.98023
操作系统:CentOS Linux 7 (Core) 内核:3.10.0-1127.el7.x86_64
使用的obj模型,在iDesktopX win64 11.0.1 21525 98691 中导入没有问题
1.使用ImportSettingModelOSG导入
DataImport dataImport = new DataImport();
ImportSettingModelOSG setting = new ImportSettingModelOSG();
setting.setObjRotate(com.supermap.data.conversion.ObjRotateOption.RotateYZ);
setting.setPosition(position);
setting.setTargetDatasource(ds);
setting.setTargetDatasetName(datasetName);
setting.setSourceFilePath(path);
setting.setTargetPrjCoordSys(PrjCoordSys.fromEPSG(EPSG));
setting.setEnableMultiThread(true);
setting.setTargetEncodeType(EncodeType.NONE);
setting.setSourceFileCharset(Charset.UTF8);
setting.setImportMode(ImportMode.OVERWRITE);
dataImport.getImportSettings().add(setting);
结果没有报错,但没有新数据集出现在数据源中
2.使用ModelConvertor.fromFile导入
GeoModel3D geoModel3D = new GeoModel3D();
Model modelContainer = new Model();
ModelFileSetting impSetting = new ModelFileSetting();
DatasetVectorInfo modelDatasetInfo = new DatasetVectorInfo();
impSetting.setFilePath(path);
ModelConvertor.fromFile(modelContainer, impSetting);
geoModel3D.setModel(modelContainer);
geoModel3D.setPosition(position);
geoModel3D.setRotationZ(-1);
datasetName = ds.getDatasets().getAvailableDatasetName(datasetName, DatasetType.MODEL);
modelDatasetInfo.setName(datasetName);
modelDatasetInfo.setType(DatasetType.MODEL);
DatasetVector modelDataset = ds.getDatasets().create(modelDatasetInfo, PrjCoordSys.fromEPSG(EPSG));
Recordset recordset = modelDataset.getRecordset(true, CursorType.DYNAMIC);
recordset.edit();
recordset.addNew(geoModel3D);
recordset.update();
recordset.close();
recordset.dispose();
modelDataset.close();
modelContainer.dispose();
modelDatasetInfo.dispose();
结果报错,程序终止,错误日志:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f7fbf3b0374, pid=30449, tid=0x00007f806c4fc700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libSuFileParser.so+0x57374] UGC::UGFileParseModel::SetParseModelNode(unsigned char)+0x4
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#