Skip to content

Fix the exception when exporting a map to Shapefile - #2569

Open
Auriga2 wants to merge 1 commit into
masterfrom
bugfix/exporting_map_to_shapefile
Open

Fix the exception when exporting a map to Shapefile#2569
Auriga2 wants to merge 1 commit into
masterfrom
bugfix/exporting_map_to_shapefile

Conversation

@Auriga2

@Auriga2 Auriga2 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Prerequisites

  • Reviewed the checklist

  • Reviewed feedback from the "Sonar Cloud" bot. Note that you have to wait
    for the "CI / Unit Tests") to complete first. Failed Unit tests can be
    debugged by adding the label "verbose logging" to the GitHub PR.

Description of the Change

The unexpected exception when exporting a map to Shapefile, while containing any custom attribute with a space in the 10th character, is fixed now.

Alternate Designs

Why Should This Be In Core?

Bug Fix

Benefits

Handles unexpected exception

Possible Drawbacks

Verification Process

  1. Open a graph with map coordinates, or create a new graph with a node, and add below Spatial attributes to the node:
image
  1. Add any custom Boolean attribute, with a space at the 10th character E.g. "Is public place"
  2. Open Map View and Click Export From map view->Shapefile
  3. In the pop up dialog, select a file location, and keep default values for other fields, and click Export
  4. Verify no exception is thrown and files are generated as expected.

Applicable Issues

#2568

(cherry picked from commit 2a461cb4d407c4e8222729bdd953029ffed99100)
@sonarqubecloud

Copy link
Copy Markdown

writableFeature.setAttribute(compatibleAttributeName, attributeValue);
writableFeature.setAttribute(compatibleAttributeName.strip(), attributeValue);
} else if (schemaAttributes.containsKey(compatibleAttributeName) && attributeValue != null) {
writableFeature.setAttribute(compatibleAttributeName, attributeValue.toString());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this case also include a .strip()?

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.

2 participants