Wednesday, July 13, 2011

GRASS: Day 2

Where is Day 1 gone? Well I did say I am a rubbish blogger, moreover I had no journal yesterday...

Some basics, but then the boring bits starts.
more information on Grass can be found here... http://grass.osgeo.org/ It is less user friendly than Quantum, but it is a lot more powerful and certainly more stable, as it has been around for many years (if I read well it originates from military uses, how strange is it that a lot of the world greatest inventions where born out of war, what image does it give of human kind?)
I downloaded it from OSGeo4W, from which you can get many open source software in one installer, I've been told that is better to do it that way, as it gives also a command line post to start all these programs (and maybe they can interact better with each other, who knows...). Bref, (yes another french word worth knowing, it sounds better than "anyway" and is smaller than "to summarise") here is a link. http://trac.osgeo.org/osgeo4w/

Now to avoid anyone as silly as me to figure out how to get grass to work from the command line interface, here you go, rince your eye (and look in Usage): http://trac.osgeo.org/osgeo4w/wiki/pkg-grass

Boring bits starting... now.

After a lots of mixed results and fumbling yesterday here is my conclusions for day 2.

I understand fairly well how the Grass command system work now after a couple of days of playing with it,  I am very impress that there is help and index for all the commands (something that I did not find for Quantum and the python language and made my life close to a living hell)
here is the code:
g.manual -i (then you go in Display commands manual, then at the bottom of the page in full index)

Here are the main pieces pieces of code I've played with (to use with the North Carolina Sample data)
#list maps
g.list rast
g.list vect

#normal 2d display
g.region rast=elevation -p
d.erase #does not work in the GUI, I wonder if it mainly apply for UNIX
d.rast elevation
d.his h=elevation i=elevation_shade
d.vect streams col=blue
d.vect roadsmajor
d.vect overpasses icon=extra/bridge size=15 fcol=blue

#and the most impressive results with the 3D
nviz elevation vect=streams,roadsmajor point=overpasses

#and that is it, it sounds small but I had quite a headache to just get all of that to work the way I wanted

I have played a bit with the command line from the python interface of Grass, it is good as it gives you choices when you are typing, however, if I manage to display a map, the layers options that I had decided, e.g color blue, etc, do not show up until I manually go check the options in their propriety (right click or double click) in the display of map layers.

When I finally got how to use the OSGeo 4W command line interface (see above and yes I do feel relatively stupid) I tried to display map, but it comes as a png of a single layer at the time on my desktop, tried to open a monitor with
d.mon x0
but that is just for Unix or Mac, otherwise they recommend to download a X-server (not quite sure which one to get) or to use another GUI (I really hate this name, it sounds slimy) with:
gis.m
But the blooming GUI does seem to want to display my map...

Still all is not lost, I had a bit of a play around with the nviz module for 3D (for now it is more 2.5D but nevermind) and at least I seem to be able to get results there...

Here is a Screenshot.
nviz displaying North Carolina sample data

No comments:

Post a Comment