Re: image cut by a shapefile [message #56186] |
Tue, 16 October 2007 18:10  |
krastoboy
Messages: 8 Registered: October 2007
|
Junior Member |
|
|
Thanks Jean.
I've tried and it works...but I've got a problem with the new images i
made: they seem to be negative (check: www.gurumeditation.it/smallimage.tiff).
The problems is reading the tiff: to check this idea I wrote two lines
Result = READ_TIFF( 'D:\RSI\IDL56\WORKING\image.tif',
GEOTIFF=variable)
tv, result
and it gives me the same error.
There's something wrong that i don't understand?
Before I opened the geotiff with envi_open_data_file, got it in a
variabile with ENVI_GET_DATA and wrote it with write_tiff using the
geotiff keyword.
lo
|
|
|
Re: image cut by a shapefile [message #56189 is a reply to message #56186] |
Tue, 16 October 2007 09:42   |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
krastoboy@gmail.com wrote:
> Dear all,
> I'm a novice in IDL, not sure if my questions are totally improper.
> 1_I got a shape file made by some points.
> 2_I would like to cut an image (geotiff) in smoller (ex: 1000X1000
> pixeles) parts.
> 3_Each point of the shape file should be the center the new images.
>
> I don't know how figure it out.
> Consider that I wuold like to find an automatic way: I have to work on
> a set of different geotiff images, each one related to a different
> shape file.
>
> Thank you in advance,
> Lorenzo
This week favorite function is undoubtly envi_convert_file_coordinates,
if you have access to Envi!
1)open your shape file
2)get the coordinates (let's say, lat-long) of each point in an array
3)open your image to gets its FID
4)call envi_convert_file_coordinates, fid, X,Y, lat,long (with NO
keyword), which will change your lat-long to the corresponding pixel
row and column on your image
5) subset your image smallImage = image[X-1000:X+1000; Y-1000:Y+1000]
Jean
|
|
|
Re: image cut by a shapefile [message #56377 is a reply to message #56186] |
Wed, 17 October 2007 09:22  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
krastoboy@gmail.com wrote:
> Thanks Jean.
> I've tried and it works...but I've got a problem with the new images i
> made: they seem to be negative (check: www.gurumeditation.it/smallimage.tiff).
> The problems is reading the tiff: to check this idea I wrote two lines
>
> Result = READ_TIFF( 'D:\RSI\IDL56\WORKING\image.tif',
> GEOTIFF=variable)
> tv, result
>
> and it gives me the same error.
> There's something wrong that i don't understand?
>
> Before I opened the geotiff with envi_open_data_file, got it in a
> variabile with ENVI_GET_DATA and wrote it with write_tiff using the
> geotiff keyword.
>
> lo
I am not sure of what your image **should** look like... it is a byte
one... Are you sure you are writing it properly (good data type, color
lookup table etc)?
Jean
|
|
|