Opened 5 weeks ago

Last modified 5 weeks ago

#31766 assigned Cleanup/optimization

Avoid unneccessary computation in GDALRaster.transform().

Reported by: Riccardo Owned by: Srinivas Reddy Thatiparthy
Component: GIS Version: master
Severity: Normal Keywords: GDALRaster; GIS
Cc: Hasan Ramezani, Daniel Wiesmann Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes 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 (5)

comment:1 Changed 5 weeks ago by felixxm

Summary: GDALRaster: return self on transformationAvoid unneccessary computation in GDALRaster.transform().
Triage Stage: UnreviewedAccepted

Thanks, IMO it's expected to return self.clone() is such cases.

comment:2 Changed 5 weeks ago by Hasan Ramezani

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 Changed 5 weeks ago by Hasan Ramezani

Cc: Hasan Ramezani added

comment:4 in reply to:  2 Changed 5 weeks ago by felixxm

Cc: Daniel Wiesmann added

Does it need to implement def clone for GDALRaster?

Yes.

If so, should we use copy_ds from django.contrib.gis.gdal.prototypes to copy the ds_input and create a new GDALRaster object?

Probably, I'm not an expert.

comment:5 Changed 5 weeks ago by Srinivas Reddy Thatiparthy

Owner: changed from nobody to Srinivas Reddy Thatiparthy
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top