[GRASSLIST:5793] Re: GRASS Novice Needs Help

John Ronan jronan at tssg.org
Tue Feb 15 16:22:09 EST 2005


On 15 Feb 2005, at 20:52, Ian MacMillan wrote:

> John, I will try to explain my reasoning a little more clearly.  Now 
> then, I could be wrong, but hopefully if someone else sees that I am 
> leading you astray, they will chime in to this thread.
>
> 1)	OK, I was trying to say that it sounds like your reprojection with 
> r.proj is not going to work because your regions don't match in 
> between your two locations.  To reproject something from location 1 to 
> location 2, you need to have the region in location 2 contain the 
> coordinates of your raster from location 1.  For example, you are 
> trying to project a raster with bounding coord's of
> north:      52.3
> south:      52.15
> west:       -7.4
> east:       -6.85
>
> into a location with coord's of
>
> north:      54N
> south:      52N
> west:       9W
> east:       5W
>
> Normally this would work.  However your coord's from the first 
> location are not 52.3 degrees north to 52.15 degrees south, etc.  They 
> are 52.3 METERS north of the equator (or whatever the origin is for 
> Irish grid), and -7.4 METERS west of the central meridian.  Therefore 
> your region in your latlong location does not contain the
> coordinates of your raster from your irish grid location.  Following 
> along these lines, I think your raster is georeferenced incorrectly in 
> your Irish grid location.
>
Doh!

Sorry about that.
> Now then, if I understand what you are doing (taking a 
> non-georeferenced raster image, and converting it into a georeferenced 
> raster image such as a geotiff), here is the approach I would take.
>
> Make an XY location, and import your nongeoreferenced rasters.  Make a 
> new location with projection parameters that match your final desired 
> product.  Go to the XY location, and use i.group, i.target, i.points, 
> i.rectify.  Open up your second location, and export your rasters with 
> r.out.gdal.
>
Thats what I've done... and they seem to be fine.
> 2) It sounds like you are also having problems with the edges of your 
> rasters, and you would like to crop them, and or patch them together 
> to get rid of these blemishes.  If you use r.patch, make sure that the 
> first map listed in input= is the top map.  If you want to crop the 
> maps, just set your region to the raster with g.region rast=your_rast. 
>  Then run d.zoom, and zoom into the region that you want to be the new 
> 'cropped' raster.  Exit d.zoom, and run r.mapcalc 
> your_newrast=your_rast.  This will give you a cropped map based on the 
> extent of the region settings.
Ok this is the bit I'm having trouble with. I don't want to crop(yet), 
its just where they meet I'm getting rubbish appearing from the edge of 
one tile over the other as gdalwarp (I assume) doesn't have any data to 
work with to fill in the missing bits so I just get a white bit where 
the two tiles meet. This is what I'm trying to remove.  As both tiles 
seem to be going right to the edge of one another (when I zoom in it 
looks like GRASS hasn't interpolated and I can see 'through' one tile 
to the other)

If I can get it working with two tiles first, I'll progress from there
> Hope this helps

Yes it has indeed. I'll remember the cropping bit as I may need to do 
that in the future.

Regards
John

--
John Ronan <jronan at tssg dot org>, +353-51-302938
Telecommunications Software &  Systems Group,  http://www.tssg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3579 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20050215/510d8a42/attachment.bin


More information about the grass-user mailing list