How set layer config when create in GDB

image.png (9.5 KB)
when create layer in arcmap we can set above config

but Dataset.Create no this config , After my testing, it will make changes based on the geometry of your first feature and Even if you set HasM=false and HasZ=false for the first feature , the final data still shows ZM in the arcmap

When creating shapefiles with arcmap, there are also these settings. It would be even better if they could also be supported
we use arcmap 10.2 aspose.gis 24.7

Hi, @lsl

I need to explore your request. I’ll be back with an answer in a couple of days.

Hi, @lsl

Instead of config we have FileGdbOptions. We can create instance of options, make adjustment and use it when create new layer.

            var options = new FileGdbOptions
            {
                // name object ID field 'OID' rather than the default 'OBJECTID'.
                ObjectIdFieldName = "OID",

                // name geometry field 'POINT' rather than the default 'SHAPE'.
                GeometryFieldName = "POINT",
            };

            using (var layer = dataset.CreateLayer("layer_name", options))
            {
                var feature = layer.ConstructFeature();
                feature.Geometry = new Point(12.32, 34.21);
                layer.Add(feature);
            }

For GDB file when we add first feature with geometry we set layer.GeometryType depend on that geometry. We do not support different types of geometries into same layer GDB.

Please check out FileGdbOptions and ShapefileOptions and let me know if you need something.

2.gdb.zip (11.4 KB)
this gdb contain 2 layers,

using (var dataset = Dataset.Create(path, Drivers.FileGdb))
{
    using (var vectorLayer = dataset.CreateLayer("layer1"))
    {
        var feature = vectorLayer.ConstructFeature();
        var p = new Point(12.32, 34.21);
        p.HasM = false;
        p.HasZ = false;
        feature.Geometry = p;
        vectorLayer.Add(feature);
    }
}

layer1 create by aspose.gis ,
layer2 create by arcgis which is my need,
you can see the difference in arcmap , layer1 has ZM prop , layer2 no ZM prop,
can you help me how create emptry layer2 use aspose.gis

@lsl
We need to investigate the issue. Then we will text you back.
To avoid losing of this issue we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): GISNET-1687

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi, @lsl

In your example above layer1 has one feature with geometry and layer2 has no features!
So, you can try this code “using (var vectorLayer = dataset.CreateLayer(“layer1”)){}” to create empty layer.
Also i check if we try to get ZM property with HasZ = false (HasM = false) then we get InvalidOperationException. Maybe arcgis shown default value which is zero. What ZM value did you see?

you must insert one feature, other wise defalut geometry type will be point with ZM, but I need no ZM layer

Also i check if we try to get ZM property with HasZ = false (HasM = false) then we get InvalidOperationException. Maybe arcgis shown default value which is zero. What ZM value did you see?
when I try to get ZM property with HasZ = false (HasM = false) then I get NaN ,

layer1 display in arcmap:
image.png (5.4 KB)
image.png (13.2 KB)

layer2 display in arcmap:
image.png (4.5 KB)
image.png (13.4 KB)

you can see the differenct
in arcgis ,when (point as IZAware).ZAware = false , Prove that there is no Z at this point
point has Z,M prop, will return NaN when call point.Z

We made fix for this! Please check out last realease

    var path = @"d:\2.gdb";
    using (var dataset = Dataset.Create(path, Drivers.FileGdb))
    {
        using (var vectorLayer = dataset.CreateLayer("layer1"))
        {
            var feature = vectorLayer.ConstructFeature();
            var p = new Point(12.32, 34.21);
            p.HasM = false;
            p.HasZ = false;
            feature.Geometry = p;
            vectorLayer.Add(feature);
        }

        using (var vectorLayer = dataset.CreateLayer("layer2"))
        {
             
        }
    }

image.png (2.2 KB)
<PackageReference Include="Aspose.GIS" Version="24.8.0" />
I use above version, it seem can not work as except

Hi, @lsl

We will back to the ticket GISNET-1687. It is not clear in the screen above.
am i understand right, expected behavior is if we set HasM=false and HasZ=false the data shows ZM in the arcmap ?

image.png (4.5 KB)
image.png (13.4 KB)

if we set HasM=false and HasZ=false the data shows ZM in the arcmap should like above

@lsl thanks for your patience!

We will explore more deeper how to write point.
Is “using (var vectorLayer = dataset.CreateLayer(“layer2”)) {}” works fine now?

the layer created by the above code displayed in the arcmap as icon ? , no error message show, but clicking to view layer properties does not respond

Yes, because the layer is empty, has no feature at all