Opened 10 years ago

Closed 9 years ago

#928 closed enhancement (fixed)

[raster] Implement ST_PixelWidth

Reported by: dzwarg Owned by: dzwarg
Priority: medium Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: history Cc:

Description

Create a getter that computes the the true pixel width: sqrt(A2 + D2).

Where A and D are the components of the georeference parameters.

Attachments (2)

pix_hw.patch (8.3 KB) - added by dzwarg 9 years ago.
Added pixel height and width getter functions.
widthheight.patch (2.4 KB) - added by dzwarg 9 years ago.
Added sql functions, pixel size regression tests.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by dzwarg

Create a getter that computes the the true pixel width: sqrt(A2 + D2).

comment:2 Changed 9 years ago by dzwarg

Status: newassigned

See the attached patch for an implementation of ST_PixelWidth; it includes changes for ticket #929 as well (ST_PixelHeight).

Changed 9 years ago by dzwarg

Attachment: pix_hw.patch added

Added pixel height and width getter functions.

comment:3 Changed 9 years ago by Bborie Park

Committed in r7763 using combined patch in #482.

comment:4 Changed 9 years ago by Bborie Park

Resolution: fixed
Status: assignedclosed

comment:5 Changed 9 years ago by Bborie Park

Keywords: history added
Milestone: PostGIS Raster FuturePostGIS 2.0.0

comment:6 Changed 9 years ago by dzwarg

Resolution: fixed
Status: closedreopened

Some of the pixelsize accessors and regression tests didn't make it into the patch attached to #482 in r7763.

Attaching accessors and regression tests.

Changed 9 years ago by dzwarg

Attachment: widthheight.patch added

Added sql functions, pixel size regression tests.

comment:7 Changed 9 years ago by Bborie Park

David, Could you update the widthheight.path to contain the rt_pixelsize_expected file.

comment:8 Changed 9 years ago by dzwarg

That's strange, when you open it in a text editor, it's there on line 42 & 43. It's not visible in the trac viewer. It's a file with no content, I expect nothing back from the test.

My test calculates the pixel size manually, and compares it to st_pixelwidth(rast), returning the rows that do not match. Should I invert the test, so that rt_pixelsize_expected has content?

comment:9 Changed 9 years ago by Bborie Park

Oops. It looks like my patch utility skips creating empty files. I just added an empty rt_pixelsize_expected file manually.

comment:10 Changed 9 years ago by Bborie Park

Resolution: fixed
Status: reopenedclosed

I've committed the widthheight.patch in r7779.

Note: See TracTickets for help on using tickets.