Skip to content

gdalwarp: allow specifying units of warp memory#10976

Merged
rouault merged 2 commits into
OSGeo:masterfrom
dbaston:warp-wm-units
Oct 10, 2024
Merged

gdalwarp: allow specifying units of warp memory#10976
rouault merged 2 commits into
OSGeo:masterfrom
dbaston:warp-wm-units

Conversation

@dbaston
Copy link
Copy Markdown
Member

@dbaston dbaston commented Oct 9, 2024

What does this PR do?

Validates the -wm argument to gdalwarp so that invalid values cause a failure. Also allows more clear specification of memory amount with units (-wm 1G, -wm 200MB), or as a fraction of usable memory (-wm 10%). Probably overkill for this purpose but I think there are other places the same function could be used, such as the parsing of GDAL_CACHEMAX.

What are related issues/pull requests?

#10888, #10889

Tasklist

  • Add test case(s)
  • Add documentation
  • Updated Python API documentation (swig/include/python/docs/)
  • Review
  • Adjust for comments
  • All CI builds and checks have passed

Copy link
Copy Markdown
Member

@rouault rouault left a comment

Choose a reason for hiding this comment

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

Great addition

Comment thread port/cpl_string.cpp Outdated
Comment thread port/cpl_string.cpp
Comment thread port/cpl_string.h Outdated
Comment thread port/cpl_string.cpp Outdated
@rouault
Copy link
Copy Markdown
Member

rouault commented Oct 9, 2024

CI failure on gdrivers/gti.py::test_gti_stac_geoparquet is unrelated and solved in latest master HEAD

@jratike80
Copy link
Copy Markdown
Collaborator

Maybe it is worth documenting the valid units and usage for users. The units seem to be k, m, g or kb, mb, gb. All combinations of upper and lower case are accepted, and the unit can follow the numeric value with or without space. Is that right?

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 69.442% (+0.006%) from 69.436%
when pulling df4042c on dbaston:warp-wm-units
into 4e28921 on OSGeo:master.

@rouault rouault added this to the 3.10.0 milestone Oct 10, 2024
@rouault rouault merged commit d86e0cb into OSGeo:master Oct 10, 2024
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.

4 participants