Re: Using "tie points" in rasters [message #93202 is a reply to message #93199] |
Wed, 11 May 2016 20:21   |
jiashenyue
Messages: 10 Registered: January 2013
|
Junior Member |
|
|
On Wednesday, May 11, 2016 at 2:35:04 PM UTC-7, GB wrote:
> Hello,
>
> I am working with a digital elevation map raster and ran into a problem that I am unsure how to approach.
>
> Once I get the spatial reference object of my DEM raster, I then get the tie_point_pixel, the tie_point_map, and pixel_size from the spatialref. I then seek to transform the map coordinates of a set of LiDAR points into the pixel indices of my raster. The thing I am confused about is how rounding plays into this problem.
>
> For instance, lets say that I use the following function to convert the x-coordinate of my lidar point into pixel coordinates:
> (lidar_point_x-tie_point_map[0])/pixel_size[0]
> But, I get a decimal place in the outcome. Lets say that the decimal point is 0.64. Would this decimal point translate into the point belonging to index 0 or to index 1?
>
> I suppose I am confused about if the tie_point_map is centered on the tie_point_pixel such that it extends a range of -0.5*pixel_size to 0.5*pixel_size. If anyone could elaborate on this I would be very thankful.
Usually I just round the decimal points to the closest pixel. If I got a index of 1.64, I go for 2. I would say this is quite fair, since in this case, the pixel you are trying to locate is closer to the next pixel.
Shenyue
|
|
|