Skip to main content
+gdal tag
Link
Naxos
  • 11
  • 3
Changed wording of question for clarity (hopefully). Added vertex example
Source Link
Naxos
  • 11
  • 3

I understand the last paragraph in the quote above. However, my confusion begins when trying to understand the positiongeo-referenced location of the dataa pixels value inwithin the cellpixel itself (height in my case) and the interaction of PixelIsPoint vs PixelIsArea.

By the GDAL documentation, the top-left corner of RasterData[0][0] has a geo-referenced position of (0

  • the top-left corner of RasterData[0][0] has a geo-referenced position of (0.0, 0,0)
  • the bottom-right corner of RasterData[3][3] has a geo-referenced position of (4.0, 4.0)
  • the center of RasterData[0][0] has a geo-referenced position of (0.5, 0.5)

This part I believe I understand well enough.0, 0

However,0) and I do not understand how to determine the bottom-right corner of RasterData[3][3] has a geo(geo-referenced position) location of a pixels data (4.0, 4.0).

First question:
Doeswithin the interpretation ofpixel itself, nor do I understand whether PixelIsPoint / PixelIsArea affect this interpretationaffects the location of the corner positionpixel corners, or the location of a pixels data within the raster? And if sopixel itself.

For example, in what manner? IEI'm not entirely certain whether this is the correct way to create a vertex from this dataset: Could

// loop pixel_y 0 -> height (integer)
// loop pixel_x 0 -> width  (integer)
vertex.x = GeoTransform[0] + GeoTransform[1] * pixel_x + GeoTransform[2] * pixel_y;
vertex.y = GeoTransform[3] + GeoTransform[4] * pixel_x + GeoTransform[5] * pixel_y;
vertex.z = RasterData[y][x];

The method above assumes the value of RasterData[y][x] is geo-referenced at the top-left corner point of RasterData[0][0] possibly bethe pixel (-0.5,-0.5) or (0.5, 0 this is where my doubt begins.5)?

SecondSo my question is:
Given that RasterData[0][0] == 1.0f and we interpret that as a height value, does that value correspond most appropriately toHow do I determine the topcorrect geo-left cornerreferenced position of thea given pixel, or to the center of value RasterData[y][x] when interpreting the pixeldata under PixelIsPoint versus PixelIsArea? 

IE: would a vertex generated fromI want to take RasterData[0][0]RasterData[y][x] would be most appropriate atand (0.0, 0.0, 1.0) orGeoTransform and generate (0.5X, 0.5Y, 1.0Z)? How does the interpretation of PixelIsPoint / PixelIsArea affect this? vertex positions where:

  • The X coordinate is the appropriate geo-referenced position for RasterData[y][x]
  • The Y coordinate is the appropriate geo-referenced position for RasterData[y][x]
  • The Z coordinate is the height value contained in RasterData[y][x]

I understand the last paragraph in the quote above. However, my confusion begins when trying to understand the position of the data value in the cell (height in my case) and the interaction of PixelIsPoint vs PixelIsArea.

By the GDAL documentation, the top-left corner of RasterData[0][0] has a geo-referenced position of (0.0, 0,0) and the bottom-right corner of RasterData[3][3] has a geo-referenced position of (4.0, 4.0).

First question:
Does the interpretation of PixelIsPoint / PixelIsArea affect this interpretation of the corner position of the raster? And if so, in what manner? IE: Could the top-left corner of RasterData[0][0] possibly be (-0.5,-0.5) or (0.5, 0.5)?

Second question:
Given that RasterData[0][0] == 1.0f and we interpret that as a height value, does that value correspond most appropriately to the top-left corner position of the pixel, or to the center of the pixel? IE: would a vertex generated from RasterData[0][0] would be most appropriate at (0.0, 0.0, 1.0) or (0.5, 0.5, 1.0)? How does the interpretation of PixelIsPoint / PixelIsArea affect this?

I understand the last paragraph in the quote above. However, my confusion begins when trying to understand the geo-referenced location of a pixels value within the pixel itself (height in my case) and the interaction of PixelIsPoint vs PixelIsArea.

By the GDAL documentation,

  • the top-left corner of RasterData[0][0] has a geo-referenced position of (0.0, 0,0)
  • the bottom-right corner of RasterData[3][3] has a geo-referenced position of (4.0, 4.0)
  • the center of RasterData[0][0] has a geo-referenced position of (0.5, 0.5)

This part I believe I understand well enough.

However, I do not understand how to determine the (geo-referenced) location of a pixels data within the pixel itself, nor do I understand whether PixelIsPoint / PixelIsArea affects the location of the pixel corners, or the location of a pixels data within the pixel itself.

For example, I'm not entirely certain whether this is the correct way to create a vertex from this dataset:

// loop pixel_y 0 -> height (integer)
// loop pixel_x 0 -> width  (integer)
vertex.x = GeoTransform[0] + GeoTransform[1] * pixel_x + GeoTransform[2] * pixel_y;
vertex.y = GeoTransform[3] + GeoTransform[4] * pixel_x + GeoTransform[5] * pixel_y;
vertex.z = RasterData[y][x];

The method above assumes the value of RasterData[y][x] is geo-referenced at the top-left corner point of the pixel -- this is where my doubt begins.

So my question is:
How do I determine the correct geo-referenced position of a given pixel value RasterData[y][x] when interpreting the data under PixelIsPoint versus PixelIsArea? 

IE: I want to take RasterData[y][x] and GeoTransform and generate (X,Y,Z) vertex positions where:

  • The X coordinate is the appropriate geo-referenced position for RasterData[y][x]
  • The Y coordinate is the appropriate geo-referenced position for RasterData[y][x]
  • The Z coordinate is the height value contained in RasterData[y][x]
Rollback to Revision 1
Source Link
Naxos
  • 11
  • 3

So myFirst question is:
Does the interpretation of PixelIsPoint / PixelIsArea affect this interpretation of the corner position of the raster? And if so, in what manner? IE: Could the top-left corner of RasterData[0][0] possibly be (-0.5,-0.5) or (0.5, 0.5)?

GivenSecond question:
Given that RasterData[0][0] == 1.0f and we interpret that as a height value, does that value correspond most appropriately to the top-left corner position of the pixel, or to the center of the pixel? IE: would a vertex generated from RasterData[0][0] would be most appropriate at (0.0, 0.0, 1.0) or (0.5, 0.5, 1.0)? How does the interpretation of PixelIsPoint / PixelIsArea affect this?

So my question is:
Does the interpretation of PixelIsPoint / PixelIsArea affect this interpretation of the corner position of the raster? And if so, in what manner? IE: Could the top-left corner of RasterData[0][0] possibly be (-0.5,-0.5) or (0.5, 0.5)?

Given that RasterData[0][0] == 1.0f and we interpret that as a height value, does that value correspond most appropriately to the top-left corner position of the pixel, or to the center of the pixel? IE: would a vertex generated from RasterData[0][0] would be most appropriate at (0.0, 0.0, 1.0) or (0.5, 0.5, 1.0)? How does the interpretation of PixelIsPoint / PixelIsArea affect this?

First question:
Does the interpretation of PixelIsPoint / PixelIsArea affect this interpretation of the corner position of the raster? And if so, in what manner? IE: Could the top-left corner of RasterData[0][0] possibly be (-0.5,-0.5) or (0.5, 0.5)?

Second question:
Given that RasterData[0][0] == 1.0f and we interpret that as a height value, does that value correspond most appropriately to the top-left corner position of the pixel, or to the center of the pixel? IE: would a vertex generated from RasterData[0][0] would be most appropriate at (0.0, 0.0, 1.0) or (0.5, 0.5, 1.0)? How does the interpretation of PixelIsPoint / PixelIsArea affect this?

deleted 21 characters in body
Source Link
Naxos
  • 11
  • 3
Loading
Source Link
Naxos
  • 11
  • 3
Loading