azgs / azlibrary_database

1 stars 1 forks source link

Geometry mis-match error when uploaded GeMS2 #62

Closed aazaff closed 6 months ago

aazaff commented 1 year ago

I encountered an error when uploading the gdb for https://library.azgs.arizona.edu/item/ADGM-1669142295432-313

Error: Warning 1: Geometry to be inserted is of type Multi Surface, whereas the layer geometry type is Multi Polygon.

Here is a stack overflow question that i think is relevant (https://gis.stackexchange.com/questions/259442/unable-to-upload-large-vector-file-to-postgis-errorgeometry-type-multisurface) and here is the JS that I think is relevant from our db scripts (https://github.com/azgs/azlibrary_database/blob/master/azlibAdd/gdb.js)

As a temporary measure I simply did not upload the gdb and just uploaded the gpkg and kmz.

NoisyFlowers commented 6 months ago

Before I dig into this, can you try to upload the gdb again? Or get it to me, so I can try.

We're using a newer version of ogr2ogr in the AL2 server. Just want to make sure this is still a problem.

aazaff commented 6 months ago

FlorenceJunction.gdb.zip

aazaff commented 6 months ago

Okay. We found a workflow in ESRI ArcGIS Pro to identify specific features with this problem and then correct them within Arc (detailed below). However, it is not as simple as a few clicks -- we have to then re-run all the other validations, update metadata, and then re-upload the updated gdb everywhere.

As far as I know for the moment this is a unique (or at least very rare) error that only affects Florence Junction gdb. So, for now, we will just leave things as they are and the GIS team will get to manually correcting the geodatabase when we have some breathing room. If we find that many other gdbs get this same error then we will re-asses.

Closing for now.

Workflow for identifying non-linear segments and correcting

Add global ID field to relevant tables

  1. Use Add Global ID (Data Management Tool)
  2. Input Datasets = [relevant table(s)]

Enable Editor Tracking:

  1. Use Enable Editor TrackingTool
  2. Input Dataset: [relevant table(s)]
  3. Creator Field: DataSourceID (or equivalent)
  4. Check Add Fields Box

Add Attribute Rule

  1. [Table] -> Data Design -> Attribute Rules -> Ready to Use Rules -> Nonlinear Segment -> Save

Use Evaluate Rules (Data Management Tools)

  1. Select Input Workspace (ENTIRE GEODATABASE)
  2. Evaluation Types: validation rules
  3. Extent: All

Fix the errors

  1. Open attribute table for relevant layer -> Select by attribute -> Where validation status = 1 - No Caluclation Required, No Validation Required, Has error(s)
  2. Edit -> Generalize -> Densify -> Generalize
NoisyFlowers commented 6 months ago

That's good to hear! Can you attach a corrected copy here, so I can try it out?

aazaff commented 6 months ago

We only corrected the table/layer MapUnitPolys as part of our testing, so you might get the same error but from other layers.

FlorenceJunctionnewtest.gdb.zip

NoisyFlowers commented 6 months ago

Works like a charm.