I am trying to insert a polygon geometry in Oracle Spatial Database (Oracle). I am getting “Invalid Argument(s)” error with StackTrace "- FeatureUtils::FillFdoPropertyCollection line 568 file .\\AcMapFeatureUtils.cpp\n" string”
I have only three fields in Oracle. ID(integer), NAME (string) and GEOM (SDO_GEOMETRY). Spatial Index is defined of GEOM field.
Error is coming on execution of UpdateFeatures function.
MgLinearRing ring = geoFac.CreateLinearRing(coordCollection);
MgPolygon poly = geoFac.CreatePolygon(ring, null);
MgWktReaderWriter wktRW = new MgWktReaderWriter();
String wktStr = wktRW.Write(poly);
MgGeometry geom = wktRW.Read(wktStr);
MgPropertyCollection propcol = new MgPropertyCollection();
propcol.Add(new MgInt32Property("ID", 31));
propcol.Add(new MgStringProperty("NAME", "Polygon_31"));
propcol.Add(new MgGeometryProperty("GEOM", agfReadWrite.Write(geom1)));
MgFeatureCommandCollection commands = new MgFeatureCommandCollection();
MgInsertFeatures insertFeature = new MgInsertFeatures(className, propcol);
commands.Add(insertFeature);
//featureService.
featureService.UpdateFeatures(rsid, commands, true);
Have you ever looked into this blog post? It talks about SQL Server, but it applies to Oracle as well: