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

GeoAccessor.to_featureclass function converting all column names to lowercase when sanitize_columns parameter is True #1808

Open
BMannell opened this issue Apr 19, 2024 · 1 comment
Assignees
Labels

Comments

@BMannell
Copy link

Describe the bug
When using the GeoAccessor.to_featureclass to export a spatial dataframe to a shapefile, if you pass sanitize_columns as True it converts all the column names to lowercase.

The sanitize_columns param is True by default so this happens automatically.

To Reproduce
Steps to reproduce the behavior:

import arcgis

gis = arcgis.GIS()

ITEM_ID = "9df5e769bfe8412b8de36a2e618c7672"
OUTPUT_FOLDER = "/tmp"

df = arcgis.features.GeoAccessor.from_layer(arcgis.features.FeatureLayer.fromitem(gis.content.get(ITEM_ID)))
df.spatial.to_featureclass(location=OUTPUT_FOLDER + "/usa_major_cities", sanitize_columns=True)

Expected behavior
I expected the columns names to be sanitized of special characters, not converted to lowercase.

Platform (please complete the following information):

  • OS: Windows 10
  • Python API Version [e.g. 2.1.0.4

Additional context
Is this expected behaviour? If so please update the docs to specify this side effect. It would be better to have this parameter set to False by default, as it behaves now, the end shapefile has been altered in a way that the programmer may not have intended. (The GeoAccessor.to_featurelayer has it's sanitize_columns default set to False).

GeoAccessor.to_featureclass

Related issue: #923

@BMannell BMannell added the bug label Apr 19, 2024
@nanaeaubry
Copy link
Contributor

@ManushiM Can you advise on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants