New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Geometry ShapeFiles #326

Closed
philipbaileynar opened this Issue Nov 5, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@philipbaileynar
Copy link
Contributor

philipbaileynar commented Nov 5, 2018

This issue is related to, but subtly different, to the separate issue of multi-part and multi-geometry ShapeFiles.

Null geometries occur when a ShapeFile (can be point, line or polygon) has a record in the attribute table but not corresponding geometry. In the example below note how the attribute table shows 3 records but there are only 2 polygons in the map. This isn't because there's another polygon off the screen. It's simply that there is no third polygon.

2018-11-05_111412

How to Create Null Geometries

  1. Create a new ShapeFile.
  2. Edit the ShapeFile.
  3. Open the Attribute Table. (In edit mode the attribute table will have a blank line visible at the bottom indicating the template for a new record).
  4. Click anywhere in the blank line at the bottom of the attribute table. This will add a new record to the attribute table.
  5. Fill in any attributes that you want.
  6. Click to Save Edits to the ShapeFile (without clicking anywhere on the map).

GCD And Null Geometries

I have tested the following GCD features with ShapeFiles containing null geometries and everything works fine:

  • Point Density - works fine... the code simply ignores the records with null geometries.
  • Masks - work fine
    • AOIs with null geometries simply exclude the record with null geometry. In the polygon mask attached (also represented by the screenshot above) the LiDAR record has no corresponding geometry. When a DoD is performed with this AOI there are valid DoD raster values for Total Station and GPS but nothing for LiDAR. This might not be what the user intended but its logical and does not crash.
    • Regular Masks - Just like AOIs, masks with null geoemtries work and simply don't produce any results for the records with null geometries.

Linear Extraction Bug

I add the attached line ShapeFile as a new transect profile route without issue. However, when I attempted to perform a linear extraction using it I got the following exception on line 172 of Linear Extractor:

An exception of type 'System.NullReferenceException' occurred in GCDConsoleLib.dll but was not handled in user code

The GCD project that generated this exception is also attached to this issue.

NullGeomLinearExt_GCDProject.zip

MultiPart_And_Null_Geometry.zip

@philipbaileynar philipbaileynar added the bug label Nov 5, 2018

MattReimer added a commit that referenced this issue Nov 5, 2018

@philipbaileynar

This comment has been minimized.

Copy link
Contributor

philipbaileynar commented Nov 6, 2018

Fixed as part of 7.4.0.

Masks were already working with null geometries. The only real fix required was to skip over null geometries when performing a linear extraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment