我正尝试在geopackage-ios上插入Parks功能,如下所示:
let featureName: String = featureTables.object(at: featureTables.index(of: "Parks")) as! String;
let featureTable: GPKGFeatureDao = geoPackage.getFeatureDao(withTableName: featureName);
let featureRow: GPKGFeatureRow = featureTable.newRow();
let geomData: GPKGGeometryData = GPKGGeometryData(srsId: 4326);
let polygon: SFPolygon = SFPolygon(hasZ: false, andHasM: false);
let myLineString: SFLineString = getLineString(points: [[-90,38],[-90.001,38.001],[-90.002,38],[-90,38]]);
polygon.addRing(myLineString);
geomData.geometry = polygon;
featureRow.setGeometry(geomData);
featureRow.setValueWithColumnName("name", andValue: "test" as NSObject);
let tes: Int64 = featureTable.insert(featureRow);
print(tes);
没有错误,但是在gpkg文件上也没有插入任何内容。如何在geopackage-ios上插入要素的正确方法?预先谢谢你。