Opened 13 years ago

Closed 13 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 13 years ago.
Added pixel height and width getter functions.
widthheight.patch (2.4 KB ) - added by dzwarg 13 years ago.
Added sql functions, pixel size regression tests.

Download all attachments as: .zip

Change History (12)

comment:1 by dzwarg, 13 years ago

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

comment:2 by dzwarg, 13 years ago

Status: newassigned

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

by dzwarg, 13 years ago

Attachment: pix_hw.patch added

Added pixel height and width getter functions.

comment:3 by Bborie Park, 13 years ago

Committed in r7763 using combined patch in #482.

comment:4 by Bborie Park, 13 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by Bborie Park, 13 years ago

Keywords: history added
Milestone: PostGIS Raster FuturePostGIS 2.0.0

comment:6 by dzwarg, 13 years ago

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.

by dzwarg, 13 years ago

Attachment: widthheight.patch added

Added sql functions, pixel size regression tests.

comment:7 by Bborie Park, 13 years ago

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

comment:8 by dzwarg, 13 years ago

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 by Bborie Park, 13 years ago

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

comment:10 by Bborie Park, 13 years ago

Resolution: fixed
Status: reopenedclosed

I've committed the widthheight.patch in r7779.

Note: See TracTickets for help on using tickets.