[GRASS-user] Question on how to import lat-long data into a lambert conic confromal location

Tom Russo russo at bogodyn.org
Sat Jul 1 13:16:15 EDT 2006


On Sat, Jul 01, 2006 at 12:06:31PM -0400, we recorded a bogon-computron collision of the <Thomas.Adams at noaa.gov> flavor, containing:
> List:
> 
> I know how to re-project from a lat/long location to a LCC location; 
> that's not the question?
> 
> For the longest time the way I have imported lat-long data into a 
> non-lat/long location was to import the data into a lat/long location 
> and then reprojected the data into (say) a lambert conic confromal 
> location. So, I would have to exit GRASS (and from my lat/long location) 
> and then re-start GRASS, the 2nd time going into my LCC location. I 
> believe there are more straight-forward ways to do this; but how? What I 
> have been doing works just fine, but I'd like to improve my efficiency.
> 
> Any help is appreciated.

I usually use GDAL tools to transform the files directly rather than using
r.proj or v.proj.  Rasters can be transformed with gdalwarp, vectors with 
ogr2ogr.  By doing this, you avoid having to use a separate location in grass
for a first pass.

Both tools can take either EPSG numbers for the source and target 
coordinate systems, or can be given PROJ.4-type specification (you don't need 
the source system if the input has correct GeoTIFF tags or a shapefile with
associated ".prj" file containing a WKT-format coordinate system specification).

So this could work inside your grass LCC location:

  g.proj -w -f > myproj.prj
  gdalwarp -t_srs myproj.prj input.tif output.tif
  r.in.gdal input=output.tif ...

Similarly for a shapefile input:

  g.proj -w -f > myproj.prj
  ogr2ogr -t_srs myproj.prj output.shp input.shp
  v.in.ogr  dsn=. layer=output

Both of these examples assume that the input has the coordinate system 
associated already.  If not, you need to add "-s_srs" options.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick




More information about the grass-user mailing list