Skip to content
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

Rewrite null values in SHP export to prevent them from being dropped #556

Merged
merged 1 commit into from Jan 25, 2021

Conversation

maurizi
Copy link
Contributor

@maurizi maurizi commented Jan 14, 2021

Fixes issue of the compactness field being dropped, which seems to have happened whenever the first district had a null value.

This manifested in compactness scores being dropped, but I think would be an issue for any nullable field.

Edit:
The initial approach didn't work out well, and was reworked in 1e3e091 to make the compactness field numeric-only and add a new contiguity field in the export.

Checklist

  • Description of PR is in an appropriate section of CHANGELOG.md and grouped with similar changes, if possible

Testing Instructions

  • Load up a map with no unassigned blocks
  • On develop the Shapefile export should not have a compactness column - on this branch it should

Closes #554

Copy link
Contributor

@kshepard kshepard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the field names have disappeared (they're just showing up as numbers). And also, I'm seeing the compactness column (field #6), but it's seemingly empty for districts that should have a compactness score. Like my district selected in this screenshot, which has a 36% compactness score on the frontend.

screenshot_13

@maurizi maurizi force-pushed the feature/mvm/fix-shp-export branch 3 times, most recently from 1e04ca5 to 67811cc Compare January 15, 2021 20:37
@maurizi maurizi requested a review from kshepard January 19, 2021 14:27
Copy link
Contributor

@kshepard kshepard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field names are showing up now, but I'm still not seeing any compactness values populated for contiguous districts that should have them, e.g.:

compactnes

The Shapefile format doesn't seem to like mixed data types, and so our
compactness column was being dropped when either the unassigned district
had a NULL value for compactness or when at least one district was
non-contiguous.

To accomodate this, I've introduced a generated "contiguity" column of
string type, and switched from using NULL to using 0 in cases of no data.
@maurizi maurizi merged commit 58ab84b into develop Jan 25, 2021
@maurizi maurizi deleted the feature/mvm/fix-shp-export branch January 25, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compactness Not Exported in SHP Export
2 participants