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
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.
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.
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 ,
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 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 ?