Opened 4 years ago
Closed 4 years ago
#31766 closed Cleanup/optimization (fixed)
Avoid unneccessary computation in GDALRaster.transform().
Reported by: | Riccardo | Owned by: | Barton Ip |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | GDALRaster; GIS |
Cc: | Hasan Ramezani, Daniel Wiesmann | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently the method GDALRaster.transform proceeds with the computation even if the passed SRID is the same as the GDALRaster itself is in. I would propose to just return self if a transformation like the following is requested.
>> raster.srid 4326 >> raster.transform(4326)
This avoids unnecessary computation.
Change History (11)
comment:1 by , 4 years ago
Summary: | GDALRaster: return self on transformation → Avoid unneccessary computation in GDALRaster.transform(). |
---|---|
Triage Stage: | Unreviewed → Accepted |
follow-up: 4 comment:2 by , 4 years ago
Does it need to implement def clone
for GDALRaster
? If so, should we use copy_ds
from django.contrib.gis.gdal.prototypes
to copy the ds_input
and create a new GDALRaster
object?
comment:3 by , 4 years ago
Cc: | added |
---|
comment:4 by , 4 years ago
Cc: | added |
---|
Does it need to implement
def clone
forGDALRaster
?
Yes.
If so, should we use
copy_ds
fromdjango.contrib.gis.gdal.prototypes
to copy theds_input
and create a newGDALRaster
object?
Probably, I'm not an expert.
comment:9 by , 4 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:10 by , 4 years ago
Has patch: | set |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Patch submitted: https://github.com/django/django/pull/13365
comment:11 by , 4 years ago
Triage Stage: | Ready for checkin → Accepted |
---|
The PR should be first reviewed by reviewers and then they will change it to Ready for checkin Stage.
comment:12 by , 4 years ago
Patch needs improvement: | set |
---|
comment:13 by , 4 years ago
Patch needs improvement: | unset |
---|
comment:14 by , 4 years ago
Easy pickings: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Thanks, IMO it's expected to return
self.clone()
is such cases.