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

Fix ASCII header tests #166

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions test/gdal_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ options = GDAL.gdaltranslateoptionsnew(optvec, C_NULL)
ds_tiny_asc = GDAL.gdaltranslate("data/utmtiny.asc", ds_small, options, C_NULL)
GDAL.gdaltranslateoptionsfree(options)
GDAL.gdalclose(ds_tiny_asc)
@test replace(read("data/utmtiny.asc", String), "\r" => "") == """
@test replace(replace(read("data/utmtiny.asc", String), "\r" => ""), " \n" => "\n") == """
ncols 5
nrows 5
xllcorner 440720.000000000000
yllcorner 3745320.000000000000
cellsize 1200.000000000000
128 126 161 185 193
171 164 175 206 205
127 148 177 205 209
93 114 164 172 181
83 101 140 128 122
128 126 161 185 193
171 164 175 206 205
127 148 177 205 209
93 114 164 172 181
83 101 140 128 122
"""
# also create a Byte GeoTIFF version for later use
optvec = ["-r", "cubic", "-tr", "1200", "1200", "-ot", "Byte"]
Expand Down Expand Up @@ -79,18 +79,18 @@ ds_dempr = GDAL.gdaldemprocessing(
)
GDAL.gdaldemprocessingoptionsfree(options)
GDAL.gdalclose(ds_dempr)
@test replace(read("data/utmtiny-hillshade.asc", String), "\r" => "") == """
@test replace(replace(read("data/utmtiny-hillshade.asc", String), "\r" => ""), " \n" => "\n") == """
ncols 5
nrows 5
xllcorner 440720.000000000000
yllcorner 3745320.000000000000
cellsize 1200.000000000000
NODATA_value 0
0 0 0 0 0
0 183 184 183 0
0 180 182 181 0
0 181 181 177 0
0 0 0 0 0
0 0 0 0 0
0 183 184 183 0
0 180 182 181 0
0 181 181 177 0
0 0 0 0 0
"""
rm("data/utmtiny-hillshade.asc")
rm("data/utmtiny-hillshade.prj")
Expand Down
Loading