q1:
var path = "d:\\11112.gdb";
using (var dataset = Dataset.Create(path, Drivers.FileGdb))
{
using (var vectorLayer = dataset.CreateLayer("11"))
{
}
}
above code will get exception
Name of the FileGDB layer must start with Latin letter or underscore. Arg_ParamName_Name
so when we open GDB in arcmap, there should be an empty GDB, but when we open it , arcmap show
failed to connect to database
q2:
var path = "d:\\11114.gdb";
using (var dataset = Dataset.Create(path, Drivers.FileGdb))
{
using (var vectorLayer = dataset.CreateLayer("L22"))
{
{
var constructFeature = vectorLayer.ConstructFeature();
constructFeature.Geometry = new LineString(new[] { new Point(1, 1), new Point(2, 2) })
{
HasM = false,
HasZ = false
};
vectorLayer.Add(constructFeature);
}
{
var constructFeature = vectorLayer.ConstructFeature();
constructFeature.Geometry = new Point(1, 1) ;
vectorLayer.Add(constructFeature);
}
}
}
above get exception {"FileGDB does not allow geometries of different types into same layer."}
the GDB also can not open by Arcmap with error
failed to connect to database
The correct one here should be that there is a layer called L22
with one feature inside