使用产品:iMobile 9d 910 操作系统:win7 x64
数据类型: 文件型
问题详细描述:在recordset中找到对应地物点后修改,无法修改坐标,record.setGeometry()方法返回false.经查看是jni方法返回false
问题重现步骤:
- 获取RecordSet
- 通过seekId()方法找到需要修改的地物
- 创建新的GeoPoint,设置新的坐标
- 调用setGeometry()赋值
Recordset recordset = ((DatasetVector) mDatasoureces.get(0).getDatasets()
.get(Constant.POINT)).getRecordset(false, CursorType.DYNAMIC);
boolean isEdit = recordset.edit();
LogHelper.i("是否允许编辑:" + isEdit);
recordset.seekID(10);
GeoPoint lastpoint = (GeoPoint) recordset.getGeometry();
LogHelper.i("查询出来数据信息为:" + "B=" + lastpoint.getY() + "L=" + lastpoint.getX());
Random r = new Random();
float offset1 = r.nextFloat();
float offset2 = r.nextFloat();
boolean is1 = r.nextBoolean();
boolean is2 = r.nextBoolean();
offset1 = is1 ? +offset1 : -offset1;
offset2 = is2 ? +offset2 : -offset2;
GeoPoint newPoint = new GeoPoint(114 + offset1, 22 + offset2);
LogHelper.i("查询出来数据信息为:" + "B=" + newPoint.getY() + "L=" + newPoint.getX());
boolean isEditOk = recordset.setGeometry(newPoint);
LogHelper.i("是否编辑成功=" + isEditOk);
newPoint.dispose();
recordset.update();
recordset.close();
recordset.dispose();
mMapControl.getMap().refresh();
09-23 17:01:47.425 21723-21723/com.example.ljj.supermapdemo I/Map: 是否允许编辑:true
09-23 17:01:48.254 21723-21723/com.example.ljj.supermapdemo I/Map: 查询出来数据信息为:B=27.18508529663086L=121.03184509277344
09-23 17:01:57.690 21723-21723/com.example.ljj.supermapdemo I/Map: 查询出来数据信息为:B=21.52627944946289L=114.20540618896484
09-23 17:02:05.630 21723-21723/? I/Map: 是否编辑成功=false