[GRASS-user] ogr2ogr and ortho/rgb display

Hi Daniel,

On Friday 05 January 2007 16:10, Daniel Farnan wrote:

I am struggling with two things Dylan, in GRASS, and QGIS, seperately, with
slightly different issues.
the data is USGS download
In GRASS
1)I would like to re-project LatLong NAD 83 vector to UTM NAD 83 to work
with a layer with Ortho images in a GRASS region.

I tend to do work like this in a 3-step process:

1. project my vector/raster data into a common projection
2. import the projected data into GRASS
3. the fun begins...

For some examples of using the GDAL tools, check this page here:
http://casoilresource.lawr.ucdavis.edu/drupal/node/98

2)I would like also to load UTM NAD 83 orthos to the same region for
display+.
I also have LL NAD 83 Landsat Data and the d.rgb, and other efforts in 6.0
and 6.1 (working on Debian, and with Cygwin/Windows) generates a grey
rectangle in the UTM region from landsat LL NAD83 data, and then sometimes
nothing. Nothing visible from the UTM NAD 83 orthos with d.rgb in Debian
6.0 or in cygwin/windows 6.1 with HIS display mode.

Strange results. I am using Debian + GRASS-cvs for all of my work. I can't
give any cygwin specific help, sorry.

i would recommend creating a new GRASS location, based on the ortho photos, as
these are already in the correct projection. You can easily do this with
r.in.gdal ... location=new_location

This will create a new location based on the metadata encoded in the ortho
photo: projection, extent, etc.

I am planning to have the orthos for subregional overlays of the vector
file, working with the DEM in new locations in both GRASS and QGIS.

be sure to project the DEM data with gdalwarp, and then import with
r.in.gdal . Note that DEM projection requires some planning if you will be
performing any flow-related analysis. If you are looking for a 'smooth' DEM
then I would recommend looking into the "-rcs' parameter to gdalwarp .

In QGIS
The GRASS rasters (r, g, b) load and are viewable in QGIS (in greyscale)as
will the rgb tiffs, but the vector will not overlay them once I use
re-projection tool in QGIS. The LatLong NAD83 vector data will show in QGIS
and overlay a landsat dataset raster and a DEM which both show LL nad83
defs.

I have not reset/remade the location, because it's bounds exceed both(all)
the datasets in question, and I prefer to keep the projection of the
orthophotography as is (UTM NAD83 GRS80 Meters)... though I am now thinking
it would make sense to just GDAL Warp the Orthos.

I would ideally like to combine all 4 datum for multiple locations and
experiment a bit with NVIZ and look into POVRay possibilities to serve the
data via HostGIS or some other way.

Again, things are much simpler and will probably work if all input data is
first projected into a common coordinate system, and then imported into a
single location/mapset. If you region is small enough, then an equal-area or
UTM projection may be suitable.

Good luck, and don't hesitate to ask questions on this list.

Dylan

-----Original Message-----
From: Dylan Beaudette [mailto:dylan.beaudette@gmail.com]
Sent: Friday, January 05, 2007 2:37 PM
To: grassuser@grass.itc.it
Cc: Daniel Farnan
Subject: Re: [GRASS-user] ogr2ogr and ortho/rgb display

On Friday 05 January 2007 13:07, Daniel Farnan wrote:
> I am having unusual difficulty getting orthos from USGS to display (d.rgb
> red=... green=... blue=...), I had initially included the out=... but
> that was an error which read as invalid. The files will display in QGIS
> though

-

> both in full color and as the individual GRASS misc cells.
>
> I have the correct syntax for ogr2ogr but do not know which directory to
> copy the file to in order for the program to perform the re-projection.
> I have not been able to find the list for the re-projection codes (though

I

> looked up epsg codes in the epsg table and have been trying with that
> designation) and have tried a variety of possible solutions, in the
> location folder, and grassdata, which have not provided a result -

searched

> the grass user e-mails and wiki with no result.
>
> Any help appreciated - could not find this help in the book or elsewhere
> I looked.
> Re-direct(s) for harder to find OS GIS tutorials/manuals welcome, I have
> most of the easier to find ones available as well as the userlist e-mails
> and wiki url.
>
> Daniel Farnan
> Office phone?415-284-9662

Hi Daniel,

ogr2ogr is used for the projection / inverse projection of vector data.
From

your message it sounds like you needs to perform projection / inverse
projection on raster data. If this is the case you will want to use the
program gdalwarp . Can you post some examples of what you are specifically
trying to do ?

Cheers,

Dylan

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

Dylan Beaudette wrote:

be sure to project the DEM data with gdalwarp, and then import with
r.in.gdal . Note that DEM projection requires some planning if you will be
performing any flow-related analysis. If you are looking for a 'smooth' DEM
then I would recommend looking into the "-rcs' parameter to gdalwarp .

Daniel,

Please note that reprojecting a floating point grid will usually yield
"stairs" distortion in the output, depending on how big is the skew
between the input and output projection. That's propably what Dylan
meant. The "stairs" distortion will be the bigger, the less smoothing
involved in the reprojection.

Although aggressive smoothing like "gdalwarp -rcs" will reduce most of
the distortion, it will also filter out the details from the input DEM
and alter the original value range (min will go higher, max will go
lower). To avoid both shortcomings ("stairs" and over-smoothing) I
usually transform the grid into vector points, reproject the points and
interpolate a grid from them, with a suitable algorithm (there are few
in GRASS; for regularly spaced points input RST or IDW do fine).

Maciek

On 1/6/07, Maciej Sieczka <tutey@o2.pl> wrote:

Dylan Beaudette wrote:

> be sure to project the DEM data with gdalwarp, and then import with
> r.in.gdal . Note that DEM projection requires some planning if you will be
> performing any flow-related analysis. If you are looking for a 'smooth' DEM
> then I would recommend looking into the "-rcs' parameter to gdalwarp .

Daniel,

Please note that reprojecting a floating point grid will usually yield
"stairs" distortion in the output, depending on how big is the skew
between the input and output projection. That's propably what Dylan
meant. The "stairs" distortion will be the bigger, the less smoothing
involved in the reprojection.

Although aggressive smoothing like "gdalwarp -rcs" will reduce most of
the distortion, it will also filter out the details from the input DEM
and alter the original value range (min will go higher, max will go
lower). To avoid both shortcomings ("stairs" and over-smoothing) I
usually transform the grid into vector points, reproject the points and
interpolate a grid from them, with a suitable algorithm (there are few
in GRASS; for regularly spaced points input RST or IDW do fine).

Maciek

Right, thanks for the clarification Maciek. For a rather crude
comparison between several reprojection methods used on DEM data see
the following link. note that this page contains large images, and
will require a bit of time to load. hover the mouse over the small
images for a detailed view.

http://169.237.35.250/~dylan/gdalwarp/image_matrix.html

As Maciek pointed out, converting the DEM to points, projecting, and
then re-interpolating will give both smooth and hydrologically
reasonable (assumming good input data) results. r.proj method=cubic
works fairly well too, albiet with some smoothing. Also note that
projection-induced artifacts are quite apparent in curvature maps
created from a projected DEM.

In terms of changing the univariate statistics for a given DEM, I have
never directly compared these stats with respect to the projection
method. Perhaps Maciek can provide links to papers, or some empirical
data; I know several on this list may be interested :slight_smile: .

Cheers,

Dylan

Please note that reprojecting a floating point grid will usually yield
"stairs" distortion in the output, depending on how big is the skew
between the input and output projection. That's propably what Dylan
meant. The "stairs" distortion will be the bigger, the less smoothing
involved in the reprojection.

Maciek,

are you aware of any publication that explain this kind of distortion?

Carlos

--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Geologist M.Sc - Doctorate Student at IGc-USP - Brazil
Linux User #89721 - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

Carlos "Guâno" Grohmann wrote:

Please note that reprojecting a floating point grid will usually yield
"stairs" distortion in the output, depending on how big is the skew
between the input and output projection. That's propably what Dylan
meant. The "stairs" distortion will be the bigger, the less smoothing
involved in the reprojection.

Maciek,

are you aware of any publication that explain this kind of distortion?

No.

Maciek

On Monday 08 January 2007 12:29, Maciej Sieczka wrote:

Carlos "Guâno" Grohmann wrote:
>> Please note that reprojecting a floating point grid will usually yield
>> "stairs" distortion in the output, depending on how big is the skew
>> between the input and output projection. That's propably what Dylan
>> meant. The "stairs" distortion will be the bigger, the less smoothing
>> involved in the reprojection.
>
> Maciek,
>
> are you aware of any publication that explain this kind of distortion?

No.

Maciek

" Necessity is the mother of invention " ... sounds like a fine time to write
this up!

I am actually in the process of doing this type of analysis for another
project if anyone is interested in collaborating.

Cheers,

Dylan

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341