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

AAIGRID output: remove leading space on each line (fixes #8344) #8362

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

rouault
Copy link
Member

@rouault rouault commented Sep 7, 2023

but put one at end of line.

Esri spec shows an example without leading space:
https://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/esri-ascii-raster-format.htm .

Let's align on that

@jratike80
Copy link
Collaborator

jratike80 commented Sep 7, 2023

Did you take into account the space before each linefeed in the ESRI style files?

image

Linefeeds are not required in the specification but the whole data section can be just a single row with space separated values. I think that the idea is to remove all linefeeds and carriage returns and get such a string as a result.

@rouault
Copy link
Member Author

rouault commented Sep 7, 2023

Did you take into account the space before each linefeed in the ESRI style files?

no, hopefully that doesn't matter

@rouault
Copy link
Member Author

rouault commented Sep 7, 2023

Linefeeds are not required in the specification but the whole data section can be just a single row with space separated values. I think that the idea is to remove all linefeeds and carriage returns and get such a string as a result.

ah ok, missed that. Actually that helps making the code simpler (2 line shorter :-)). Doing that then

@jratike80
Copy link
Collaborator

Linefeeds are not required in the specification but the whole data section can be just a single row with space separated values. I think that the idea is to remove all linefeeds and carriage returns and get such a string as a result.

ah ok, missed that. Actually that helps making the code simpler (2 line shorter :-)). Doing that then

I believe that it is safer that way even it seems that ESRI is not so strict. I made a test by removing the ending space from an .asc file that was created by ArcGIS Pro, and it could still be opened with ArcGIS Pro.

@rouault rouault merged commit 391f705 into OSGeo:master Sep 13, 2023
30 checks passed
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.

None yet

2 participants