Different Geometrytype create by arcgis and aspose

test gdb.zip (31.5 KB)

hi I use ogrinfo see the different gdb create by arcgis and aspose ,one is create by arcmap , another is by aspose

ogrinfo D:\arcgis.gdb -al
INFO: Open of `D:\arcgis.gdb'
      using driver `OpenFileGDB' successful.

Layer name: linenozm
Geometry: Multi Line String
Feature Count: 1
Extent: (-0.000150, -0.000133) - (0.000231, 0.000414)
Layer SRS WKT:
GEOGCRS["WGS 84",
    ENSEMBLE["World Geodetic System 1984 ensemble",
        MEMBER["World Geodetic System 1984 (Transit)"],
        MEMBER["World Geodetic System 1984 (G730)"],
        MEMBER["World Geodetic System 1984 (G873)"],
        MEMBER["World Geodetic System 1984 (G1150)"],
        MEMBER["World Geodetic System 1984 (G1674)"],
        MEMBER["World Geodetic System 1984 (G1762)"],
        MEMBER["World Geodetic System 1984 (G2139)"],
        MEMBER["World Geodetic System 1984 (G2296)"],
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]],
        ENSEMBLEACCURACY[2.0]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    USAGE[
        SCOPE["Horizontal component of 3D system."],
        AREA["World."],
        BBOX[-90,-180,90,180]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
FID Column = OBJECTID
Geometry Column = SHAPE
SHAPE_Length: Real (0.0) DEFAULT FILEGEODATABASE_SHAPE_LENGTH
OGRFeature(linenozm):1
  SHAPE_Length (Real) = 0.00125127761710007
  MULTILINESTRING ((-0.000114214 0.00017846,0.000085661 0.000414026,0.000230808 -0.000128491,-0.000149906 -0.00013325))


D:\Program Files\QGIS 3.42.1\bin>ogrinfo D:\aspose.gdb -al
INFO: Open of `D:\aspose.gdb'
      using driver `OpenFileGDB' successful.

Layer name: line
Geometry: 3D Measured Multi Line String
Feature Count: 1
Extent: (-0.000150, -0.000133) - (0.000231, 0.000414)
Layer SRS WKT:
GEOGCRS["WGS 84",
    ENSEMBLE["World Geodetic System 1984 ensemble",
        MEMBER["World Geodetic System 1984 (Transit)"],
        MEMBER["World Geodetic System 1984 (G730)"],
        MEMBER["World Geodetic System 1984 (G873)"],
        MEMBER["World Geodetic System 1984 (G1150)"],
        MEMBER["World Geodetic System 1984 (G1674)"],
        MEMBER["World Geodetic System 1984 (G1762)"],
        MEMBER["World Geodetic System 1984 (G2139)"],
        MEMBER["World Geodetic System 1984 (G2296)"],
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]],
        ENSEMBLEACCURACY[2.0]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    USAGE[
        SCOPE["Horizontal component of 3D system."],
        AREA["World."],
        BBOX[-90,-180,90,180]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
FID Column = OBJECTID
Geometry Column = SHAPE
OGRFeature(line):1
  MULTILINESTRING ((-0.000114214 0.00017846,0.000085661 0.000414026,0.000230808 -0.000128491,-0.000149906 -0.00013325))
ogrinfo D:\arcgis.gdb -al
INFO: Open of `D:\arcgis.gdb'
      using driver `OpenFileGDB' successful.

Layer name: linenozm
Geometry: Multi Line String
Feature Count: 1
Extent: (-0.000150, -0.000133) - (0.000231, 0.000414)
Layer SRS WKT:
GEOGCRS["WGS 84",
    ENSEMBLE["World Geodetic System 1984 ensemble",
        MEMBER["World Geodetic System 1984 (Transit)"],
        MEMBER["World Geodetic System 1984 (G730)"],
        MEMBER["World Geodetic System 1984 (G873)"],
        MEMBER["World Geodetic System 1984 (G1150)"],
        MEMBER["World Geodetic System 1984 (G1674)"],
        MEMBER["World Geodetic System 1984 (G1762)"],
        MEMBER["World Geodetic System 1984 (G2139)"],
        MEMBER["World Geodetic System 1984 (G2296)"],
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]],
        ENSEMBLEACCURACY[2.0]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    USAGE[
        SCOPE["Horizontal component of 3D system."],
        AREA["World."],
        BBOX[-90,-180,90,180]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
FID Column = OBJECTID
Geometry Column = SHAPE
SHAPE_Length: Real (0.0) DEFAULT FILEGEODATABASE_SHAPE_LENGTH
OGRFeature(linenozm):1
  SHAPE_Length (Real) = 0.00125127761710007
  MULTILINESTRING ((-0.000114214 0.00017846,0.000085661 0.000414026,0.000230808 -0.000128491,-0.000149906 -0.00013325))

you can see the different between them, especial
aspose: Geometry: 3D Measured Multi Line String
arcmap: Geometry: Multi Line String
how can I create a layer by aspose like arcmapgeometry Multi Line String

Hi, @lsl

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

Thanks

Hi, @lsl

We reproduced your example above and made fix.
But you will need to use FileGdbOptions() { HasZ = false, HasM = false }, cos by default Drivers.FileGdb have ‘true’ value for Z and M.
It will be in next release.

hi I tested version 25.4, but it still doesn’t work. Did you say the next version is 25.5?

@Alexander.Matveev

another more question

    var opt = new FileGdbOptions
    {
        ExpectedGeometryType = GeometryType.MultiLineString,
    };

 using (var vectorLayer = dataset.CreateLayer("l1", opt, SpatialReferenceSystem.Wgs84))
 {
     var fea = vectorLayer.ConstructFeature();

     fea.Geometry = new Point(1, 1);

     vectorLayer.Add(fea);

 }

The above code will report an error because a point was inserted, but the expected geometry is a line,
However, when creating an emptry layer, its geometry type is unknown( arcgis and ogrinfo can see unknown ). You should create with ExpectedGeometryType

Hi, @lsl

We made fix in 25.4 version for creating new layer with HasZ, HasM options.
Did you use “new FileGdbOptions() { HasZ = false, HasM = false }”?

About “ExpectedGeometryType”:
Thanks for your note, we will create ticket for this.
Our current implementation set geometry type after first feature was added. In option “ExpectedGeometryType” we can set type for File GDB Schema, but it does not make influences to empty layer.

    var opt = new FileGdbOptions
    {
        HasM = false,
        HasZ = false,
    
    };
    using (var dataset = Drivers.FileGdb.CreateDataset("d:\\ss.gdb"))
    {


        using (var vectorLayer = dataset.CreateLayer("l1", opt, SpatialReferenceSystem.Wgs84))
        {
            var fea = vectorLayer.ConstructFeature();

            fea.Geometry = new Point(1, 1);

            vectorLayer.Add(fea);

        }
}

the layer still has ZM

Additionally, it is hoped that the geome type can be specified when creating an empty layer, otherwise a record must be inserted first and then deleted, which does not meet to human intuition(To my knowledge, you cannot create an unknown layer using industry GIS tools) If make any modifications, remember to synchronize the shapefile format

Hi, @lsl

Unfortunately i can not reproduce.
When i use ‘ogrinfo path -al’ for your example, i get ‘Geometry: Point’ instead of ‘3D Measured Point’

Layer name: l1
Geometry: Point
Feature Count: 1
Extent: (1.000000, 1.000000) - (1.000000, 1.000000)
Layer SRS WKT:
GEOGCRS[“WGS 84”,
ENSEMBLE[“World Geodetic System 1984 ensemble”,
MEMBER[“World Geodetic System 1984 (Transit)”],
MEMBER[“World Geodetic System 1984 (G730)”],
MEMBER[“World Geodetic System 1984 (G873)”],
MEMBER[“World Geodetic System 1984 (G1150)”],
MEMBER[“World Geodetic System 1984 (G1674)”],
MEMBER[“World Geodetic System 1984 (G1762)”],
MEMBER[“World Geodetic System 1984 (G2139)”],
ELLIPSOID[“WGS 84”,6378137,298.257223563,
LENGTHUNIT[“metre”,1]],
ENSEMBLEACCURACY[2.0]],
PRIMEM[“Greenwich”,0,
ANGLEUNIT[“degree”,0.0174532925199433]],
CS[ellipsoidal,2],
AXIS[“geodetic latitude (Lat)”,north,
ORDER[1],
ANGLEUNIT[“degree”,0.0174532925199433]],
AXIS[“geodetic longitude (Lon)”,east,
ORDER[2],
ANGLEUNIT[“degree”,0.0174532925199433]],
USAGE[
SCOPE[“Horizontal component of 3D system.”],
AREA[“World.”],
BBOX[-90,-180,90,180]],
ID[“EPSG”,4326]]
Data axis to CRS axis mapping: 2,1
FID Column = OBJECTID
Geometry Column = SHAPE
OGRFeature(l1):1
POINT (1 1)

void test_gis()
{
    var opt = new FileGdbOptions
    {
        HasM = false,
        HasZ = false,
    
    };
    using (var dataset = Drivers.FileGdb.CreateDataset("d:\\q.gdb"))
    {


        using (var vectorLayer = dataset.CreateLayer("l1", opt, SpatialReferenceSystem.Wgs84))
        {
            var fea = vectorLayer.ConstructFeature();

            fea.Geometry = new Point(1, 1);

            vectorLayer.Add(fea);

        }


        opt.ExpectedGeometryType = GeometryType.Point;
        using (var vectorLayer = dataset.CreateLayer("l2", opt, SpatialReferenceSystem.Wgs84))
        {
            
        }

    }

   
}

yes, ogrinfo show Geometry: Point
but when I open it in arcmap, it still 3 question:

  1. l1 still have ZM

  2. when I rename the layer l1 created by aspose.gis in arcmap, it show exception : rename error, geometry no Z value

  3. layer l2 with Geometry: Unknown (any) can not rename, delete, edit in arcmap

Thanks for your notes!
Looks like It is not small quick fix and need to rework our driver for collaboration with arcmap.
We created a ticket GISNET-1827.
We will notify you here as we will have progress with it.