Home

Grass Tutorial

image

Contents

1. Iriteractive usage anhand 123 Scripted usage nent int E REEL naine lee te 123 Editing the resulting postscript file with pstoedit eene 124 BAT ML Maps Exports nn ae er R 125 52 Using external programs for map layout uueesenesnennenenenenenanansenn 127 XIV Programming essesesesssssosnsnenesensonsnenenensnnensnenenennnsnsnenenensnnenensnensnssssnensnsnnsnensnenenene 129 53 Scripting GRASSE nr R Ea ist dire die AEL tipka 129 SOLIDES screen series enterrer ni terrine date Tepe 129 Batch sage of GRASS sn nannte 129 94 C PrOSTAMIUTIS se sc50ehei ase sdertassovetaasshacehansiedeasdssteveaberdeoesussestuns Cokensvedoncdsabeseatertesen 131 XV Special Topics ssssssssssssscssssssssseseccesssseesesesssssesesssssssesessssssssscsesesssscsessssseseeseseeeees 135 55 Digital Terrain Models sineira ine eieiei iaaea aeiiaaie 135 56 Topographical analysis 137 57 Cost Surfaces en an a ne essen 139 58 Creating AnimatiONS ss 141 XVI Bibliography 143 59 Bibliography 2 3 222 222 2 a Ea aa ai aa AREE A de Gi ee 143 A GNU Free Documentation License 222use220020000000000000000000020n0000n000nnnnnensnnsnnnnnene 145 PREAMBER 2 2222 2 22 20 aaa nee des T lates hale ou nee E 145 APPLICABILITY AND DEFINITIONS n unis crrneessrnnssssneecsneessnees 145 VERBATIM COPYING 2 nn nent eee nr een are 146 COPYINGIN QUANTIT En nn nn A en dures sbobesteaasibanttstasuvesba
2. e CVS GRASS6 continuously updated developers version see GRASS CVS page e GRASS6 1 under development see GRASS6 page e GRASS6 0 current stable release see GRASS6 page e GRASS4 3 last non floating point release see GRASS4 3 release page e GRASS4 1 latest official CERL release 1991 see GRASS4 1 release page GRASS is an Open source sofware released under the GNU General Public Licence it is therefore free with protection of the authors rights With its 1 5 million lines of C code it is one of the largest Open source projects http grass itc it intro firsttime php http grass itc it devel cvs php http grass itc it grass60 index php http grass itc it grass60 index php http grass itc it announces 4 3release info html http grass itc it announces 4 1release info html SD OT Be DE http www gnu org Chapter 2 What is GRASS Chapter 3 Credits History of GRASS e Credits e Current development team Notes 1 http grass itc it devel grasshist html http grass itc it devel grasscredits html http freegis org cgi bin viewcvs cgi checkout grass AUTHORS oN Chapter 3 Credits Chapter 4 Hardware and software requirements Hardware A workstation running some flavor of UNIX like Solaris IRIX GNU Linux BSD Mac OS X GRASS also runs on on Win32 within the Cygwin environment As a minimum you should have at least 500 Mb for data and 32 Mb RAM However this wi
3. grass itc it gdp html_grass5 html d save html An ee DE Chapter 24 Zooming and Panning Notes Use d zoom for zooming and panning in the currently selected monitor d zoom without any command line options allows you to zoom in by selecting a zooming frame left mouse button or to zoom out middle mouse button If you launch d zoom f you get the option between zooming left mouse button or panning mid dle mouse button If you only want to pan try d pan Both d zoom and d pan change your current region settings They are in that sense an interactive version of g region so be aware that any command using the current region settings will be affected by the use of d zoom or d pan 1 http grass itc it gdp html_grass5 html d zoom html 2 http grass itc it gdp html_grass5 html d pan html 3 http grass itc it gdp html_grass5 html g region html 57 Chapter 24 Zooming and Panning 58 Chapter 25 Adding Legends and Scales Notes Legends in GRASS only exist for raster maps Currently GRASS does not support legends for vector maps such as those drawn with d vect area See the module d legend for your legends This module is in active development for the moment so its usability should continue to be enhanced in the near future You can use d legend to display a legend in the same monitor as the map orina different monitor use d mon to start and or select a different monitor Through its m option d leg
4. http grass itc it grass60 manuals html60_user g remove html http grass itc it grass60 manuals html60_user g region html http grass itc it grass60 manuals html60_user d m html http grass itc it grass60 manuals html60_user d mon html http grass itc it grass60 manuals html60_user d rast html http grass itc it grass60 manuals html60_user d vect html 0 N OLE ED http grass itc it grass60 manuals html60_user d erase html m oO http grass ite it grass60 manuals html60_user r colors html http grass itc it grass60 manuals html60_user d rgb html jmi ND m http grass itc it grass60 manuals html 0_user d zoom html m oO http grass itc it grass60 manuals html60_user g manual html m gt http grass itc it grass60 manuals html60_user d mon html http grass itc it gdp http grass itc it grass60 manuals htm160_user e a ol Chapter 9 GRASS structure Generally speaking GRASS is anormal user program like many others It comes with a graphical user interface GUI that allows GRASS usage through the mouse Parallel to that GIS commands can be entered in the GRASS terminal window Nevertheless the program structure is somewhat different to normal user programs after the start up of GRASS the GRASS commands typically called GRASS modules are at the same level as the other UNIX commands meaning that all UNIX commands are also available in the ter
5. need an open graphics monitor to use it If you would rather use a vector map as reference map you can use the module i vpoints 109 Chapter 45 Preprocessing Images Notes 110 i rectify will use the points you defined with i points to rectify your image In other words it geocodes your map by linking the data elements contained in your image to geographical coordinates The module is pretty straightforward but if ques tions remain consult the man page Colors Use r colors to redefine the color table of your images For example you can use the color grey eq parameter setting to apply a contrast stretch to an image useful for those that appear too dark Displaying images In order to display your image in a recognizable way you have to create a color com posite from its different frequency channels Thus to get a natural color composite you would combine the red green and blue channels Two options are open to you e Simply display a composite with d rgb This does not create a new map but dis plays three layers in a composite form e Create a new composite map For this purpose you can use i composite This is also very useful if you need a color composite as base map as for example for geocoding or for classification Radiometric preprocessing In order to avoid certain phenomena such as atmospheric and terrain effects but also image transformation by the vendor several corrections need
6. or interactively i e you can call each module without parameters then you will be prompted for required information like map names etc You can read the manual pages of the commands of GRASS 5 0 online or with the g manual command in a running GRASS session Help gt Manual pages in TclTk GRASS There is also an incomplete one line reference containing a short explana tion of many commands 1 http grass itc it gdp html_grass5 index html 2 http grass itc it gdp html_grass5 html g manual html 3 http grass itc it gdp html_grass5 grass_commandlist html 23 Chapter 10 GRASS commands 24 Chapter 11 Graphical User Interface The TclTkGRASS GUI which allows mouse usage is simply an extension with out own GIS functionality TcITkGRASS offers graphical access to important GRASS modules and makes working with GRASS easier However don t forget that it is in complete and that there are many more modules available than are present in the TclTkGrass menus Also beware that some modules that are present lack some of their command line options in their teltkgrass window If TcITkKGRASS was not started automatically during GRASS startup you can do so at the GRASS prompt with the command tcltkgrass amp 25 Chapter 11 Graphical User Interface 26 Chapter 12 The GRASS Region What is the region The region is a cornerstone concept in GRASS If you want to be able to use GRASS to its full potential yo
7. refer to m proj and r proj for automated map transformation After importing the map the process is as follows The map has to be added to a so called image group This is simply a list of raster data files to be processed all images should have the same geocoding Subsequently a transformation target is committed which is an additional location For example a UTM location Now the geographic references have to be set to tell the transformation module about the new coordinates for every pixel in the new UTM location Therefore the four corner Chapter 28 Processing Scanned Maps coordinates in the xy location are assigned geographical coordinates These are of course the geographical corners not map sheet paper corners If there are no read able map borders present e g you have scanned only a cut of the map you can use the corner points of printed reference crosses These should be chosen as close as possible towards the real corners of the map These points have to enclose a rectan gular area as the cut will be turned stretched and contracted in the following affine transformation If no reference crosses are available either use well identifiable features such as road intersections Once the geographic references are assigned the transformation of the raw map into the UTM location is performed The process in detail is as follows a Prompt the name of the newly to be set up image group i group e Name this group fo
8. Cover Texts in the Modified Version Only one passage of Front Cover Text and one of Back Cover Text may be added by or through arrangements made by any one entity If the Docu ment already includes a cover text for the same cover previously added by you or by arrangement made by the same entity you are acting on behalf of you may not add another but you may replace the old one on explicit permission from the previous publisher that added the old one The author s and publisher s of the Document do not by this License give permis sion to use their names for publicity for or to assert or imply endorsement of any Modified Version COMBINING DOCUMENTS You may combine the Document with other documents released under this License under the terms defined in simplesect 4 above for modified versions provided that you include in the combination all of the Invariant Sections of all of the original doc uments unmodified and list them all as Invariant Sections of your combined work in its license notice and that you preserve all their Warranty Disclaimers The combined work need only contain one copy of this License and multiple identi cal Invariant Sections may be replaced with a single copy If there are multiple Invari ant Sections with the same name but different contents make the title of each such simplesect unique by adding at the end of it in parentheses the name of the original author or publisher of that simplesect if known or
9. ENTER to congratulate GRASS for having created your new location Chapter 7 How to Quickstart GRASS 10 Don t panic because you ve been returned to the very first screen It s normal Press ESC ENTER and life in GRASS can begin 11 You are in a shell that is just like any other UNIX shell only for the GRASS prompt and some environment variables that have been added but that you don t have to worry about 12 Now we will use the magic of rin gdal in the command line type r in gdal in RasterFile out GRASSRaster location NewLocation where RasterFile is the name and if the file is not in the current directory the path of the raster file you want to import GRASSRaster is the name you want that map to have in GRASS and NewLocation the name of a new location r in gdal will create automatically for the new map and which will contain all the geographical information projection extension resolution included in the orginial raster file You may also use v in ogr instead of r in gdalif you have vector data GRASS need to be build with OGR support to use this command 13 If all goes well i e no error messages you now have to enter the new location just created automatically by r in gdal or v in ogr Since you cannot change location within a running GRASS session you have to leave GRASS exit 14 Restart GRASS This time it should come up with the Tcl Tk welcome win dow The window will
10. GRASS and much more Compilation of source code You can also download and compile the entire source code yourself This allows you to have access to the code and modify it if you would like to The source is more or less platform independent and is available at http grass itc it download index php For GRASS 6 0 get the grass 6 0 0 tar gz file put it into the directory of your choice and decompress it with gunzip grass6 0 0 tar gz tar xvf grass6 0 0 tar or tar xvzf grass6 0 0 tar gz Then follow the installation instructions also included in the source code archive you downloaded Also don t forget to read the list of required software or Chapter 4 in this tutorial http grass itc it download index php http grass itc it mirrors php http grass itc it gdp tutorial abs_beginners pdf http grass itc it download index php http pkg grass alioth debian org cgi bin wiki pl http www freegis org cd contents en html http grass itc it download index php http grass itc it grass60 source INSTALL Ru STON OT De 13 Chapter 6 Download and Install 9 http grass itc it grass60 source REQUIREMENTS html 14 Chapter 7 How to Quickstart GRASS This chapter aims at giving a newcomer in GRASS a very hands on introduction in order to give him the opportunity to very quickly take first tentative steps in GRASS This does not replace a throrough study of the rest of the documentation but should help reli
11. GRASS offers two ways of chosing colors either by using the standard color names red orange yellow green blue indigo white black brown magenta aqua gray grey or by indicating R G B triplets values between 0 and 255 of red green and blue thus allowing TrueColor support NOTE In GRASS 5 0 TrueColor support is available for some display commands only From version 5 3 on it is available in almost all the core display modules Scripting the display of maps and frames When you have to repeat all the commands above it is easier to have them ina script file instead of retyping them every time You can create such a script file yourself in any text editor but GRASS also offers you the possibility to use d save to write the commands that led to the current monitor content into a script file This allows you to test a layout on your screen command by command and then once you are satisfied 55 Chapter 23 Displaying Maps Notes 56 to save this layout into a file This is especially useful for cartography see Part XIII in Grass Tutorial http grass itc it gdp html_grass5 html d dm html http grass itc it gdp html_grass5 display html http grass itc it gdp html_grass5 html d rast html http grass itc it gdp html_grass5 html d vect html http grass itc it gdp html_grass5 html d sites html http grass itc it gdp html_grass5 html d vect area html http grass itc it gdp html_grass5 html d rgb html http
12. N This example was taken from M Neteler H Mitasova 2002 18 http mpa ite it grassbook p 84 18 http mpa itc it grassbook Chapter 30 Vector Categories and Attributes Notes Viewing category values To see information about the category values and labels of your vector file use v report Generates statistics for vector files v what Query the category contents of a binary vector map layer at user selected locations Changing category values As with raster maps you have to distinguish between changing an existing map s categories and creating a new map out of the categories of an old one Contrary to raster maps you can change the category numbers of existing vector maps v digit A menu driven highly interactive map development program used for vector digitizing editing labeling and converting vector data to raster format the universal tool for altering vector maps also see Chapter 27 for more information about v digit v alabel Bulk labels unlabeled area features in a binary GRASS vector file allows you to set category numbers and optionally labels v llabel Bulk labels unlabeled points or lines in a binary GRASS vector file allows you to set category numbers and optionally labels lt If you wish to create a new vector map on the basis of an old one you can use one of two modules NED IRRE ID v reclass Creates a new map layer whose category values are based upon the
13. classes resulting from a previous clustering session or from a supervised clustering procedure This seed file should help you optimize the cluster decision boundaries classification Now that you have created your class definitions you have to reclassify your original image to decide to which class each individual pixel belongs As always well almost always GRASS has a solution for you i maxlik a maximum likelihood discriminant analysis classifier This takes the signature file sigfile generated by i cluster to assign each pixel to a class based on probabilities of likelihood The resulting map will show you the classes in your original map The optional reject parameter allows you to create a raster map containing the confidence levels for each pixel Supervised classification In supervised classification you do not let the computer create the classes but you create them yourself and let the computer only do the second step i e the assign ment of pixels to the classes This means that you determine beforehand the number and the nature of the classes you wish to use Follow these steps for supervised clas sification creating the classes GRASS allows you to create the classes by determining so called training areas in existing maps Such training areas have to represent a homogenous sample for them to work The module i class helps you in defining those areas It lets you display a map such as for example a col
14. default region you can still set the current region to that new map s settings by using see below for an explanation of these commands g region rast name or g region vect name However whenever you use g region d you will reset your current region to the default which does not contain the new larger map 27 Chapter 12 The GRASS Region 28 How to work with the region The main tool for working with the region is the g region command Read the man page thoroughly to get aquainted with all its possibilities Here are some of the most common usages g region p Print current region settings g region d Reset current region to default for location g region rast NameOfARasterMap Set the current region to the coordinates of the raster file g region vect NameOfAVectorMap Set the current region to the coordinates of the vector file g region save filename Save the current region settings into the file filename g region region filename Set the current region to the coordinates saved in filename created with g region save filename g region n value s value e value w value res value Set the northen southern eastern western edges and the resolution to the re spective values g region Will bring up a menu allowing you to access all of the options interactively d zoom You can also set the region values except for the resolution interactively with the mouse on the current monitor using d zoom A
15. else a unique number Make the Appendix A GNU Free Documentation License same adjustment to the simplesect titles in the list of Invariant Sections in the license notice of the combined work In the combination you must combine any simplesects Entitled History in the vari ous original documents forming one simplesect Entitled History likewise combine any simplesects Entitled Acknowledgements and any simplesects Entitled Dedi cations You must delete all simplesects Entitled Endorsements COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License and replace the individual copies of this License in the various documents with a single copy that is included in the collection provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects You may extract a single document from such a collection and distribute it individu ally under this License provided you insert a copy of this License into the extracted document and follow this License in all other respects regarding verbatim copying of that document AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and indepen dent documents or works in or on a volume of a storage or distribution medium is called an aggregate if the copyright resulting from the compilation is not used to limit the legal
16. in Chapter 38 For the rest of us let s go on In order to geocode an image we need reference points for which we know the pre cise coordinates in the projection system we want to use Those points are called ground control points or GCP If you re of those that win in lotteries your data actu ally might contain GCP In that case r in gdal will store those points in a POINTS file and can even reproject them during import if you use the target parameter How ever the lower masses and those whose GCP are not sufficient to reach an acceptable accuracy will have to identify the points themselves Luckily GRASS offers you some help with this task Before doing anything else you will have to group your data with i group Once this is done please identify the target location which you have created before using the instruction in Chapter 16 with i target This defines the projection system into which you will recitfy your data The main tools for rectifying your images are i points and i rectify The first allows you to juxtapose one of the images of your group with a raster reference map use the option PLOT RASTER to use such a reference map A zoom function helps you identify the points at sufficient precision level At any moment you can calculate the root mean square error for the points entered and thus control the precision Please see the man page for a complete description of how to use the module Note that you
17. in separate maps to avoid problems with crossing lines It is also easier to assign a certain type line or area boundary to a line There should not be any problems when all the rules are fulfilled Digitizing Maps If there is no digitizer available but a scanner it is still easy to digitize a map You can find information on importing a scanned map into GRASS in Chapter 19 and Chapter 28 You can use your mouse for digitizing instead of a digitizer After starting a GRASS monitor run the module v digit in tcltkgrass chose Vector gt Develop map gt Digitize to change the settings from digitizer to mouse Choose digitizer none After selecting a new or existing vector file you will see a dialogue requesting project data It is necessary to change the parameter Map s scale from 1 0 to the respective scale of the map Provide the following information Your organization Geographisches Institut Todays date mon yr Jan 25 99 Your name Emil Maps name realnutzung 63 Chapter 27 Digitizing Vector Maps 64 Maps date Maps scale 1 25000 Other info Sommer 1998 Zone 0 West edge of area 3568750 South edge of area 5762774 East edge of area 3574250 orth edge of area 5767726 After completing this dialogue you will be transferred to the main menu In order to digitize on the basis of the scanned raster map place it in the background Choose Backdrop cell map B from the Customiz
18. it gdp html_grass5 html i rectify html http grass itc it gdp html_grass5 html i points html http grass itc it gdp html_grass5 html r colors html http grass itc it gdp html_grass5 html d rgb html http grass itc it gdp html_grass5 html i composite html http grass itc it gdp html_grass5 html r mapcalc html 111 Chapter 45 Preprocessing Images 112 Chapter 46 Analyzing Images Notes Introduction Image analysis is a wide field with lots of different techniques that would be far to many to describe here We will therefore only briefly mention some of the more com mon ones Don t hesitate to browse through the man pages of the imagery modules and of the raster modules for inspiration and consult the tons of litterature that exist on the topic of image anlysis TODO add references Image ratios One quite simple way of analyzing images is by using image ratios in which you use the input of two or more frequency bands of your image in order to calculate an index such as the often used normalized difference vegetation index or to enhance your image See the relevant litterature for their uses In GRASS you can calculate such ratios with r mapcalc Factor analysis One way of synthesizing the information contained in the different bands which often contain overlapping i e redundant information is the use of principal com ponent analysis in order to perform a principal component tranformation Thus the in
19. length scale and geograph ical extension This general cartographical relation is also valid when transforming an analog map into a digital map Since you willmost probably be using a scanner at least to create a backdrop map for the vectorisation within the GIS these terms are of great importance Also you should obviously not forget about copyright restrictions when scanning maps When using digital maps that have not only been scanned for example by a govern mental institution but also already geocoded or completely digitally created the data structure and the import are greatly simplified The data structure can be de duced from the information about the digital map concerning geographical borders and resolution General definition of a project area when using scanned maps During the scanning process it is next to impossible to lay down the map perfectly straight In consequence the scanned map will always present a slight rotation away from the northern orientation which is unacceptable when working with GIS We will therefore present as a first method one that requires a little more work and time but which allows an exact import of maps through the correction of the position with the help of reference points This method can be considered a universal method for importing scanned maps However in this case you will have to define two project areas with different projec tions First the scanned map is imported into a simple
20. list the available locations and mapsets in your GRASS Database Chose the new location just created by r in gdal v in ogr NewLo cation and chose the mapset that is called after your login name Then click Use Selection 15 Congratulations you made it I hope Now you can move on to Chapter 8 to actually do something with your map You have a non georeferenced data file You scanned a map and now have a non georeferenced raster file Or you down loaded a nice PNG file of a political world map from the internet Or you drew a map of your garden in the GIMP and now want to use it to manage your plantings In other words either you do not have the georeferencing information of this map and it is not included in the file format or you do not care about projection for your use ofthe map This section is for you Before going any further though a word of advice if you only plan on viewing the map and not doing any real work concerning geographical information i e linking data with geographical coordinates then maybe GRASS is not the right tool for you GRASS is a full fledged GIS and not a map viewer and using it just to quickly view some maps would probably be overkill Since your map is not georeferenced you can import it into a simple x y location i e where the coordinates directly designate pixels on the screen In order to do so just follow the steps described in the previous section up to the r in gdal call Ho
21. of over 100 useful projections This also includes a programmers library of the projection methods to support other software development Thus converting a vector map in which objects are located with arbitrary spa tial precision from one projection into another is usually accomplished by a simple two step process first the location of all the points in the map are converted from the source through an inverse projection into latitude longitude and then through a forward projection into the target Of course the procedure will be one step if either the source or target is in geographic coordinates Converting a raster map or image between different projections however in volves additional considerations A raster may be considered to represent a sampling of a process at a regular ordered set of locations The set of locations that lie at the intersections of a cartesian grid in one projection will not in general coincide with the sample points in another projection Thus the conversion of raster maps involves an interpolation step in which the values of points at intermediate locations relative to the source grid are estimated Projections in GRASS See the list of supported projections for an idea of which projections are supported in GRASS 1 http grass itc it gdp html_grass5 html r proj html 2 http www remotesensing org proj 3 http grass itc it gdp html_grass5 projections html 93 Chapter 37 Coord
22. one them on the mapsets list Click on Enter GRASS button oO N 4 The GIS Manager should start automatically 15 Chapter 7 How to Quickstart GRASS 16 5 See Chapter 8 for the next steps You have a georeferenced data file and know its geographical coordinates You have a file in a georeferenced format GeoTiff shape etc and have all the in formation concerning the projection the data is in its geographical extensions and if it is a raster file its resolution You will have to create a location according to that information Assuming that the file is in your home directory here s what you have to do if it somewhere else just change the path to the file when entering the relevant commands 1 Create a new location according to the information you have and the steps described in Chapter 16 2 Once you have entered GRASS you can import the file with the appropriate module as described in Part VI in Grass Tutorial You can use the graphical user interface for most imports start it with d m amp 3 When you have finished the importation process see Chapter 8 for the next steps You have a georeferenced raster file but don t know its geographical coordinates Someone gave you a geocoded raster file GeoTiff shape etc or you downloaded it from somewhere but you have no information as to its geographical projections its extension or its resolution You therefore do not know how to create a locati
23. other commands will also only work on that region as for example many of the export commands or many of the raster development modules This allows working on only a portion of the map thus not using up your computer s ressources for the rest of the map Or you can export only the portion of a map that really interests you In a similar way you can reduce the resolution of the region in order to use less machine resources For example you might want to convert a vector map to raster but do not need the raster in very high resolution as for example if you want to create a thematic map of the world where the exact contours of the countries are not very important You can therefore change the region settings to a lower resolution before launching the conversion so that it takes less time and memory In general you always have to be careful to assure that the region is set correctly before doing any work on your map A typical problem of newcomers to GRASS is that they import a map and then try to display it but only see an empty GRASS monitor This is almost always due to wrong region settings which make the map fall outside the area currently covered by the region Ideally the default region of a location should encompass the entire area covered by all the maps in that location So if you reset your region to the default subsequent commands should always cover your entire location If however you import a map that is larger than the
24. printer driver image data library image processing file management I_ segment library segmented data management segment_ Notes Chapter 54 C Programming vask library control of cursor keys etc V_ rowio library for parallel row analysis of raster data rowio_ Some of the routines offered are quite substantial For example they allow calculating geodesic distances out of given coordinate points others perform queries on vector areas e g point in polygon tests Modules consist of the C program files c the header files h and a Gmakefile GRASS has its own make routine gmake5 The file Gnake file contains instructions concerning the files to be compiled and the libraries to be used GRASS and UNIX libraries It has a specific pattern that must be respected A simple example impor tant indents with tab not with space shall demonstrate the typical structure The line HOME PGM and the next contain the compiler instructions above this section the variables are set Variables not set here are defined automati cally in grass5 src CMD head head ARCH where ARCH is the name of the system architecture Starting from GRASS 5 0 this head file is created automatically for the used computer platform by the config ure script which has to be run before the first compilation The HOME variable indicates where the binary file i e the module will be copied to in this example it is the
25. rights of the compilation s users beyond what the individual works permit When the Document is included in an aggregate this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document If the Cover Text requirement of simplesect 3 is applicable to these copies of the Doc ument then if the Document is less than one half of the entire aggregate the Docu ment s Cover Texts may be placed on covers that bracket the Document within the aggregate or the electronic equivalent of covers if the Document is in electronic form Otherwise they must appear on printed covers that bracket the whole aggregate TRANSLATION Translation is considered a kind of modification so you may distribute translations of the Document under the terms of simplesect 4 Replacing Invariant Sections with translations requires special permission from their copyright holders but you may include translations of some or all Invariant Sections in addition to the original ver sions of these Invariant Sections You may include a translation of this License and all the license notices in the Document and any Warranty Disclaimers provided that you also include the original English version of this License and the original versions of those notices and disclaimers In case of a disagreement between the translation and the original version of this License or a notice or disclaimer the original version will prevail If a
26. simplesect in the Document is Entitled Acknowledgements Dedications or History the requirement simplesect 4 to Preserve its Title simplesect 1 will typi cally require changing the actual title TERMINATION You may not copy modify sublicense or distribute the Document except as expressly provided for under this License Any other attempt to copy modify sublicense or 149 Appendix A GNU Free Documentation License 150 distribute the Document is void and will automatically terminate your rights under this License However parties who have received copies or rights from you under this License will not have their licenses terminated so long as such parties remain in full compliance FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new revised versions of the GNU Free Documentation License from time to time Such new versions will be similar in spirit to the present version but may differ in detail to address new problems or concerns See http www gnu org copyleft Each version of the License is given a distinguishing version number If the Docu ment specifies that a particular numbered version of this License or any later ver sion applies to it you have the option of following the terms and conditions either of that specified version or of any later version that has been published not as a draft by the Free Software Foundation If the Document does not specify a version number of t
27. standard path for modules that offer command line support no limitation to interactive only usage grass5 etc bin cmd The actual C program should be divided by sub functionality into several files which have to be listed respectively in the list of objects in the Gmakefile For de tails please refer to the GRASS Programmer s manual as this book cannot cover a full C programming tutorial GRASS GIS library commands can be used directly in the source code Interactive parameter querying is made possible by GRASS specific parameter programming Here is a short example of a raster module The calculation is done row and column wise see for loop As denoted above it is advisable to divide the entire module into individual thematically organized files in order to facilitate program maintenance http grass itc it grass5 progmangrass50 pdf http freegis org cgi bin viewevs cgi This will change with new versions of GRASS in an effort to put more common routines into libraries and with the integration of a completely new vector engine see the 4 http grass itc it grass51 manuals http grass itc it grass51 manuals http mpaitc it grasstutor scripts code Gmakefile_pre4 The code example links in this chapter go to 7 http mpa itc it grassbook http mpa itc it grassbook http mpa itc it grasstutor scripts landsat c 133 Chapter 54 C Programming 134 Chapter 55 Digital Terrain Models GRASS Geogra
28. title at 90 100 0 100 create a title frame echo TITRE d text b size 75 at 45 30 write the title into the title frame d fram c frame map at 10 90 0 100 create a map frame d rast combel draw a raster map into that frame d vect autoroute col violet draw a vector map into the same frame d fram c frame legend at 0 10 0 100 create a legend frame echo Cartography M Lennert d text size 20 at 75 50 draw text in the legend fran d barscale at 10 920 create a barscale in the legend frame Notes 1 http grass itc it gdp html_grass5 html d mon html 2 http grass itc it gdp html_grass5 html d frame html 53 Chapter 22 Managing GRASS Monitors 54 Chapter 23 Displaying Maps You might want to begin with the gui display manager d dm which facilitates the choice and display of maps and thus makes life easier for those not too comfortable with the individual commands rm 3 sisis Display Manager carto J Set 1 I m sshel I I provinces j nm a gt save _ aose x0 x1 vy x2 VY x3 YY X4 VY X5 v Display All Zoom Pan Query PNG he Other than that maps can be displayed with the d display commands for which d dm is just a frontend such as d rast e d vect e d sites d vect area for filled vector areas e d rgb to combine three raster map layers with a grey scale color map to form a color Red Green Blue image Colors
29. user s reclassification of categories in an existing vector map layer v extract Selects vector objects from an existing vector map and creates a new map containing only the selected objects http grass itc it gdp html_grass5 html v report html http grass itc it gdp html_grass5 html v what html http grass itc it gdp html_grass5 html v digit html http grass itc it gdp html_grass5 html v alabel html http grass itc it gdp html_grass5 html v llabel html http grass itc it gdp html_grass5 html v reclass html http grass itc it gdp html_grass5 html v extract html 77 Chapter 30 Vector Categories and Attributes 78 Chapter 31 Site Attributes Notes GRASS site or point data is stored in a text format which supports multiple dimen sions one integer category number and multiple floating point and text attributes To query the categories of an existing site file use the following modules e s what Allows the user to query site list descriptions e d what sites Interactively query a single site list descriptions e s out ascii Converts a GRASS site list file into an ASCII listing of site locations and their descriptions The text format of the site file allows you to manipulate site categories and attributes directly To create a site file with the attributes you desire you can edit a file yourself and then copy it to the site_lists directory of your mapset cp NameOfYourSitesFile GISDBASE LOCATION_NAM
30. you have got a lot of category numbers there is the option to enter line numbers in the bottom line of the window press ESC RETURN to get there Post digitizing work Often it proves to be quite difficult to match up the end points of lines when vector izing areas An area is a closed polygon which means both ends of the line have to be connected The v spag module can help if you encounter such problems Another very useful feature of v spag is inserting missing nodes at line intersections However use this command with care Create a backup copy of your map with g copy to be on the safe side You cannot undo changes made with v spag vector problem ee v spag node Is missing problem fixed at Intersectlon always digitize a node here Other very helpful modules are v clean and v prune Use v clean to remove dead lines from your map Dead lines are vectors that have been marked as deleted in v digit The module v prune can be used to remove obsolete nodes Use it with care as you can simplify complex areas polygons to squares or triangles if you remove too many nodes Digitizing of Elevation Isolines Digitizing isolines works just like with ordinary vector lines GRASS offers an easy way to attach the elevation data to these lines First digitize the lines without attributes Then change to the Label menu by press ing L Now hit i for contour interval and select the appropriate
31. 3 modes you can combine them any time TclTk interface command line r slope aspect myelevation slope myslope aspect myaspectGRASS interactive parser r slope aspect followed by dialogue Start GRASS by typing gt grass5 See the GRASS5 startup man page for details about start up options You will then be asked to provide the database directory only the first time you start GRASS and either choose from the availabe locations and mapsets or create a new location see below on how to do this Once at the GRASS prompt you can type any grass or unix commands and if it hasn t started up automatically you can start the TcITkGRASS GUI by typing tcltkgrass amp 1 http grass itc it gdp html_grass5 html grass5 html 33 Chapter 14 Start running GRASS 34 Chapter 15 Planning and constructing a GRASS database You should take extra care when creating the project area the location The structure is determined by the used data The following section will demonstrate three methods for importing scanned maps with georeferencing The first is a resolution independent way that is most useful for compensation of scanning errors In this case you will leave the calculation of GRID RESOLUTION to GRASS The other two examples are used for calculating the extension and the resolution of a location supposing that scan errors are non existant or at least negligeable You need to be aware of the relation between geometrical
32. Displaying The easiest way to do this is with the GIS Manager that you can start with the command d m amp the amp allows you to keep using the GRASS shell at the same time You can add raster or vector layer using appropriate button on the buttons bar respectively 10th and 11th button from left After you can choose the layer name by clicking on the Raster name or Vector name button in the lower part of the interface Click on the first button of the buttons bar to display selected layers If you are more of the command line type or don t want to use d m for other reasons GRASS provides you with all the commands needed for a happy expe rience Launch a GRASS monitor with d mon x0 Then run d rast or d vect de pending on the type of map you want to display d rast NameOfYourRasterMap or d vect NameOfYourVectorMap and your beauty should come up on the mon itor If you wish to erase the GRASS monitor use d erase All these commands can also be launched from the GIS Manager To start a monitor go to Display gt Start displays gt X0 To display a map go to Display gt Display raster vector maps To erase the monitor go to Display gt Erase active display frame to selected color 19 Chapter 8 The Most Important Commands to Get Started Notes 20 If you imported a raster file and GRASS created three files named NameOfYourRaster 1 NameOfYourRaster 2 and NameOfYourRaster 3 these probably represent th
33. E MAPSET site_lists If you want to change the attribute values of a site file copy the file to your current working directory with cp GISDBASE LOCATION_NAME MAPSET site_lists NameOf YourSitesFile and change whatever values you would like to When finished just copy the file back with cp NameOfYourSitesFile GISD BASE LOCATION_NAME MAPSET site_lists See the man page for s in ascii for details about the format http grass itc it gdp html_grass5 html s what html http grass itc it gdp html_grass5 html d what sites html http grass itc it gdp html_grass5 html s out ascii html Pe GN a http grass itc it gdp html_grass5 html s in ascii html 79 Chapter 31 Site Attributes 80 Chapter 32 Data Management with PostgreSQL See GRASS 5 0 x and PostgreSQL First Steps for a general introduction Also see the man pages for the GRASS database commands Notes 1 http freegis org cgi bin viewcvs cgi checkout grass src garden grass postgresql tutorial inde 2 http grass itc it gdp html_grass5 database html 81 Chapter 32 Data Management with PostgreSQL 82 Chapter 33 Statistics and Reports Often you will wish to see statistics summarizing the data that is contained in your maps GRASS offers several modules that allow you to do this Modules for raster maps 1 Get summary information about a single raster map e r cats Prints category values and labels associated with user specified raster map
34. EL There the names of the location i e the entire project area and the mapset as well as the path to the database need to be entered e g home jack grassdata If you enter list in one line and then press ESC RETURN to leave this startup mask GRASS lists all the data available in this category i e all available locations or mapsets Once you have entered the location the mapset and the GRASS database you can continue with ESC RETURN In order to create a new location just enter a non existing location name and GRASS will ask you if you would like to create a new location If you startup GRASS with grass5 tcltk you will see the following screen 39 Chapter 16 Set up your location 40 MN Grass 5 0 Data Selection Wekome to GRASS GB Version 50 Pkase sekct location and mapset or define a new bcation Database ldata GRASSD ATA Browse os 9 Location Mapset etopo5 miennert fred PERMANENT fred g51test 7 global e p P ON A pe Use Selection Create New Location Cancel Click on the button Create New Location which will get to the above text screen on which you can enter a non existing location name and continue with ESC RETURN Now you need to attribute different parameters to the location such as the coordi nate system you want to use including the ellipsoid the coordinates of the bound aries of the project area and the default resolution for raster data e Start out by
35. Grass Tutorial Moritz Lennert mlennert club worldonline be Grass Tutorial by Moritz Lennert Published Date 2005 04 26 15 39 13 Geographic Resources Analysis Support System Tutorial Please note the current version only outlines the intended contents pages may be missing Copyright c 2003 GRASS Development Team Permission is granted to copy distribute and or modify this document under the terms of the GNU Free Documentation License Version 1 2 or any later version published by the Free Software Foundation with no Invariant Sections no Front Cover Texts and no Back Cover Texts A copy of the license is included in the section entitled GNU Free Documentation License Table of Contents Ts Introduction sn ne Rd 1 1 About this tutorial este he set en nt bn ts dde 1 2 Wh t is GRASSE aa Es nassen nt te me 3 SICHER Re A A EN re sheen Tanita Paste oat 5 IT Basics sscccsssssososescosccsscctsuesessonsecesecseuscvessoavecocvacssbsuecsuncdeseucssssscvessccesseesssuebesdnssessesvecusssecsoeaesse 7 4 Hardware and software requirements ss 7 Hardware ht dt a M 2 vow Reed dit A 7 Basic Softwares lan ars ER Te OMR wee bed 7 Optional s ftware ue n ensnn en nn rene fr nie 7 5 Basic UNIX references E e ea nes de ses de 11 6 Download and Install 25253588 nn nn E EE ERTE E 13 Packages of GNU Linux Distributions ss 13 Compilation of source code 13 III GRASS in 10 minutes Quick Intro for Newbies nn 15 7
36. How to Quickstart GRASS nn Sieh etn ee diane Ae 15 You have a GRASS database 15 You have a georeferenced data file and know its geographical COOrdINalEes in he PC PO Denen ee 16 You have a georeferenced raster file but don t know its geographical COOLGIN ATES is ee nen ee RE OR RE 16 You have a non georeferenced data file 17 Other situations ira ntm an vel ner Rites 17 8 The Most Important Commands to Get Started 19 IV GRASS CONCE PIE eeni rr E E EEIN EEES EAR 21 9 GRASS OOC UE 2 ia et r a are e s EE edie a ai iani Reit 21 10 GRASS commands ccceccceccscsesccesssseceecsscessecesssseessssecessesesusscessssesssseecesssesseseees 23 11 Graphical User Interface ss 25 12 The GRASS R GION LENS nm Pari aan 27 What 18 the regiones ai nn a a a le 27 Why care about the region inrsin Sapakan Eare Eara Ee aA an e ii 27 How to work with the region ss 27 How to change the default region ss 28 V Start a Project sesesesossenssesssnsnsnensnesnnnnnenensnnonenenenenessenensnentnnnnennnensnessonsnssentnssnenenenennennennn 31 13 Set up your GRASS database nneeneenenensenennennnnnn 31 T4 Start running GRASS un san ehem T aa aaa aiaa 33 15 Planning and constructing a GRASS database nnee 35 General definition of a project area when using scanned maps 35 Definition of a project area with predefined geographical resolution 36 Definition of the project area without a previously def
37. N Example Let the length of a square location be 1 km with a wanted resolution of 5m per cell GRID RESOLUTION Thus 1 000m 5m 200 rows or columns gt 200 200 raster cells Chapter 15 Planning and constructing a GRASS database If for example a scan map is to be scanned for this region it has to contain 200 x 200 rows and columns in order to be imported without distortion Therefore in this case it is the location that determines the scan resolution since the lenght and width of the scanned area are determined by the borders of the location This is similar for any other data whose resolution also has to be adapted e g digital elevation model with defined raster width Now we need to find out which resolution has to be used when scanning in order to achieve this number of rows and columns at a fixed side length In this example we will assume a scale of 1 25000 on the map to be scanned Thus the location length of 1000m becomes 100 000cm 25 000 4cm i e 4cm on the map The scanning resolution of this map that is to be imported is calculated as follows raster rows or columns side length of the map 200 rows or columns 4cm 50 rows cm In dpi dots per inch equivalent of rows or columns per inch this becomes 50 rows x 2 54 inches 127dpi This value has to be set in the scanner software as well as the section of the map that corresponds to the geographical boundaries of the desired area that i
38. NN eae eae e eae eae RRR Re N A O1 WN FP COO NOS TF WN HM MCE SON OU DD ES Chapter 4 Hardware and software requirements Only required for xanim and ogl3d the Motif or Lesstif libraries http www lesstif org rin gdal requires GDAL Geospatial Data Abstraction Library http www remotesensing org gdal R language for the R language interface http cran r project org FreeType2 for d text freetype http www freetype org http www cygwin com http grass itc it platforms grasshandheld html http www gnu org software gec gec html http www gnu org software make make html http www gzip org zlib http www gnu org software flex flex html http www gnu org software bison bison html http www gnu org software ncurses ncurses html ftp ftp gnu org pub gnu ncurses http www gnu org software gdbm gdbm html http www xfree org http tel sourceforge net http mesa3d sourceforge net http www fftw org http www netlib org lapack http www libpng org pub png libpng html http www ijg org ftp ftp uu net graphics jpeg http www libtiff org http www boutell com gd http netpbm sourceforge net http www sourceforge net projects netpbm http www postgresql org http www unixodbc org http www lesstif org http www remotesensing org gdal http cran r project org Chapter 4 Hardware and software req
39. Ne 107 XI Process Images 109 45 Preprocessing Images ss 109 Import and export of imagery data 109 Image 4 20101 9 A ana etienne tre 109 Geocoding of images una anne ner Nine nan andre rs 109 COOLS Ae eco RR a do dees mr sr ad EN E er ee 110 Displaying images nu distante tetes sine sesh 110 Radiometric preprocessing ssssss 110 46 Analyzing Mages sense Aap Areroa Raa rae LAEE re Aa RRE arena 113 Introduction sen n a a oa a Blasen 113 Image TAH 0S AERA LS waatseswesesasceagsenesadsrvuessa Mescatassweesaseaevas 113 Factor analysis esere eee eine TEE E EE E E E SE 113 Fo rier transformation asserunt e tien n ea e i i ae 113 nage filtering senteeeh sbacchestiesansebetacteaeutseievsiaucutscvaasstussssvbatacserend stad 113 47 Classifying Mages nno ie a e E i ner 115 Introduction anene tari tes ca EREE E E R rE R E O aare S 115 Unsupervised classification 115 Supervised classification 115 Partially supervised classification 116 XII Cartography nsen a nE a EE EEE E ES 117 48 Introduction esni si ses e en Miss 117 49 Map export to raster image files nnnneennenn 119 PNG drivet soaron tasen ss E E a E ated od RS BORE 119 CELL AVO 2 2 82 2 2222 an A EE EAE A RRE 119 Scripting the creation Of maps 119 Creating a PNG map from the Display Manager cccsesseseseeseseeeees 120 50 Postscript Maps Exports ss 123
40. a smooths zero counts and does iterative proportional fitting to normalize the matrix Modules for vector maps 1 Get summary information about a single vector map e v info Information about a vector map s boundaries projection data type category number data base location and mapset and history are put into a table and written to standard output e v report Generates a table showing the area present in each of the cate gories of a user selected data layer Area is given in hectares square meters and square kilometers e v stats Prints information about a binary GRASS vector map layer Infor mation includes the number of lines nodes areas islands and attributes 2 Get information about a single vector map at specific points or in specific areas e v area Display GRASS area and perimeter information for GRASS vector map Then user can select area on map by clicking with mouse within the desired area Selected area will be highlighted in selected color on graphics display On regular screen area infomation will be displayed in square me ters hectares acres and square miles Perimeter measurements in meters feet and miles are also displayed e v distance Calculate the distance from a point to the nearest line or point in a vector map User types in easting and northing coordinates t Query the category contents of a binary vector map layer at user selected locations The mous
41. and ellipsoid e minimum and maximum coordinates of the area of interest e ground resolution The supported common coordinate systems are here In general planning of a database in a Geographical Information System requires some preparation The user should proceed with care since the chosen data struc ture determines the usability of the GIS Special attention should be accorded to the resolution a high raster resolution requires large calculation and memory capaci ties a low raster resolution rarely provides acceptable results this resolution issue is not relevant for vector and sites data The optimum is somewhere in between and depends on the needs but also a lot on the input data quality The main procedure for creating a location is as follows first the GRASS startup screen appears If you started up GRASS with grass5 text or if this is the first time you start GRASS the text interface will come up xterm LOCATION This is the nam j ilable aphic location spearfish is the sample dat ase r tutorials are written MAPSET Every n runs L the name of a MAPSET with MAPSET i ar COORDINATE REGION an of any new ma DATABASE This is the unix directory containing the geographic databas The REGION to the entire are the sen LOCATION You may ch LOCATION red ente MAPSET mlennert or mi amp within a location DATABASE AFTER COMPLETING ALL ANSk ENTER gt TO CONTINUE OR lt Ctrl C gt TO CANC
42. anned maps land use soil types etc In the first case labels are not very neces sary since the type of map defines the type of values themselves in the second they are indispensable in order to document the meaning of the category numbers In GRASS the raster map is stored in a binary file which contains the category num bers for each cell The category labels are stored in a text file which contains the cate gory numbers with their respective labels This chapter will look at different aspects of the management of categories Viewing category values The first thing you might wish to do is see which category values are present in your raster file Here is a list of modules you can use for this purpose e r cats Prints category values and labels associated with user specified raster map layers e r describe Prints terse list of category values found in a raster map layer e r what Queries raster map layers on their category values and category labels e d what rast Allows the user to interactively with the mouse query the category contents of multiple raster map layers at user specified locations within the current geographic region e rreport Reports statistics for raster map layers by category e rstats Generates area statistics for raster map layers similar to r report e rstatistics Category or object oriented statistics e runivar Univariate statistics for a GRASS raster map For more information on s
43. authors of the Document well before redistributing any large number of copies to give them a chance to provide you with an updated version of the Document MODIFICATIONS You may copy and distribute a Modified Version of the Document under the condi tions of simplesects 2 and 3 above provided that you release the Modified Version under precisely this License with the Modified Version filling the role of the Docu ment thus licensing distribution and modification of the Modified Version to who ever possesses a copy of it In addition you must do these things in the Modified Version A Use in the Title Page and on the covers if any a title distinct from that of the Document and from those of previous versions which should if there were any be listed in the History simplesect of the Document You may use the same title as a previous version if the original publisher of that version gives permission B List on the Title Page as authors one or more persons or entities responsible for authorship of the modifications in the Modified Version together with at least five of the principal authors of the Document all of its principal authors if it has fewer than five unless they release you from this requirement C State on the Title page the name of the publisher of the Modified Version as the publisher D Preserve all the copyright notices of the Document E Add an appropriate copyright notice for your modifications adjacen
44. bes GIS library routines src display devices display driver src fonts character fonts src front end internal routines for the interactive mode of modules Modules standard tree src display modules for displaying maps on the GRASS monitor src general file management modules src imagery image processing modules src mapdev vector modules src misc miscellaneous modules src paint paint driver PPM 131 Chapter 54 C Programming 132 src ps map postscript driver src raster raster modules src scripts scripts src sites point modules src tcltkgrass Tcl Tk GUI Other modules src contrib contributions of various institutions however many are in standard tree as well src garden modules with linked simulation models and various interfaces The existing GRASS modules are built upon the GRASS programming library which offers a multitude of GIS functions It is structured as follows square brackets contain the typical function name prefixes for the respective library routines GIS library database routines GRASS file management memory management parser string analysis projections etc G_ vector library management of area line and site vectors Vect_ V2_ dig_ raster library raster data management R_ site data library site data management G_sites_ display library graphical output to the monitor D_ driver library
45. cdasusteres 146 MODIFICATIONS isco tots nn 2 822022 Eee an A eet eS 147 COMBINING DOCUMENTS nine cernes 148 COLLECTIONS OF BOE EUMENTS 8 149 AGGREGATION WITH INDEPENDENT WORKS 149 TRANSEATION 2 22 58 man ee ehe nn tat as au 149 TE RMINATION 2 RE 8 222 222 aan an n 149 FUTURE REVISIONS OF THIS LICENSE seaneeenneeennnnennneennnnnennnnn 150 ADDENDUM How to use this License for your documents cccsseees 150 vi Chapter 1 About this tutorial Notes This tutorial or maybe it should rather be calles manual should help you get started with GRASS It gives basic explanations of how GRASS functions and links to the relevant man pages and other documentation Several chapters in this tutorial contain content taken from the english translation of Markus Neteler s GRASS Handbook c 1996 2001 Markus Neteler I have not included explicit references each time I ve used excerpts but it is the most important source of text in these pages 1 http grass itc it 2 http grass itc it gdp handbuch index html Chapter 1 About this tutorial Chapter 2 What is GRASS Notes GRASS Geographic Resources Analysis Support System is a general GIS supporting processing analysis and display of raster vector site and imagery data geospatial simulations and visualization For a general introduction see the GRASS First Time User Page Overview of GRASS versions currently available
46. ce you have started the driver of your choice Or you can use d save to help you create the script file d mon start PNG sh your_text_file d mon stop PNG Often one needs to create several maps with a similar layout In that case it would be quite tedious to retype the same commands over and over again Again the use of a script file can be very helpful here Just change the names and options of the maps to be displayed relaunch the driver and rerun the script But be careful if you do not 119 Chapter 49 Map export to raster image files rename the result at each run of the driver or change the GRASS_PNGFILE variable in the case of the PNG driver your new map will overwrite the previous one If you combine the scripting with the use of d frame you can create quite sophisti cated layouts Here s a very simple example of such a layout script d fram erase any existing frames d erase col white create a white background d fram c frame title at 90 100 0 100 create a title frame echo TITRE d text b size 75 at 45 30 col black write the title d fram c frame map at 10 90 0 100 create a map frame d rast combel draw a raster map d vect arrondissements col red draw a vector map d vect autoroute col violet draw a second vector map d fram c frame legend at 0 10 0 100 create a legend frame echo Cartography M Lennert d text size 20 at 75 50 col black draw text echo Dig
47. cense If a simplesect does not fit the above definition of Sec ondary then it is not allowed to be designated as Invariant The Document may con tain zero Invariant Sections If the Document does not identify any Invariant Sections then there are none The Cover Texts are certain short passages of text that are listed as Front Cover Texts or Back Cover Texts in the notice that says that the Document is released under this License A Front Cover Text may be at most 5 words and a Back Cover Text may be at most 25 words 145 Appendix A GNU Free Documentation License 146 A Transparent copy ofthe Document means a machine readable copy represented in a format whose specification is available to the general public that is suitable for revising the document straightforwardly with generic text editors or for images composed of pixels generic paint programs or for drawings some widely available drawing editor and that is suitable for input to text formatters or for automatic trans lation to a variety of formats suitable for input to text formatters A copy made in an otherwise Transparent file format whose markup or absence of markup has been arranged to thwart or discourage subsequent modification by readers is not Trans parent An image format is not Transparent if used for any substantial amount of text A copy that is not Transparent is called Opaque Examples of suitable formats for Transparent copies include plain ASCI wi
48. chosing between x y Latitude Longitude UTM or another coordinate system This choice depends on your data and the use will make of it e Now one line describing the project area for example Topo Map of the Alps Now some more information about the projection follows Note that the prompts vary from projection to projection e if you chose D Other Projection specify projection name list gives you the list of all available projections examples are tmerc for Transverse Mercator lec for Lambert Conformal Conic moll for Mollweide etc specify ellipsoid name again use list to get a list of available ellipsoids examples are sphere clark80 wgs84 etc if you want you can specify a datum again use list for available options e Enter Central Parallel 0 if you want the Equator as the central parallel e Enter Central Meridian 0 if you want the Greenwich meridian as central meridian Enter Scale Factor at the Central Meridian e Enter False Easting e Enter plural form of units for example meters Chapter 16 Set up your location Next is the description of the boundary coordinates of the project area and the defi nition of the default raster resolution DEFINE THE DEFAULT REGION DEFAULT REGION NORTH EDGE f_ WEST EDGE Q SOUTH EDGE 0 PROJECTION AFTER COMPLETING ALL ANS r lt OR lt Ctrl C gt TO CANCEL The default raster resolution GRID RESOLUTION has to be cho
49. ct scale at the very beginning In this case exit v digit and restart it with the same map Now set the correct scale in the first dialogue Here are some of the more common problems with digitization Lines may not connect properly when either the snapping threshold was set inappro priately or the zoom factor was too small Too short lines are called undershoot too long ones overshoot O Overshoot solution snapping solution v trim Use the snapping function to link the vectors in the case of undershoot Snapping is a function of v digit and v support enter the snapping threshold in accordance to the map scale Run the GRASS module v rm dangles to trim overshoots Note Some people use overshoots deliberately to make sure areas are closed How ever it is necessary to trim these lines afterwards It is common use to create a square 65 Chapter 27 Digitizing Vector Maps 66 neatline around the project area With this method you can vectorize your map and overshoot deliberately as GRASS can trim automatically to the boundaries of the square at a later stage The square is considered part of the area boundary As a general rule always run vsupport in teltkgrass Vector gt Develop map gt Create rebuild topology after v digit to re create the topology of the vector data At this point you may also want to enter the appropriate category texts Edit the category file If
50. e Chapter 48 Introduction GRASS offers several different solutions for cartography none of which are very user friendly in the sense of point and click interfaces but once you get used to them they can be very efficient You can either export a map as a raster file with the CELL and the PNG drivers create a postscript file with the ps map module or create an htmlmap file with the HTMLMAP driver Since GRASS does not offer any interactive layout tools it often advisable to import the output of GRASS into a drawing program allowing a finer control of placements 117 Chapter 48 Introduction 118 Chapter 49 Map export to raster image files To allow you to export what you would normally see on your screen to a raster file there are two alternative monitor drivers to the standard terminal monitors These are the CELL driver and the PNG driver Both are started just like a normal monitor and from that point on all display commands are directed into the resulting raster file and not to a terminal monitor The difference between the two is that the CELL driver creates a GRASS raster file that you then have to export using one of the rout raster export modules whereas the PNG driver directly creates a file outside of GRASS PNG driver The PNG driver has the advantage of exporting directly to an external file Its disad vantage is the fact that it depends on the libpng library which might not always be present on all system
51. e menu C This will load the raster map to the background Now you can open the digitizing menu by pressing D The module v digit is some what self explanatory for more specific information please refer to the CERL v digit tutorial pdf file The Color menu under Customize allows you to change the colors of the digitized objects lines areas This allows for optimized color coding It is important to choose the appropriate type of object area line site by pressing If necessary switch on the auto labelling function This function assigns the cat egory number however it is not yet possible to enter the category text in v digit Because of this you should write down which category number belongs to which ob ject Run the module v support to enter the category labels Edit the category file in tcltkgrass chose Vector gt Develop map gt Edit vector categories Make use of the zoom function to improve your accuracy significantly To avoid confusion Points may be saved as vectors or in GRASS sites format Vectors are usually the result of digitizing points in the GRASS format result from files with coordinates N E and attributes Again it is an important rule to digitize boundaries of adjacent areas only once GRASS automatically assigns this boundary to both areas Never digitize two par allel lines Digitizing Areas Digitizing areas is generally a bit harder and requires mo
52. e a georeferenced data file and know its geographical coordinates If you have a georeferenced raster file but do not know its projection extension or resolution then see the Section called You have a georeferenced raster file but don t know its geographical coordinates If you have a non georeferenced data file example scanned map then see the Section called You have a non georeferenced data file Other see the Section called Other situations You have a GRASS database You have a tar ball tgz tar gz tar with an already prepared GRASS location Here are the steps to follow 1 Enter the GRASS database directory you created above and untar your data file in there e g tar xvzf path to where you downloaded yourdatafile tgz This should create a directory containing the sample location e g spearfish60 with several subdirectories each of these representing a mapset There should be at least one called PERMANENT note the names of the others Don t touch anything in this directory Go back to your home directory cd and start GRASS grass First specify in the Database field the absolute path to the directory you cre ated above e g data GRASSDATA You can now choose the location If you download sampledata it will be spearfish60 Now you should see at least PERMANENT in the mapsets list You can create a new mapset by enter its name in the left field and click on Create button Select
53. e can be used or easting and northing can be typed Modules for site maps e s info Reports attribute label and other information about a sites file e s univar Univariate statistics for a GRASS sites list e s normal Tests for normality for sites Notes ER ON O0 DET U UU N NNNNNNNN N FPR BR RP rR rR rR eB FPF OO ON DF amp NN HT WN DHT FP WN HF Chapter 33 Statistics and Reports http grass itc it gdp html_grass5 html r cats html http grass itc it gdp html_grass5 html r describe html http grass itc it gdp html_grass5 html r info html http grass itc it gdp html_grass5 html r report html http grass itc it gdp html_grass5 html r info html http grass itc it gdp html_grass5 html r sum html http grass itc it gdp html_grass5 html r univar html http grass itc it gdp html_grass5 html r surf area html http grass itc it gdp html_grass5 html d what rast html http grass itc it gdp html_grass5 html r what html http grass itc it gdp html_grass5 html s sample html http grass itc it gdp html_grass5 html r profile html http grass ite it gdp html_grass5 html r transect html http grass itc it gdp html_grass5 html r average html http grass itc it gdp html_grass5 html r median html http grass itc it gdp html_grass5 html r mode html http grass itc it gdp html_grass5 html r statistics html http grass itc it gdp html_grass5 html r vol
54. e distance of the matching point from ideally placed matching point It is calculated through rms x x orig 42 y y orig 1 2 11 http grass itc it gdp html_grass5 html rrast html 12 http grass itc it gdp html_grass5 html d what rast html 13 http grass itc it gdp html_grass5 html g remove html 14 http grass itc it gdp html_grass5 html i rectify html 15 http grass itc it gdp html_grass5 html i group html 16 http grass itc it gdp html_grass5 html i target html 17 http grass itc it gdp html_grass5 html i points html 18 http grass itc it gdp html_grass5 html i rectify html 19 http grass itc it gdp html_grass5 html g region html 20 http grass itc it gdp html_grass5 html d erase html 21 http grass itc it gdp html_grass5 html d rast html 22 http grass itc it gdp html_grass5 html d zoom html 23 http grass itc it gdp html_grass5 html d zoom html 24 http grass itc it gdp html_grass5 html g region html 25 http grass itc it gdp html_grass5 html g region html 26 http grass itc it gdp html_grass5 html r mapcalc html M5 ST DEE 73 Chapter 28 Processing Scanned Maps 74 Chapter 29 Raster Categories and Attributes In the raster data model cell category numbers can be one of two things either they are measurements of real life surface values light intensity in images height in dig ital terrain models slope temperature etc or they represent classes of categories sc
55. e three bands of an RGB image In that case change the color map of these three files to greyscale thus making the intensities of grey represent the intensities of the respective colors using rcolors For each of the three maps type r colors map NameOfYourRaster col grey Then you can use d rgb to display the image d rgb r NameOfYourRasterMap 1 g NameOfYourRasterMap 2 b NameOfYourRasterMap 3 In the GIS Manager go to Raster gt Manage map colors gt Set colors to predefined color tables and chose grey in the list Type of color table Then display with Display gt Display raster maps gt Display RGB overlays For more information see Chapter 23 Zooming and panning Use d zoom for zooming and panning Beware this resets your region settings 1 Getting help You can get help with the g manual command Exiting If you wish to exit GRASS close the open monitors either by clicking on the close button or by using d mon stop x0 replacing x0 with the name of whatever monitor you opened In the GIS Manager go to Display gt Stop displays Then you can simply type exit in the command line and GRASS will close down So much for some very basic GRASS usage For the rest keep on reading this tutorial have a look at the rest of the GRASS Documentation Project and study the GRASS manual pages http grass itc it grass60 manuals html60_user g list html http grass itc it grass60 manuals html60_user g copy html
56. en contour data in vec tor format to floating point raster format using regularized spline with tension e rsurf contour creates a raster elevation map from a rasterized contour map in combination with v to rast 1 http grass itc it gdp html_grass5 html v to rast html http grass itc it gdp html_grass5 html v surf rst html http grass itc it gdp html_grass5 html r surf contour html D 101 Chapter 41 Vector to raster 102 Chapter 42 Vector to Sites The command v to sites allows you to either transform vector points into sites data or using the a flag to create a sites file containing all the vertices of the vector file as sites Notes 1 http grass itc it gdp html_grass5 html v to sites html 103 Chapter 42 Vector to Sites 104 Chapter 43 Sites to raster Notes To transform a sites file into a raster file use s to rast which by default fills one cell per site Depending on the region settings this might be very small so play around with the size option to make them larger You also have different options for interpolation from site data to raster data s surf rst interpolation and topographic analysis from given site data to GRASS floating point raster format using regularized spline with tension s surf idw surface interpolation from sites data by Inverse Distance Squared Weighting s voLrst interpolates point data to a G3D grid volume using regularized spline with tensi
57. end allows you to place and size the legend with the mouse Currently d barscale is your best choice for placing a barscale on your map includ ing a small north arrow If you would prefer a simple line instead of a barscale you can use d scale NOTE this is depreciated as of GRASS 5 3 d barscale 1 does the same thing only better However the latter does not survive a zoom or pan while the former does Furthermore d barscale also gives you the choice of feet miles in stead of meters http grass itc it gdp html_grass5 html d vect area html http grass itc it gdp html_grass5 html d legend html http grass itc it gdp html_grass5 html d mon html http grass itc it gdp html_grass5 html d barscale html http grass itc it gdp html_grass5 html d scale html RS DE 59 Chapter 25 Adding Legends and Scales 60 Chapter 26 Visualize in 3D with nviz For a tutorial on the use of nviz the 3D visualization program for GRASS see here For some examples of what can be done with nviz see here Notes 1 http grass itc it gdp nviz nviz_tut html 2 http grass itc it gdp nviz index html 61 Chapter 26 Visualize in 3D with nviz 62 Chapter 27 Digitizing Vector Maps There are two ways of vectorizing maps AKA digitizing e using a digitizer e digitizing on screen In the first case the map is placed on the digitizer the corners are selected by a mouse click and the respective coordinates entered thro
58. er formats use the appropriate s in module replace the with the name of the format you wish to import Notes 1 http grass itc it gdp html_grass5 html s in ascii html 2 http grass itc it gdp html_grass5 sites html 51 Chapter 21 Sites point data import 52 Chapter 22 Managing GRASS Monitors GRASS map display windows are no normal windows Rather they display geo graphical data with coordinates These windows are called monitors in GRASS and are managed with the d mon command or through the Display gt Monitors menu in TclTkGRASS You can open several different monitors at once Use d mon start to start the moni tor of your choice and d mon select to select the monitor you want to display data on next To stop a monitor use d mon stop or simply click on the closing button pro vided by your window manager You can also resize a monitor the way you would resize any window in your window manager Frames in monitors GRASS offers the possibility to divide a monitor into several distinct frames This gives you the opportunity to create a more sophisticated layout of your maps and other data For example you can create a frame for header information title date etc a frame for the actual map a frame for footer information author sources etc a frame for the legend etc etc The module for frame creation is d frame and it is quite simple to use see the manual page for details d fram c frame
59. et in the scanning software used or obtained through the ImageMagick identify command Start GRASS with an xy location which has been set up according to the size of the scanned map and import it as described earlier The scanned map will now be trans formed by an affine transformation with the i rectify module The affine transfor mation rotates stretches and contracts and is usable for raster data for which the internal orientation should be kept Geocoding of scanned maps Now the rectification of the raw map i e its transformation for geocoding will be performed The process explained here is valid for scanned unreferenced data only We will use the modules i rectify i points and i target modules 69 Chapter 28 Processing Scanned Maps 70 harddrive raw GS data example area Harz region maps without geocoding maps with geocoding scanned biotope map elevation model digital topo map 125000 GRASS moduks for data Import e g import with r in tiff GRASS modules for geocoding i group i terget i points i rectify2 xy location blotope direct import possible due to geocoding GRASS moduks for data Import topo map 9 mit r in gde elewation model 6 9 with rin are a 0 Nequstor topo map elevatlon model geocoded blotope map Gau Kr ger location harzreglon If you have digital already geocoded data and want to change the projection please
60. eve the frustrations that many newbies feel at the first contact with GRASS It will cover GRASS 6 0 so if you have an earlier version consider upgrading This introduction assumes that you have already successfully installed GRASS but that you have not yet launched a GRASS session successfully If you haven t installed GRASS yet please have a look at Chapter 6 For newbies the binary installation is recommended If you are unfamiliar with the UNIX or GNU Linux environment please go to Chapter 5 first and follow some of the links there Before going any further you will have to create the GRASS database 1 Find a place on your disk where you have write access and that has enough diskspace to hold your decompressed data 2 Create a subdirectory that will hold the general GRASS database e g mkdir data GRASSDATA or mkdir home yourlogin GRASSDATA Now you can go on The following subsections will cover different potential scenar ios each representative of the situations in which a new user might turn to GRASS If you have a GRASS database either because someone gave you one or because you downloaded sample data such as the Spearfish sample dataset see here for other data sets then see the Section called You have a GRASS database If you have a georeferenced data file raster vector or sites and know its geograph ical projection its extension and its resolution for raster then see the Section called You hav
61. f the PNG driver Use the Add set button and the Save button to create different types of layouts that you can then reuse with different maps TIP double click on a set to rename it http grass itc it gdp html_grass5 html celldriver html http grass itc it gdp html_grass5 html pngdriver html http grass itc it gdp html_grass5 raster html http www geog uni hannover de grass gdp html_grass5 display html http grass itc it gdp html_grass5 html pngdriver html http grass itc it gdp html_grass5 html celldriver html http grass itc it gdp html_grass5 html d save html http grass itc it gdp html_grass5 html d frame html http grass itc it gdp html_grass5 html d dm html a NN SN TE Gee a a 121 Chapter 49 Map export to raster image files 122 Chapter 50 Postscript Maps Exports The ps map module offers the possibility to create very fine tuned maps in postscript Next to some interesting options that do not exist as display commands in GRASS the great advantage over the raster export drivers is the fact that the postscript format can be transformed into a vector format which allows reworking parts of the file in vector graphics programs see the Section called Editing the resulting postscript file with pstoedit for more details For beginners the possibility of interactive usage of ps map is very helpful but many of its options are not available interactively and it is the
62. ferent images representing different ranges of wave lengths such as red green blue infrared thermal etc There is just one specialized image export model i out erdas which as you might have guessed allows you to create ERDAS files and can export several channels You obviously can also use any of the raster export modules for exporting single channel images Image groups Since most image data comes in multiple channels representing different rqnges of zave lengths GRASS needs to know which raster data files correspond to one image This is what groups are for and groups are created with i group As the man page for this module says i group allows the user to collect raster map layers in an imagery group by assigning them to user named subgroups or other groups This enables the user to run analyses on any combination of the raster map layers in a group Please see the man page for further information about its use Geocoding of images Depending on how much money you can spend the data you dispose of will be geocoded or no For any sensible use geocoding is indispensable so if you can t pay it you ll have to do it yourself If you re part of the upper classes of image processors and in proud possession of geocoded data just relax at the pool while the rest of us goes to work unless you wish to work in a different projection than the one your data comes in If you need help for that please follow the links listed
63. formation contained in the different channels of your image will be reduced to fewer mutually independent newly created variables that can be displayed as im ages GRASS offers the i pca module for this task Another option is a canonical component analysis with i cca Fourier transformation In order to analyze the frequency distributions of your images for example in order to identify periodic noise you can use Fourier transformation In GRASS use the i fft module that implements the Fast Fourier Transform algorithm and constructs the real and imaginary Fourier components in frequency space To recreate a normal image out of the real and imaginary components use i ifft Image filtering You can use filtering to enhance you image for example through contrast improve ment or smoothing or to detect edges You can obviously use rmapcalc to construct any filter you like but GRASS also offers the module r mfilter which allows quite easy construction of sequential or parallel filters possibly several at once If you want to apply frequency filters you can use the fft modules discussed above in combina tion with r circle http grass itc it gdp html_grass5 imagery html http grass itc it gdp html_grass5 raster html http grass itc it gdp html_grass5 html r mapcalc html http grass itc it gdp html_grass5 html i pca html http grass itc it gdp html_grass5 html i cca html http grass itc it gdp html_grass5 h
64. hat the extent of the xy location has to be equal to the extent of the complete area to be scanned Now open an image group for every imported map even if it contains only one map and adjust the transformation target for all of them to the UTM location modules i group and i target The following process Each of the four corner coordinates of the raw maps to be transformed is assigned a UTM coordinate pair i points see preceding section These points must surround a rectangular area as this area will be turned and resized with the affine transforma tion With i rectify as 1st grade polynom the according map will be transformed into the UTM system Do the same with all the other maps in the xy location Once all scanned maps are transformed the result can be checked in the UTM loca tion for that you will have to leave the xy location Restart GRASS and choose the UTM project area Now all individual maps should be checked for their correct posi tioning and orientation base accuracy Open a GRASS monitor and put the region to maximum default value g region d Afterwards it is absolutely necessary to run d erase to inform the graphical subsys tem of the changed coordinates With starting d rast without parameter interactive mode you have the possibility after choosing the file to display to overlay raster images overlay mode yes or flag o This way each file gets displayed after each o
65. he Title of the simplesect and preserve in the simplesect all the substance and tone of each of the contributor acknowledgements and or dedications given therein L Preserve all the Invariant Sections of the Document unaltered in their text and in their titles Section numbers or the equivalent are not considered part of the simplesect titles M Delete any simplesect Entitled Endorsements Such a simplesect may not be included in the Modified Version N Do not retitle any existing simplesect to be Entitled Endorsements or to con flict in title with any Invariant Section O Preserve any Warranty Disclaimers If the Modified Version includes new front matter simplesects or appendices that qualify as Secondary Sections and contain no material copied from the Document you may at your option designate some or all of these simplesects as invariant To do this add their titles to the list of Invariant Sections in the Modified Version s license notice These titles must be distinct from any other simplesect titles You may add a simplesect Entitled Endorsements provided it contains nothing but endorsements of your Modified Version by various parties for example statements of peer review or that the text has been approved by an organization as the authori tative definition of a standard You may add a passage of up to five words as a Front Cover Text and a passage of up to 25 words as a Back Cover Text to the end of the list of
66. his License you may choose any version ever published not as a draft by the Free Software Foundation ADDENDUM How to use this License for your documents To use this License in a document you have written include a copy of the License in the document and put the following copyright and license notices just after the title page Copyright c YEAR YOUR NAME Permission is granted to copy distribute and or modify this document under the terms of the GNU Free Documentation License Version 1 2 or any later version published by the Free Software Foundation with no Invariant Sec tions no Front Cover Texts and no Back Cover Texts A copy of the license is included in the simplesect entitled GNU Free Documentation License If you have Invariant Sections Front Cover Texts and Back Cover Texts replace the with Texts line with this with the Invariant Sections being LIST THEIR TITLES with the Front Cover Texts being LIST and with the Back Cover Texts being LIST If you have Invariant Sections without Cover Texts or some other combination of the three merge those two alternatives to suit the situation If your document contains nontrivial examples of program code we recommend re leasing these examples in parallel under your choice of free software license such as the GNU General Public License to permit their use in free software
67. identify you as the publisher of these copies The front cover must present the full title with all words Appendix A GNU Free Documentation License of the title equally prominent and visible You may add other material on the covers in addition Copying with changes limited to the covers as long as they preserve the title of the Document and satisfy these conditions can be treated as verbatim copying in other respects If the required texts for either cover are too voluminous to fit legibly you should put the first ones listed as many as fit reasonably on the actual cover and continue the rest onto adjacent pages If you publish or distribute Opaque copies of the Document numbering more than 100 you must either include a machine readable Transparent copy along with each Opaque copy or state in or with each Opaque copy a computer network location from which the general network using public has access to download using public standard network protocols a complete Transparent copy of the Document free of added material If you use the latter option you must take reasonably prudent steps when you begin distribution of Opaque copies in quantity to ensure that this Trans parent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy directly or through your agents or retailers of that edition to the public It is requested but not required that you contact the
68. in the terminal first Later the UNIX command texttt history al lows viewing and saving copy paste into a text editor with left and middle mouse button the previously entered commands Here is an example that shall demonstrate the potential of script programming clearly with this script you can calculate general geostatistical information for raster images Save this script as for example statistics sh and set the UNIX permissions with chmod u x statistics sh This script can be used after launching GRASS specify the name of the raster map to be analyzed as parameter A modified version of above script exists in GRASS 5 under the name of r univar In here the output of the GRASS module rstats is trans ferred to the UNIX program awk by UNIX piping represented by the character The calculations are done within awk results are printed on the screen The best way to understand GRASS scripting is definitely by studying the many existing examples Just go to the scripts directory if your GRASS implementation and study some of them cd GISBASE scripts A few GRASS modules will help you in your scripts Those are e g ask for comfortable querying the user for map names from the GRASS database e g findfile to directly find a file in the GRASS database and process it e g gisenv to query for the settings of some of the GRASS environment variable such as GISDBASE LOCATION and MAPSET Study their use in the e
69. inate Systems 94 Chapter 38 Project data Notes In GRASS if you want to change the projection of amap or more precisely create a copy of the map in another projection you have to create a new location see Chapter 16 with the new projection and coordinate system you wish to use Then according to the type of map you can use the following commands to project the map from its original location to the new one e rproj for raster maps v proj for vector maps e s proj for site maps If for any reason a location does not contain projection information stored in the PROJ_INFO and PROJ_UNITS files you can create it with the g setproj command http grass itc it gdp html_grass5 html r proj html http grass itc it gdp html_grass5 html v proj html http grass itc it gdp html_grass5 html s proj html LR ONE http grass itc it gdp html_grass5 html g setproj html 95 Chapter 38 Project data 96 Chapter 39 Raster to Vector Notes There are three modules you can use to convert a raster to a vector map depending on the type of objects you wish to convert Lines If you want to convert raster lines to vector lines you first have to make sure that the raster lines are thin enough to be transformed into only one vector line respectively and not into several parallel lines Thin enough actually means having a width of only one cell The module to use for this operation is r thin Once you have thinned the
70. ined resolution 37 16 Setup your locations 222 2 raitaa a i aeeie aeaa aa ei Saia 39 17 Manage your data i ien iie eE E E E EAN 43 VI Import Data sonare igiene R noia o E NAER ASEE EE o E ENE EERS 45 18 Supported formats se ae a aae Se 45 19 Raster Importe es e EEE aA a E men intestins 47 20 Vector IMmp fte ses arene nern nern nen itasse naase ea eRe heit 49 21 Sites point data Import sn ea 51 VII Display and Query Maps 53 22 Managing GRASS MOmitor sise 53 Frames in Monitors Enr ne nr nannten 53 23 Displ aying M apsa 2222 ee nn ne it nn ERASE ee a ester ere et 55 COlOTS nen Mo ARR A Eos A ee Ee a oe es 55 Scripting the display of maps and frames 55 24 ZOOMING and PANNING sisi msn issu 57 25 Adding Legends and Scales sssssssesenssssesesessesesessssseseecesee 59 26 Visualize in 3D With nviz eeeneeeseesennesennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 61 AVADA EA DIE ai n V A E 63 27 Digitizing Vector Maps 63 Rules for Digitizing in Topological GIS sessnesesesceeeneeceeens 63 Digitizing MAPS ses anne an tn der 63 Digitizing Areas ihai RM nea AMAR ana AEA a genset 64 Digitizing of Elevation Isolines ss 66 28 Processing Scanned Maps 69 Geocoding of scanned maps 69 Gap free geocoding of multiple adjacent scanned maps 72 IX Manage Attributes and Classes sssssssessssssssssscssesssssssesssssssessssessssassensessese
71. ing your finished map after running ps map is in postscript the uni versal printing command language There are not many programs that allow you to edit a postscript file directly well actually there are text editors but unless you are willing to learn the entire postscript command language this won t be of much help to you So you can normally use your postscript file only in the same way you would a raster graphics file i e png or jpeg meaning that you cannot edit individ ual objects of the map only each individual pixel However there is a very handy little free software tool called pstoedit written by Wolfgang Glunz This allows you to transform your postscript file into a host of dif ferent vector formats which you can then edit easily in the relevant vector graphics program For example in order to translate a postscript file into a skencil formerly sketch file just type pstoedit f sk YourPostscriptFile ps ResultingFileName sk Then you can edit the entire map including individual areas lines and points in the skencil program http grass itc it gdp html_grass5 html ps map html http grass itc it gdp html_grass5 html ps map html http grass itc it gdp html_grass5 html ps map html http www pstoedit net pstoedit Slee NO ae http sketch sourceforge net Chapter 51 HTML Maps Exports 125 Chapter 51 HTML Maps Exports 126 Chapter 52 Using external programs for map layout Notes Si
72. ins a notice placed by the copyright holder saying it can be distributed under the terms of this License Such a notice grants a world wide royalty free license unlimited in duration to use that work under the conditions stated herein The Document below refers to any such manual or work Any member of the public is a licensee and is addressed as you You accept the license if you copy modify or distribute the work in a way requiring permission under copyright law A Modified Version of the Document means any work containing the Document or a portion of it either copied verbatim or with modifications and or translated into another language A Secondary Section is anamed appendix or a front matter simplesect of the Doc ument that deals exclusively with the relationship of the publishers or authors of the Document to the Document s overall subject or to related matters and contains nothing that could fall directly within that overall subject Thus if the Document is in part a textbook of mathematics a Secondary Section may not explain any mathe matics The relationship could be a matter of historical connection with the subject or with related matters or of legal commercial philosophical ethical or political po sition regarding them The Invariant Sections are certain Secondary Sections whose titles are designated as being those of Invariant Sections in the notice that says that the Document is released under this Li
73. interval of lines default is 5 base units per line The base unit is usually meter hence it defaults to 5 m After that press c for Label contours and start entering your elevation data Generally if you assign elevation attributes to the outer and inner isolines all the lines in between will be assigned automatically depending on the given interval To get this to work you need to draw a line between the first and the second point of your choice All the isolines that this line crosses receive an attribute containing their elevation GRASS automatically checks if the number of lines matches the chosen interval Take care not to get too close to isolines you don t want to label as the tem porary line allows some tolerance in placement If necessary change the thresholds in the Customize menu press C Select an outer line with the left mouse button e g in a valley and confirm your selection with the middle mouse button Now enter the elevation of this line Then point the mouse to the other side of the lot of lines e g on a hill and again select with Notes Chapter 27 Digitizing Vector Maps the left mouse button confirm with the middle one and enter its elevation Now these two lines are connected by a straight line that crosses all the isolines in between All these lines automatically get assigned the appropriate value In the case the chosen interval and the number of lines do not match GRASS will dis
74. ions called mapsets can be created Often only one mapset as large as the location is used Multiple mapsets may be interesting for working groups Here the PERMA NENT mapset reserved name contains maps common for the group while each team member works in his her own mapset The database is simply called database in GRASS Within the database data is divided into raster vector and site point data allowing differential treatment GRASS Hybrid GIS Raster Vector Point data data data Image DTM N Database processing analysis management 21 Chapter 9 GRASS structure 22 Chapter 10 GRASS commands Notes The command name indicates its use first letter indicates data format or general functionality followed by a dot and a short word indicating the task that the com mand performs d display commands for graphical screen output d rast d vect d sites d mon g general file management commands g list g copy i image processing commands r raster processing commands r slope aspect r mapcalc v vector processing commands v digit v to rast s site processing commands point data s univar s surf rst e m miscellaneous commands m in e00 p ps map creation print commands unix scripts some ending in sh some imitating GRASS module names Almost all modules can be used either directly on the command line module call and parameters together on one line
75. italisation TeleAtlas d text size 20 at 75 30 col black draw more text k d barscale at 10 920 bcolor white tcolor black create a barscale Creating a PNG map from the Display Manager If you are involved in one of those anti command line leagues GRASS offers you a compromise in the form of the Display Manager The interface includes a PNG button which allows you to put into a map png file everything that you see on the screen when pushing the Display button except for legends In addition you have the choice of entering a command instead of a specific map type This allows you to enter any command that you might use in GRASS as for example d frame The script example above would look like this in d dm 120 Notes Chapter 49 Map export to raster image files 0 Display Manager cae 0 7 1 GES c m arame c mams Hie asc eco os c m echo TITLE diext b size 75 at 45 31 c m aframe c frame map at 10 90 0 100 Ea combe W overlay le 1 m arrondissements i Ci m p c m dframe c frame legend at 0 10 0 100 c m echo Cartography M Lennert d text lt c M echo Digitalisation TeleAtlas d text si c d barscale at 10 920 bcolor white tcolo sjsj s elas x0 nv xl VY x2 v x3 v x4 VY KS v XB Display Zoom Pan Query PNG From there just click on the PNG button and you have your map don t forget to rename it or it will be overwritten by the next run o
76. layers e r describe Prints terse list of category values found in a raster map layer e r info Outputs basic information about a user specified raster map layer e rreport Reports acres hectares or number of cells as well as miles meters or kilometer for each category in a raster map layer e r info Generates area statistics for raster map layers Can print total area number of cells percent cover for each category Can also print category value row and column as well as easting and northing for each cell e rsum Sums up the raster cell values e runivar Univariate statistics for a GRASS raster map e rsurf area Surface area estimation for rasters 2 Get information about a single raster map at specific points e d what rast Allows the user to interactively query the category contents of multiple raster map layers at user specified locations within the current geographic region e r what Queries raster map layers on their category values and category labels at specific easting and northing locations which are typed in e s sample Sample a raster file at site locations 3 Get information about a single raster map along transects or profiles e r profile Outputs the raster map layer values lying on user defined line s e r transect Outputs raster map layer values lying along user defined tran sect line s Can output the raw values or the median or average 4 Get informa
77. ll allow you only a very limited usage of GRASS although see here for GRASS on handhelds For a serious usage of GRASS you will need 128MB at the very least Obviously a good video card is a must for cartography ideally with 3D support Basic Software C compiler cc gcc egcs gcc http www gnu org software gcc gec html GNU make is recommended http www gnu org software make make html zlib compression library already installed on modern systems It is used to internally compress GRASS raster files libz http www gzip org zlib lexical analyzer generator flex lex is no longer supported please use flex instead flex http www gnu org software flex flex html parser generator yacc bison bison http www gnu org software bison bison html libncurses4 x 5 x already installed on modern systems http www gnu org software ncurses ncurses html ftp ftp gnu org pub gnu ncurses dgm gdbm dbm h GNU dbm is a set of database routines that use extendible hashing and works similar to the standard UNIX dbm routines Currently not re quired http www gnu org software gdbm gdbm html X11 window system for graphical output development libraries X development libraries in some linux distributions they are separate packages http www xfree org winGRASS As alternative a generic MS Windows driver is under construction which does not require X11 Chapter 4 Hardware and software require
78. ll these functions can also be accessed in Icltkgrass via Region gt Manage region How to change the default region Sometimes you would like to import a map that is larger than or even completely outside of the default region of the existing location You can do that without any problem but in order to visualize it you will have to use g region rast or g region vect in order to adapt the current region to the map However anytime you use g region d the region will be reset to the old setting and your map will not be visible Here s a somewhat quick and dirty solution to this problem hopefully g region will be modified to include this as an option one day open a monitor see Chapter 22 display all you maps see Chapter 23 zoom and pan until you can see all you maps in the screen if you know that the extension of one map englobes all the others you can also use g region rast or g region vect followed by d erase before displaying all your maps Once you are sure that the currently active region contains all your maps you can make it into the default region as follows e Begin by making a backup copy of your default region cp GISDBASE LOCATION_NAME PERMANENT DEFAULT_WIND Notes Chapter 12 The GRASS Region default_region bak If anything goes wrong you can reset to your old default region with c default_region bak GISDBASE LOCATION_NAME PERMANENT DEFAULT_WIND e Make the current region into the default region
79. mapset search path and location to the appropriate element directories under the user s current mapset e g remove Removes data base element files from the user s current mapset If you wish to deal with an entire location you will have to do so by hand after having left GRASS In order to remove a location with the name location_name go to the directory that contains this location i e the GRASS database directory and use the com mand rm rf location_name This will irrevocably erase all the data so be careful In order to copy a location with the name location_name to another directory or another machine go to the GRASS database directory and use the command tar cvf location_name tar location_name to package the entire directory into one file You should then compress this file with gzip location_name tar or bzip2 loca tion_name tar Copy the resulting file to the new location Be aware however that user and group settings gid and uid might get mangled so be prepared to change those with chown In order to access maps within the same location but in another mapset you have to set your mapset search path If you do not wish some of your data to be accessible for everyone you can limit the access to a particular mapset you own e g mapsets Modifies the user s current mapset search path affecting the user s access to data existing under the other GRASS mapsets in the current location e g access Contr
80. mation module i rectify with a 1st grade polynom as order of transformation This will perform the linear transformation First the image group to be transformed in this case map1 and the name of the new file s are prompted Now choose 1 as the order of transformation Finally you will be asked if you want to transform into a the current location or b the minimal region Here you must choose menu point 1 which is equivalent to the complete UTM location Otherwise only the current active part of the UTM location would be transformed which could be a cut of the complete area 71 Chapter 28 Processing Scanned Maps 72 The computation time for an A4 size map 21x29 7cm scanned with 300dpi is on a SUN SPARC 25 close to five minutes A Linux PC above 200MHz works faster As UNIX is capable of multitasking you can go on working with GRASS or even leave it while the computation runs in the background After the transformation has finished i rectify sends an email then the success should be checked in the target location if you did not do it yet leave and restart GRASS now exit the xy location and start it again in the UTM location After starting a GRASS monitor the trans formed map can be displayed with d rast The d what rast module allows in combination with the magnification of single map areas see Chapter 24 to check the coordinates of the reference crosses These should of course c
81. ments Optional software Tcl Tk 8 x libraries they include wish to use TcITkGRASS Interface and to com pile src contrib GMSL NVIZ2 2 http tcl sourceforge net Mesa 3 x openGL clone required for NVIZ2 2 if your OS graphic card libraries don t come with own OpenGL libraries http mesa3d sourceforge net FFTW library for computing the Discrete Fourier Transform required for i fft and Lifft modules http www fftw org LAPACK BLAS libraries for numerical computing required for GMATH library GRASS numerical lib http www netlib org lapack usually present in Linux distros Note the support is intended for future module implementations libpng for r in png r out png usually already installed gt http www libpng org pub png libpng html libjpeg for r in tiff r out tiff usually already installed http www ijg org ftp ftp uu net graphics jpeg libtiff for r in tiff r out tiff usually already installed http www libtiff org libgd for PNG driver preferably GD 2 x http www boutell com gd netpbm tools libraries for r in png r out png usually already installed please look at any decent software mirror near you http netpbm sourceforge net http www sourceforge net projects netpbm PostgreSQL libraries for the PostgreSQL database interface http www postgresql org Unix ODBC for the ODBC database interface http www unixodbc org Notes NON NY NNN
82. minal window where GRASS has been started This concept allows the use of the entire might of UNIX and the programming of powerful procedures while working with GRASS Newcomers to GRASS might have to get used to this structure but they will quickly realize its advantages In GRASS GIS data are stored in a directory structure Before beginning to work with GRASS the user has to create a GRASS data subdirectory called GRASS database and specify it later within GRASS In this directory GRASS organizes its data au tomatically through subdirectories A new subdirectory tree is created for each new project called location within the database The organisation of the data should be left to GRASS All file operation such as renaming or copying maps involve several internal files and should thus always be done only with GRASS commands Man ual interventions are acceptable just in exceptional situations The GRASS graph ical output in other words the map display window is no normal window but displays geographical data with coordinates This graphical output window called GRASS monitor can be managed with the GRASS d mon command Additonally TclTkGRASS allows the configuration and management of these windows A few more words about GRASS terminology as mentioned a project area is called location in GRASS It is defined by its geographical boundaries with information about coordinates and the map projection Within this location area subsect
83. nce GRASS is specialized in geographical information management and not in graphical layout it is often necessary to rework the resulting maps in a real graphics program Several such programs exist in the free software world and you will just have to choose the one you prefer personally We can divide them into those that use formats that you can transform your postscript file into using pstoedit see the Section called Editing the resulting postscript file with pstoedit in Chapter 50 therefore allowing direct editing and those that can only import non editable raster files e g PNG Editable vector import e Skencil e XFig e Other suggestions Non editable raster import OpenOffice Draw Toif e Other suggestions http www pstoedit net pstoedit http sketch sourceforge net http www xfig org http www openoffice org product draw html http bourbon usc edu 8001 tgif index html ara Don 127 Chapter 52 Using external programs for map layout 128 Chapter 53 Scripting GRASS Scripts The possibility to automate individual steps is a very useful extension even for GRASS beginners These scripts have to be written in ASCII format as UNIX shell scripts Within those scripts GRASS modules can be called with their respective pa rameters and geostatistical computations can be done automatically Especially for novices it is a good idea to generate scripts step by step trying the commands on command line
84. nform It is important not to change the image size since that would alter the scales within the image It is recommended to work with a scanning resolution somewhere between 150 and 300 dpi color image with 256 colors with labels on the map being legible The raster resolution within GRASS GRID RESOLUTION of the location is derived from that Here is an example of how to calculate the resolution of a square location Let us assume a scanning resolution of 300dpi 300dpi 300 rows 2 54cm 118 11 rows cm Let the scale of the scanned map be 1 25 000 Thus one centimeter on the map is equivalent to 25 000cm in nature Now let us calculate which distance in nature cor responds to the length of a raster cell distance in nature scanned rows per cm 25 000cm 118 11 rows 211 6 cm row 2 12 m row 37 Chapter 15 Planning and constructing a GRASS database Notes 38 This value of 2 12m has to be entered as GRID RESOLUTION Grid resolution during the creation of the location If you want the GRID resolution to be a whole number you have to calculate backwards and change the scan resolution respectively Nor mally you should be able to chose this resolution freely up to a maximum value 1 http netpbm sourceforge net 2 http www imagemagick org Chapter 16 Set up your location To specify your new location gather out the following information e coordinate system for your project area plane or with projection
85. ol access to the current mapset http grass itc it gdp html_grass5 html g list html http grass itc it gdp html_grass5 html g rename html http grass itc it gdp html_grass5 html g copy html http grass itc it gdp html_grass5 html g remove html http grass itc it gdp html_grass5 html g mapsets html ae DE http grass itc it gdp html_grass5 html g access html 43 Chapter 17 Manage your data 44 Chapter 18 Supported formats Import modules Export modules Notes 1 http grass itc it gdp html_grass5 import html 2 http grass itc it gdp html_grass5 export html 45 Chapter 18 Supported formats 46 Chapter 19 Raster Import Notes The module r in gdal offers a common interface for many different raster formats Try this first especially since it also offers such practical options as on the fly location creation or extension of the default region in order to adapt it to the imported file If r in gdal does not suit your needs use the appropriate r in module replace the with the name of the format you wish to import After the import you will probably want to run r support in order to modify or create the GRASS support files For importing scanned maps you will need to create a x y location according to the instructions in Chapter 15 scan the map in the desired resolution and save it into an appropriate raster format e g tiff jpeg png pbm and then use r in gdal to import it Y
86. on RST algorithm http grass itc it gdp html_grass5 html s to rast html http grass itc it gdp html_grass5 html s surf rst html http grass itc it gdp html_grass5 html s surf idw html http grass itc it gdp html_grass5 html s vol rst html He ee 105 Chapter 43 Sites to raster 106 Chapter 44 Sites to vector Notes Several modules allow you to create vector files from site files e s to vect converts a site_lists file into a vector file s voronoi uses a sites list to produce a Voronoi diagram as a vector file e s delaunay creates a vector delaunay triangulation from a sites file e s hull uses a sites list to produce a convex hull vector map http grass itc it gdp html_grass5 html s to vect html http grass itc it gdp html_grass5 html s voronoi html http grass itc it gdp html_grass5 html s delaunay html http grass itc it gdp html_grass5 html s hull html Pe GI or 107 Chapter 44 Sites to vector 108 Chapter 45 Preprocessing Images Import and export of imagery data Imagery data is raster data so you can import it with the infamous r in gdal module Especially its capacity to create a new location on the fly is very helpful in this con text Other more specialized import modules exist such as i in erdas r in bin etc In general try r in gdal first and if that doesn t work try the rest Since image data is recorded at different wave lengths it is often split into dif
87. on that is appropriate for this data Here s what you can do 1 Check here if the format your file is in can be imported and georeferenced by GDAL If it can t see if you can convert it to any of the supported formats If that is not possible you re out of luck and will have to move on to the Section called Other situations Start GRASS grass Click on Create New Location A N In the terminal screen you see enter a name for a temporary location e g LOCATION temp leave the mapset at its default your login name and set the database to the directory you created at the very beginning e g data GRASSDATA When told that the LOCATION temp doesn t exist and asked whether you would like to create location temp you answer yes please well actually you just press y O1 6 You press y again pretending that you have all the information listed on the next screen as being absolutely necessary 7 When asked to specify the coordinate system chose a for x y and then y or just ENTER for yes 8 Enter a description of your location such as temporary x y location for im port press ENTER and confirm your beautiful title with y or ENTER 9 Don t even look at the next screen entitled Define the default region just press ESC ENTER to get it out of your sight as quickly as possible Again confirm your choice with y or ENTER plus another
88. or composite created with i composite 115 Chapter 47 Classifying Images Notes 116 and identify homogenous areas in this map The spectral signatures of these ar eas will then be saved and can then be used as classes in i maxlik classification This is the same as for the unsupervised classification use i maxlik for this step Partially supervised classification An intermediate path between the two above option is the use of i gensig This mod ule crates the spectral signatures automatically for you based on a training map you provide This training map should contain already classified training areas You can create a training map using v digit or r digit or by extracting relevant features with v extract or rmapcalc http grass itc it gdp html_grass5 html i group html http grass itc it gdp html_grass5 html i cluster html http grass itc it gdp html_grass5 html i maxlik html http grass itc it gdp html_grass5 html i class html http grass itc it gdp html_grass5 html i composite html http grass ite it gdp html_grass5 html i maxlik html http grass itc it gdp html_grass5 html i maxlik html http grass itc it gdp html_grass5 html i gensig html http grass itc it gdp html_grass5 html v digit html 10 http grass itc it gdp html_grass5 html r digit html 11 http grass itc it gdp html_grass5 html v extract html 12 http grass itc it gdp html_grass5 html r mapcalc html 0 09 SN GS D
89. or the area your data is supposed to cover For example UTM is widely used in North America while Gauss Krueger is often used in Europe A lot of the basic shapefiles given out by ESRI are in latitude longitude projection You might want to try the latter first and see how the data looks Is it distorted Are vector areas not closed You can also start by creating a simple x y location see the Section called You have a georeferenced raster file but don t know its geographical coordinates on how to create such a location Import your data with the appropriate module see Part VI in Grass Tutorial and then explore it with the commands explained in Chapter 8 Good luck http grass itc it sampledata spearfish_grass60data tar gz http grass itc it download data php http www remotesensing org gdal formats_list html http grass itc it grass60 manuals html60_user r in gdal html If you compiled GRASS yourself be sure to also have installed the 6 http www remotesensing org gdal otherwise r in gdal will not work This is also true for v in ogr that require OGR libraries http www remotesensing org gdal http grass itc it grass60 manuals html 0_user v in ogr html http www gdal org ogr http grass itc it grass60 manuals html60_user raster html Chapter 8 The Most Important Commands to Get Started So you ve managed to create a GRASS database and location and to import some data and now you want to actuall
90. orrelate with the equivalent ones on the printed map Otherwise the rms error was probably too high Correcting is possible by reassigning single points in the xy location In this case the transformed map in the UTM location should be deleted with r remove as it will be remade in the new transformation Subse quently transform with i rectify as described above The result should again be checked If the transformation was successfull then the xy location which is now not needed anymore can be deleted see Chapter 17 for how to do this Gap free geocoding of multiple adjacent scanned maps The transformation described in the preceding section can be used for importing sev eral adjacent scanned maps without gaps Access to drum scanners will exist only in rare cases but normal maps are to large for customary scanners A usable solution is the scanning of maps in multiple parts This solution requires some more expense but spares the purchase of an expensive scanner large scale scanner It is very important to scan with overlapping borders as this will improve the fixing of matching points As described above a target location has to be set up in the target coordinate system large enough to cover the complete area to be scanned The resolution should be chosen sufficiently high to display the smallest conventional sign All scanned raw maps are imported into the xy location subsequently Please pay attention to the fact t
91. ou will probably have to recify it in order to obtain geocoded data Chapter 28 contains more information about this process http grass itc it gdp html_grass5 html r in gdal html http www remotesensing org gdal formats_list html http grass itc it gdp html_grass5 raster html S ID S http grass itc it gdp html_grass5 html r support html 47 Chapter 19 Raster Import 48 Chapter 20 Vector Import Notes For vector import use the appropriate v in module replace the with the name of the format you wish to import There is no common interface for different formats yet After the import you have to run v support in order to build the relevant GRASS support files Some of the vector import modules run this automatically for you so check the relevant man page 1 http grass itc it gdp html_grass5 vector html 2 http grass itc it gdp html_grass5 html v support html 49 Chapter 20 Vector Import 50 Chapter 21 Sites point data import The easiest way to profit from the new multi dimension and multi attribute site for mat in GRASS 5 0 is to create the file yourself You can find details about the for mat in the s in ascii man page Once you have created the file you can import it into GRASS by copying it directly into your mapset cp NameOfYourSitesFile GISDBASE LOCATION_NAME MAPSET site_lists you have to be in a run ning GRASS session for this command to work For site import from oth
92. phic Resources Analysis Support System xX X XX XX K XX K K K K K K KM 135 Chapter 55 Digital Terrain Models 136 Chapter 56 Topographical analysis GRASS Geographic Resources Analysis Support System xX X XX XX K XX K K K K K K KM 137 Chapter 56 Topographical analysis 138 Chapter 57 Cost Surfaces GRASS Geographic Resources Analysis Support System xX X XX XX K XX K K K K K K KM 139 Chapter 57 Cost Surfaces 140 Chapter 58 Creating Animations GRASS Geographic Resources Analysis Support System xX X XX XX K XX K K K K K K KM 141 Chapter 58 Creating Animations 142 Chapter 59 Bibliography GRASS Geographic Resources Analysis Support System See GRASS Documentation project Books and tutorials Major parts of this tutorial have been translated and updated from the book Neteler M 2000 GRASS Handbuch Der praktische Leitfaden zum Geographis chen Informationssystem GRASS Geosynthesis 11 Geographisches Institut der Uni versit t Hannover 247 S ISBN 3 927053 30 9 A GRASS beginners tutorial in German language Search with CiteSeer published GRASS papers Notes http grass itc it index html http grass itc it gdp index html tutorials http grass itc it gdp handbuch index html http citeseer nj nec com cs q grass gis BE OS 143 Chapter 59 Bibliography 144 Appendix A GNU Free Documentation License Copyright C 2000 2001 2002 Free Softwa
93. play an error warning message and stop the process If this happens please count again or choose smaller steps http grass itc it gdp html_grass5 html v digit html http grass itc it gdp html_grass5 html v digit html http grass itc it gdp vector digit pdf http grass itc it gdp html_grass5 html v support html http grass itc it gdp html_grass5 html v rm dangles html http grass itc it gdp html_grass5 html v support html http grass itc it gdp html_grass5 html v spag html http grass itc it gdp html_grass5 html g copy html http grass itc it gdp html_grass5 html v clean html 10 http grass itc it gdp html_grass5 html v prune html SOOO TON OT A IDEE 67 Chapter 27 Digitizing Vector Maps 68 Chapter 28 Processing Scanned Maps In order to process a scanned map you first have to import it probably with r in gdal into an x y location prepared according to the calculations in Chapter 15 Then you can rectify it in order to obtain geocoded data Don t forget to use g region to make sure your map is correctly displayed and treated g region rast NameOfYourRaster Map In this section the rectification of a scanned map to its topographic reference will be explained For better understanding you should read the Section called General definition of a project area when using scanned maps in Chapter 15 Commonly such files are stored in TIFF PNG or other formats The amount of rows and columns can be s
94. ps All the commands are listed and explained on the manual page so we won t cover those here Be sure to look at the example script at the end of that page However here are some tips that might help you e One frequent source of error is the omission of an end statement at the end of a command block Always include these as they also help you make your script more readable In the same line use comments in your file to explain what you are doing com ments are anything written after a character and use line spaces to make it readable e In general you can trust ps map to place items correctly so only use the where if you are not satisfied with the automatic placements If you use the colortable command on a raster file with many different values try the cols option in order to get all your classes onto the map e As one of the hidden treasures of GRASS there is a ps map barscale module that creates a GRASS vector file and a ps map script file for a barscale Just launch the command answer the questions and include the resulting script file into your gen eral ps map script file possibly with the read command Generally all you have to do once you have a script ready is launch ps map as fol lows 123 Chapter 50 Postscript Maps Exports Notes 124 ps map in NameOfYourScriptFile out NameOfThePSFile Easy isn t it Editing the resulting postscript file with pstoedit The file contain
95. r To go on to the next screen of the editor type ESC RETURN again To finish just type end at the Next category prompt You might wish to automate the assigning of labels Here s an example of how you could use r stats and r reclass to assign the total area size in square meters of each category to each cell of that respective category r stats qan in map awk printf d d d sq meters n 1 1 2 r reclass in map out newmap http grass itc it gdp html_grass5 html r cats html http grass itc it gdp html_grass5 html r describe html http grass itc it gdp html_grass5 html r what html http grass itc it gdp html_grass5 html d what rast html http grass itc it gdp html_grass5 html r report html http grass itc it gdp html_grass5 html r stats html http grass itc it gdp html_grass5 html r statistics html http grass itc it gdp html_grass5 html r univar html http grass itc it gdp html_grass5 html r reclass html http grass ite it gdp html_grass5 html r recode html http grass itc it gdp html_grass5 html r rescale html a OT ID e e e Ne http grass itc it gdp html_grass5 html r rescale eq html m es http grass itc it gdp html_grass5 html r rescale inf html rm gt http grass itc it gdp html_grass5 html r mapcalc html m O1 http grass itc it gdp html_grass5 html r clump html m ion http grass itc it gdp html_grass5 html r support html m
96. r example map1 e Mark the map to be imported with a x e Leave module i group with return b Indicate the target location and mapset into which the UTM location should be transformed in i target c Start a GRASS monitor d mon x0 d Assign the UTM coordinates to the four corner points of the image to be trans formed i points Prompt the image group to be transformed contains only the map in this example map1 Change to the GRASS monitor Here display the imported map Using the mouse select as precisely as possible the first reference cross first corner point of the image to be transformed Enter the related UTM coor dinate at the command line the related easting and northing as taken from the printed map delimited by blanks The ZOOM function is quite useful for this allowing to find the matching points more easily With help of the Analyze component you can check the rms error It should not be higher than the GRID RESOLUTION of the UTM location All partial errors one for every matching point are added up into an over all error Is this one to large you can adjust it with resetting and reassigning of single matching points In the Analyzes window double click the point concerned for to delete it Afterwards reassign it to reduce the rms error Are all four points assigned sufficiently correct leave i points all assigna tions will be saved automatically e Now start the transfor
97. rass itc it gdp html_grass5 html r patch html http grass itc it gdp html_grass5 html r mapcalc html http grass itc it gdp html_grass5 html r combine html http grass itc it gdp html_grass5 html v patch html http grass itc it gdp html_grass5 html v cutter html OR DD OS 87 Chapter 34 Overlay and Patch Maps 88 Chapter 35 Create Buffers Notes Look at e rbuffer Creates a raster map layer showing buffer zones surrounding cells that contain non NULL category values GRASS5 0 does not have a buffer function for vector data 1 http grass itc it gdp html_grass5 html r buffer html 89 Chapter 35 Create Buffers 90 Chapter 36 Raster map algrebra with r mapcalc Notes r mapcalc performs arithmetic on raster map layers New raster map layers can be created which are arithmetic expressions involving existing raster map layers integer or floating point constants and functions Please read the tutorials a bit outdated but still valid for most of the basic opera tions 1 http grass itc it gdp html_grass5 html r mapcalc html 2 http grass itc it gdp html_grass5 Postscript 91 Chapter 36 Raster map algrebra with r mapcalc 92 Chapter 37 Coordinate Systems Notes Introduction to projections and coordinate systems From the r proj man page Map projections are a method of representing information from a curved surface usually a spheroid in two dimensions typically to allow inde
98. raster lines you can use r line to transform the raster data into vector data Don t forget to run v support after r line The quality of the resulting vector lines depends on the resolution of the original raster data Areas For transformation of raster areas into vector area lines you can use r poly If you use the option the module will smooth the corners to avoid the blocky appearance of raster areas Be aware that depending on the resolution of the raster map and of the original data this smoothing might induce a certain error Again don t forget to run v support after the transformation The cell category values for the raster map layer will be used to create attribute information for the resultant vector areas Contours You can transform a raster surface into vector isolines or contours with the r contour module If you just give it the interval between lines step command line option it automatically determines the other values You can also define a fixed series of levels at which you would like to see isolines levels option The module automatically runs v support for you so you don t have to worry about that http grass itc it gdp html_grass5 html r thin html http grass itc it gdp html_grass5 html r line html http grass itc it gdp html_grass5 html v support html http grass itc it gdp html_grass5 html r poly html http grass itc it gdp html_grass5 html v support html DSR Gos IS a ht
99. re Foundation Inc 59 Temple Place Suite 330 Boston MA 02111 1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed PREAMBLE The purpose of this License is to make a manual textbook or other functional and useful document free in the sense of freedom to assure everyone the effective free dom to copy and redistribute it with or without modifying it either commercially or noncommercially Secondarily this License preserves for the author and publisher a way to get credit for their work while not being considered responsible for modifi cations made by others This License is a kind of copyleft which means that derivative works of the docu ment must themselves be free in the same sense It complements the GNU General Public License which is a copyleft license designed for free software We have designed this License in order to use it for manuals for free software because free software needs free documentation a free program should come with manuals providing the same freedoms that the software does But this License is not limited to software manuals it can be used for any textual work regardless of subject matter or whether it is published as a printed book We recommend this License principally for works whose purpose is instruction or reference APPLICABILITY AND DEFINITIONS This License applies to any manual or other work in any medium that conta
100. re practice For this reason we will explain setting of attributes in more detail Choose the vector types in the Digitize menu of the v digit module Press t to toggle the type between LINE AREA EDGE SITE It is mandatory to close areas because only then you can create the GIS vector topol ogy and assign label points Since it is nearly impossible to hit line ends exactly the snapping function allows the closing of areas Chapter 27 Digitizing Vector Maps label point unsnapped vector i is Snapping area successfully closed vertices line Under Customize in the main menu of v digit you can adjust the snapping thresh old s Set snapping threshold After setting it to a reasonable value the nodes will automatically snap to close the area Only after connecting all nodes your area will be recognized as such The snapping threshold should be chosen appropriately for the scale of the map You have to enter the value in inches but it will be automatically converted to the metric units of the map Here are some examples e For 1 5 000 1 10 000 Snap distance 1 2m Value in Inches in the menu 0 0017 to 0 002 e For 1 10 000 1 25 000 Snap distance 2 5m Value in Inches in the menu 0 002 to 0 008 e For 1 25 000 1 50 000 Snap distance 5 10m Value in Inches in the menu 0 008 to 0 017 Note GRASS will not display a useful value in the menu if you did not enter the corre
101. real resolution that has been determined through the scanning resolution and the map scale is relevant only during the transformation into the new projection location If the map can only be scanned in several parts due to its size all map parts are to import into the same xy location This xy location has to be created large enough in order to hold all parts i e you will have to choose its size according to the largest scanned map part Since locations sizes can be freely chosen in GRASS you can de fine an even larger location just to be sure To find out the size of your scanned raw map in pixels you can use the ImageMagick program mentioned in the previous section You should by now have created two locations one xy location for the raw map and one projected location into which the raw map shall be rectified i e geocoded You will find the instructions on how to import and rectify the scanned map in Chapter 28 Definition of a project area with predefined geographical resolution This method for the creation of a location supposes that the boundaries of the project area are known and the scan parameters have to be adapted for a map that is to be scanned and that can be scanned with no or negligeable errors The number of raster cells in a location results from the length and width of the project area as well as the resolution chosen according to the required precision of the results resolution grid resolution GRID RESOLUTIO
102. refore recommended to cre ate a script file with the instructions once you are familiar with the general concept Interactive usage For newcomers to ps map this is the best way to begin to learn the usage of ps map Just answer the questions and be sure at the end to answer y to the question do you want to save the script file y n This will allow you to look at a script file in order to learn from it and adapt it for more fine grained control see next subsection In order to visualize your map use the postscript viewer of your system ghostview gv etc Scripted usage This is where the entire power of ps map really comes to play Just have a look at all the commands listed on the manual page and you will get an idea of the possi bilities offered Having to write commands into a script file might seem a bit scary to some and definitely seems a bit outdated in our times of point the mouse and let the computer do the rest for you but once you understand the basic principles of ps map and once you have one or two finished script files at hand created for example through interactive usage of ps map you will soon feel the convenience of just typing a few commands to create a very decent layout for your maps This is also very practical when you work in a team as you can create one template script which will create the same layout for everyone and in which each team member only has to add a few commands to draw her ma
103. s although it should be on many Its usage is very simple d mon start PNG any display commands d mon stop PNG This creates a file map png in the current directory containing all the layers that you drew with the display commands You can use environmental variables to set options such as an alternative file name the resolution of the resulting image the background color etc Please the manual page for more details CELL driver The CELL driver is a bit more complicated to use as it requires the extra step of exporting the resulting CELL file to an external raster file It has the advantage how ever of using internal GRASS routines and therefore not being dependent on exter nal libraries Other than that its usage is exactly the same as the PNG driver See the manual page for details and differences Very important before exporting the D_cell raster file which is the output of the CELL driver you will have to set the region to cover this file otherwise your export results will be empty g region rast D_cell Scripting the creation of maps By definition you will not see the results of your display commands when you direct them into one of the above drivers You therefore might want to test your commands in anormal monitor before or test in the Display Manager see the Section called Cre ating a PNG map from the Display Manager below You can then enter all the commands into a text file which you can then launch on
104. s to be scanned Bach map scale will result in a different resolution The latter has to be cho sen big enough in order to keep small map texts legible While scanning it is almost impossible to achieve the exact number of rows and columns and a perfect orien tation of the map In this method one is therefore obliged to rework the scanned map with imaging software as for example the netpbm tools which you can find at http netpbm sourceforge net Now we will look at an alternative method for the definition of the project area de pending on the data that is to be processed Definition of the project area without a previously defined resolution This third method for creating a location is to be used when the resolution within the location location can be chosen freely in function of a scanned map or any other given data Here the parameters of the location are derived from the data scanning The image to be imported and the location must have the same number of raster rows and columns You can find out these values with the help of the ImageMagick program available at http www imagemagick org Use its identify command or open the scanned map right click on it and chose Image Info Which distance in nature corresponds to which length of a raster cell is determined by the chosen scanning resolution This values needs to be entered as the GRID RES OLUTION during the creation of the location see coordinates entry form on page locatio
105. sen according to the needs Generally it is advisable to work in steps of 0 25 0 25 0 5 1 75 2 00 12 25 etc This resolution does not concern vector and site data since these are stored with their exact coordinate values Note that every raster map may have its own resolution You can leave this screen with ESC RETURN and then accept the list of parameters that appears if everything is correct You will get back to the startup screen again to enter the mapset s name if not al ready entered Another ESC RETURN will finally let you leave this screen This mapset is created within the new location by answering yes to the next question The mapset will use the parameters of the location such as the region and resolution definitions as its default parameters Now the project area i e the location including a mapset has been created You have arrived in the GRASS system and can start working within this new location Notes 1 http grass itc it gdp html_grass5 projections html 41 Chapter 16 Set up your location 42 Chapter 17 Manage your data Notes Different commands allow you to list copy rename or erase data within the current location e g list Lists available GRASS data base files of the user specified data type to stan dard output e g rename Renames data base element files in the user s current mapset e g copy Copies available data files in the user s current
106. ssseses 75 29 Raster Categories and Attributes ss 75 Viewing category values 75 Changing category values 75 30 Vector Categories and Attributes ss 77 Viewing category values 77 Changing category values at 77 31 Site Attnib lese nn ee einsamen 79 32 Data Management with PostgreSQL 81 X Analyze Maps eceseseeneenenenenensnenenonsnsnsnnnnnsnnnnnnnnnennnnsnensnsnsnenenenenenenenensssnsnensnsssnsnsnsnnsnnnne 83 33 Statistics and Reports see na ER tartes 83 Modules for raster maps 83 Modules for vector Maps 84 Modules for site Maps 84 34 Overlay and Patch Maps ss 87 35 Cre te Buffers nine Re MO Behl RO RL ER RE 89 36 Raster map algrebra with rmapcalc 91 XL Trans oi ER EE cran done Sd 93 37 Coordinate SYSTEMS set nintendo ts 93 Introduction to projections and coordinate systems ccccscce eee eee 93 Projections in GRASS ss 93 38 Project data 2a A nn nn rene sr 95 39 Raster tO Vector tin in Re TE ESE E TEE 97 Eines 22 en N ET Se Se Gs oo te ses es dete 97 Areas wann gelegt eher see 97 CONOUrS 2 a need Ren Mates cas Oe ee den male 97 AD Raster to Sites hit ine lassen Sees E let ren ein Teen 99 41 V ctor to Taster een nt inner 101 42 Vector to SUES sister mnt isa tant is nl cd teint vis et dl 103 43 Sites tO raster 2 ire area te vadevachaviae betdecs ston E TEE en des 105 AE Sites to Vector ss nn SEN RE ES RES
107. t to the other copyright notices F Include immediately after the copyright notices a license notice giving the public permission to use the Modified Version under the terms of this License in the form shown in the Addendum below G Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document s license notice H Include an unaltered copy of this License I Preserve the simplesect Entitled History Preserve its Title and add to it an item stating at least the title year new authors and publisher of the Modified Version as given on the Title Page If there is no simplesect Entitled History 147 Appendix A GNU Free Documentation License 148 in the Document create one stating the title year authors and publisher of the Document as given on its Title Page then add an item describing the Modified Version as stated in the previous sentence J Preserve the network location if any given in the Document for public ac cess to a Transparent copy of the Document and likewise the network loca tions given in the Document for previous versions it was based on These may be placed in the History simplesect You may omit a network location for a work that was published at least four years before the Document itself or if the original publisher of the version it refers to gives permission K For any simplesect Entitled Acknowledgements or Dedications Preserve t
108. tatistics and reports see Chapter 33 Changing category values You have to distinguish between changing the category values of amap and changing the category labels Actually the first is not really possible without creating a new map dropping the old one and renaming the new one to the old one s name You can do the latter directly on a map In order to create a new map by changing the category values of an already existing one you can use the following modules e rreclass Creates a new pseudo map layer whose category values are based upon the user s reclassification of categories in an existing raster map layer e r recode Creates an output map layer based on an input raster map layer e r rescale Rescales the range of category values in a raster map layer also see r rescale eq and r rescale inf e r mapcalc Raster map layer data calculator see Chapter 36 for more detailed information e rclump Recategorizes data in a raster map layer by grouping cells that form physically discrete areas into unique categories For changing the category labels of a raster map use r support Enter y when you get to the question Edit the category file for mapname You will get to a screen 75 Chapter 29 Raster Categories and Attributes Notes 76 showing the highest category number You normally don t want to change that so just go on by typing ESC RETURN to enter the category table edito
109. te lines of the projection system This means that you cannot use the paper edges as location edges Before rectifying the raw map you should first create the location in the actual projec tion system you will be using for your map with the required geographical bound aries and resolution see Chapter 16 Any projection supported by GRASS may be used You should watch out that the resolution of the target location is not too low since that could cause the digital map to be quite illegible depending on the scale It is therefore worthwhile to begin by calculating the transformation between scan ning resolution and geographical resolution Once the new location has been created you have to leave GRASS again in order to restart it for the creation of the xy location GRASS cannot switch between locations on the fly yet Later the rectification module will transfer the map that has been imported into this xy location to the new location and adapt the orientation and the resolution according to the parameters of this projection Now the xy location needed for the scanned raw map has to be created It has to have an extension of at least the number of pixels of the imported map in both directions x and y The resolution will be 1 pixel as usual for xy locations There actually is a relation to a geographical resolution in meters for example but this relation is of no importance in a location without projection such as xy locations The
110. the notice which states that this License applies to the Document These Warranty Disclaimers are considered to be included by reference in this License but only as regards disclaiming warranties any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License VERBATIM COPYING You may copy and distribute the Document in any medium either commercially or noncommercially provided that this License the copyright notices and the license notice saying this License applies to the Document are reproduced in all copies and that you add no other conditions whatsoever to those of this License You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute However you may accept compensation in exchange for copies If you distribute a large enough number of copies you must also follow the conditions in simplesect 3 You may also lend copies under the same conditions stated above and you may publicly display copies COPYING IN QUANTITY If you publish printed copies or copies in media that commonly have printed cov ers of the Document numbering more than 100 and the Document s license notice requires Cover Texts you must enclose the copies in covers that carry clearly and legibly all these Cover Texts Front Cover Texts on the front cover and Back Cover Texts on the back cover Both covers must also clearly and legibly
111. ther and the maps should lie next to each other With d zoom you can now inspect Notes Chapter 28 Processing Scanned Maps if there are any gaps between the maps redisplaying with d rast is necessary Ideally there are no gaps to be seen If the maps show any unwanted borders these can easily removed To do so zoomed into the map with d zoom and adjust the new coordinates with g region in small steps to reach comfortable rounded values Here you can also use the a flag in combination with res parameter of g region to align the map boundaries with respect to the desired resolution In order to save the map at the new size generate a self copy of the displayed map portion with r mapcalc mapcalc gt new_map old_map http grass itc it gdp html_grass5 html r in gdal html http grass itc it gdp html_grass5 html g region html http grass itc it gdp html_grass5 html i rectify html BED TEE The affine transformation is a linear transformation the parameters of which are calculated through regression analysis The nearest neighbor resampling method is used by i rectify during the transformation http grass itc it gdp html_grass5 html i rectify html http grass itc it gdp html_grass5 html i points html http grass itc it gdp html_grass5 html i target html http grass ite it gdp html_grass5 html m proj html http grass itc it gdp html_grass5 html r proj html 10 The rms error represents th
112. thout markup Texinfo input format LaTeX input format SGML or XML using a publicly available DTD and standard conforming simple HTML PostScript or PDF designed for human modification Examples of transparent image formats include PNG XCF and JPG Opaque formats include proprietary formats that can be read and edited only by proprietary word processors SGML or XML for which the DTD and or processing tools are not generally available and the machine generated HTML PostScript or PDF produced by some word processors for output purposes only The Title Page means for a printed book the title page itself plus such following pages as are needed to hold legibly the material this License requires to appear in the title page For works in formats which do not have any title page as such Title Page means the text near the most prominent appearance of the work s title preceding the beginning of the body of the text A simplesect Entitled XYZ means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language Here XYZ stands for a specific simplesect name mentioned below such as Acknowledgements Dedications Endorsements or History To Preserve the Title of such a simplesect when you modify the Document means that it remains a simplesect Entitled XYZ according to this definition The Document may include Warranty Disclaimers next to
113. tion from two or more raster maps e Given a base map get information for corresponding areas in a cover map e raverage Finds the average of values in a cover map within areas as signed the same category value in a user specified base map e rmedian Finds the median of values in a cover map within areas as signed the same category value in a user specified base map e rmode Finds the mode of values in a cover map within areas assigned the same category value in a user specified base map e r statistics Category or object oriented statistics Can calculate distri bution average mode median standard deviation variance skewness kurtosis minimum maximum and sum for cells in a cover map given categories in a user specified base map 83 Chapter 33 Statistics and Reports 84 e v wha rvolume Calculates the volume of data clumps and optionally pro duces a GRASS site_lists file containing the calculated centroids of these clumps e Quantify the relationship between two or more raster maps e rcoin Tabulates the mutual occurrence coincidence of categories for two raster map layers e r covar Outputs a covariance correlation matrix for user specified raster map layer s e rdistance Locates the closest points between objects in two raster maps m ipf Iterative proportional fitting for error matrices Uses an error or confusion matrix produced by r coin or r kapp
114. tm1 i fft html te ee NS 113 Chapter 46 Analyzing Images 7 http grass itc it gdp html_grass5 html i ifft html 8 http grass itc it gdp html_grass5 html r mapcalc html 9 http grass itc it gdp html_grass5 html r mfilter html 10 http grass itc it gdp html_grass5 html r circle html 114 Chapter 47 Classifying Images Introduction One very common task concerning images is classification In order to use the im ages for mapping or further analysis it is often interesting to translate the frequency information contained in images into thematic information such as land use or state of vegetation You generally have the choice between two approaches supervised or unsupervised image classification Unsupervised classification Unsupervised classification consists of letting the computer automatically calculate classes on the basis of several more than one frequency bands of you image This leaves you with the task of identifying the right number and the real world mean ing of the resulting classes For unsupervised classification go through the following steps creation of group and subgroup If not already done you have to create a group and a subgroup containing the files you wish to classify Use i group to do so clustering Use i cluster to create the classes from your images The man page explains all the parameters You can optionally give a seed signature file to i cluster which contains definitions of
115. to be applied to your image data before you can procede to serious analysis For most of these corrections you should use r mapcalc see Chapter 36 for links to general tutorials on this mod ule and see the relevant litterature for more information on radiometric techniques http grass itc it gdp html_grass5 html r in gdal html http grass itc it gdp html_grass5 html i in erdas html http grass itc it gdp html_grass5 html r in bin html http grass itc it gdp html_grass5 html i out erdas html http grass itc it gdp html_grass5 raster html http grass itc it gdp html_grass5 html i group html http grass itc it gdp html_grass5 html i group html http grass itc it gdp html_grass5 html i target html http grass itc it gdp html_grass5 html i points html http grass ite it gdp html_grass5 html i rectify html ER IB EN Gee DE j m You can also try 12 http grass ite it gdp html_grass5 html i points3 html and 13 http grass ite it gdp html_grass5 html i rectify3 html which are more recent but still unfinished modules 12 http grass itc it gdp html_grass5 html i points3 html 13 14 15 16 17 18 19 20 21 Chapter 45 Preprocessing Images http grass itc it gdp html_grass5 html i rectify3 html You might want to create a color composite image and include it into your group in order to display it http grass itc it gdp html_grass5 html i vpoints html http grass itc
116. tp grass itc it gdp html_grass5 html r contour html 97 Chapter 39 Raster to Vector 98 Chapter 40 Raster to Sites You can create a site file from a raster file using r to sites This will create a site for ev ery non NULL cell of your raster map You might want to adapt your region settings to a lower resolution in order to have less sites in the result see Chapter 12 Another command that might be useful in this context is s sample which samples a raster map at the site locations in the input site file by either cubic convolution interpolation bilinear interpolation or nearest neighbor sampling Notes 1 http grass itc it gdp html_grass5 html r to sites html 2 http grass itc it gdp html_grass5 html s sample html 99 Chapter 40 Raster to Sites 100 Chapter 41 Vector to raster Notes You can use v to rast to transform all labeled vectors into a raster map Unlabeled vectors will be omitted Beware that the command uses the current region settings so make sure they encom pass the region you would like to transform into a raster map Also when creating fixed category area maps thematic maps that don t need a high resolution make sure that the resolution is not set too high as that might make the transformation uneccessarily slow see Chapter 12 If you wish to interpolate raster data from vector data several options exist e v surf rst interpolation and topographic analysis from giv
117. u have to understand it In fact it is so important that you should know about it even if you only plan some light usage of GRASS This chapter is an attempt at explaining as clearly as possible what the region is and what its effects are It will also hopefully help you understand the usefulness of the region in GRASS The region defines the geographic area in which GRASS should work It is character ized by several parameters e geographical projection e g UTM latitude longitude Gauss Krueger etc e geographical extension i e the North South East West limits of the area covered e number of columns and number of rows for the data e resolution i e the extension divided by the number of rows N S resolution re spectively columns E W resolution The default values of these parameters for a given location are stored in the DEFAULT_WIND file in the PERMANENT mapset of that location The current region settings are stored in the WIND in the current mapset The stored values will stay valid even if you exit GRASS and restart it Why care about the region As said above the region defines the extension and resolution of the data on which most GRASS commands should work But what does that mean For instance if the region is set to a smaller extension than that of the map you are working on a display command for that map such as d rast will only show the portion of the map that is contained in that region Many
118. ugh the keyboard This process is called registering a map The advantage of this method is that the user is always in control of the whole map However the high price of the equipment and the lack of magnification capabilities e g for low quality maps are significant disadvantages Furthermore the map must not show any signs of lateral stretch to prevent wrong site coordinates On screen digitizing requires a scanned and geocoded raster map image that is dis played on a GRASS monitor All relevant map objects will be vectorized using the mouse It is not necessary to register such a map as it is geocoded already The ad vantage of this method is the support of zooming hence an improved accuracy can be achieved Apart from access to a scanner no financial input is required However the disadvantage of this method lies in the somewhat awkward orientation on the map on the screen Rules for Digitizing in Topological GIS There are a few basic rules regarding digitizing from analogue maps that apply to topological GIS such as GRASS Obedience to these rules is essential in order to use the topological features of the software Lines must not cross without nodes e Lines that use common node must hit it exactly Make use of the snapping func tion of the digitizing module Common area boundaries must only be digitized once e Areas must be closed Use the snapping function of the digitizing module Store lines and areas
119. uirements 28 http www freetype org 10 Chapter 5 Basic UNIX reference Notes Since GRASS runs ina UNIX GNU Linux environnement general knowledge of basic UNIX commands is recommended Here are a few links to introductions and tutorials e Linux Cookbook The Linux Users Guide e Unix commands reference card Introduction to Linux http www dsl org cookbook http www ibiblio org pub Linux docs linux doc project users guide http www indiana edu uitspubs b017 http www tldp org LDP intro linux html index html BCP AN 11 Chapter 5 Basic UNIX reference 12 Chapter 6 Download and Install Notes Get GRASS from the Download Page on the server in Italy or from one of the Mirror Sites For a very thourough introduction about GRASS and Linux installation please see A P Pradeepkumar s Absolute beginner s Guide to GRASS Installation PDE 277K Packages of GNU Linux Distributions Binary packages have been created for major GNU Linux distributions The can be downloaded at GRASS downlaod page Mandrake In Mandrake 9 0 and later GRASS is included in the contribs To install use the Software Installer in the Mandrake Control Center or run urpmi grass as root Debian GRASS is included in Debian testing and unstable You may also check Debian GIS repository SuSE SuSE rpms are avalaible on GRASS download page Live CD You can buy the FreeGIS CD which contains
120. ume html http grass itc it gdp html_grass5 html r coin html http grass itc it gdp html_grass5 html r covar html http grass itc it gdp html_grass5 html r distance html http grass itc it gdp html_grass5 html m ipf html http grass ite it gdp html_grass5 html v info html http grass itc it gdp html_grass5 html v report html http grass itc it gdp html_grass5 html v stats html http grass itc it gdp html_grass5 html v area html http grass itc it gdp html_grass5 html v distance html http grass itc it gdp html_grass5 html v what html http grass itc it gdp html_grass5 html s info html http grass itc it gdp html_grass5 html s univar html http grass itc it gdp html_grass5 html s normal html 85 Chapter 33 Statistics and Reports 86 Chapter 34 Overlay and Patch Maps Notes Look at r patch Creates a composite raster map layer by using known category values from one or more map layer s to fill in areas of no data in another map layer i image mosaic script not module no man page script to mosaic aerial images A new image will be created with extended colormap rmapcalc Raster map layer data calculator r combine Allows category values from several raster map layers to be combined v patch Creates a new binary vector map layer by combining other binary vector map layers v cutter Polygon Cookie Cutter http g
121. viously this only works if the location and the other settings really exist 1 http mpa itc it grasstutor scripts statistics sh txt The code example links in this chapter go to 3 http mpa itc it grassbook http mpa itc it grassbook http grass itc it gdp html_grass5 html r stats html http grass itc it gdp html_grass5 html g ask html http grass itc it gdp html_grass5 html g findfile html http grass itc it gdp html_grass5 html g gisenv html http stommel tamu edu baum programming html shells SOON DN OP aO http mpa itc it grasstutor scripts grass_batch sh txt 10 http gisws media osaka cu ac jp grasslinks Chapter 54 C Programming All important aspects of C programming for GRASS are described in the GRASS 5 0 Programmer s Manual PDF 2 3MB This section shall just give an overview how GRASS modules are usually structured Generally it will be helpful to look at some of the over 350 existing modules as examples for learning you can browse the source code via the CVS web interface Only an open source GIS such as GRASS offers these deep insights into the heart of a GIS The general structure of the modules is always similar each module is stored in a directory of the GRASS source code The current source code structure is as follows GRASS GIS library most relevant only html modules descriptions src CMD internal scripts for compilation src include header files src li
122. w ever in this case you will not use the the location option but just type r in gdal in RasterFile out GRASSRaster you can also use one of the other raster import commands That s it In order to learn how to view your map and do other basic operations see Chapter 8 If you have a scanned map and you have access to the geographical information concerning the original paper map then you should read Chapter 28 17 Chapter 7 How to Quickstart GRASS Notes 18 Other situations So you have a file without much information about it but you think or know it should be georeferenced For example someone sent you an ESRI shape file contain ing a map you would like to work on Or you received a raster in a binary format that is not supported by the GDAL library Here are some tips on what you might want to do depending on the usage you will make of the file JE LS CS ID a O NN ON Ask the person who sent you the maps to give you more information Think about the data What is it displaying political boundaries of countries a satellite image of jungle areas etc what is its rough geographical extension the World or your hometown Where does the data come from NASA a personal digitization etc All these factors might give you a lead about the structure of the data Try to load your data into different locations see Chapter 16 for the creation of a lo cation using widely used projection systems f
123. with cp GISDBASE LOCATION_NAME MAPSET WIND GISDBASE LOCATION_NAME PERMANENT DEFAULT_WIND e Now whenever you use g region d the region will be set to your new default region 1 http grass itc it gdp html_grass5 html g region html 2 http grass itc it gdp html_grass5 html1 d zoom html 29 Chapter 12 The GRASS Region 30 Chapter 13 Set up your GRASS database Before beginning to work with GRASS for the first time you have to create a sub directory the GRASS database where GRASS stores its spatial data in your home directory For team work it is better to create itin a partition data where everybody in a team has permissions rather than in your home directory Within the database the data are stored in the following directory structure GRASS database e grassdata user administrator has to create this directory For each project a new subdirectory called location is created automatically by GRASS grassdata spearfish this subdirectory is created by GRASS Each user team member working on this project has her own mapset grassdata spearfish maria There is a special mapset called PERMANENT where maps common for the group are stored and protected from overwriting Team members have access to each other s data but they cannot delete or modify data in a mapset that they do not own 31 Chapter 13 Set up your GRASS database 32 Chapter 14 Start running GRASS Notes GRASS can be run in
124. xing through cartesian coordinates There are a wide variety of projections with common ones divided into a number of classes including cylindrical and pseudo cylindrical conic and pseudo conic and azimuthal methods each of which may be conformal equal area or nei ther The particular projection chosen depends on the purpose of the project and the size shape and location of the area of interest For example normal cylindrical projec tions are good for maps which are of greater extent east west than north south and in equatorial regions while conic projections are better in mid latitudes transverse cylindrical projections are used for maps which are of greater extent north south than east west azimuthal projections are used for polar regions Oblique versions of any ofthese may also be used Conformal projections preserve angular relationships and better preserve arc length while equal area projections are more appropriate for sta tistical studies and work in which the amount of material is important Projections are defined by precise mathematical relations so the method of projecting coordinates from a geographic reference frame latitude longitude into a projected cartesian reference frame eg metres is governed by these equations Inverse projec tions can also be achieved The public domain Unix software package PROJ 4 has been designed to perform these transformations and the user s manual contains a detailed description
125. xisting GRASS scripts to understand how they work For more information on general shell programming please consult the man page of your shell on GNU Linux this is generally the bash shell so type man bash or follow on of the many links listed on the Programming Texts and Tutorials page Batch usage of GRASS GRASS can be completely controlled externally through scripts and therefore run automatically by setting the correct environment variables There doesn t exist a sin gle GRASS program in fact GRASS is a collection of modules which are run in a special environment Even the GRASS startup is simply setting numerous variables This can be done directly as well here an example in bash shell style After having run this script all GRASS modules that can be used non interactively can be used Generally you can get the list of parameters required by a module by typing help as such a parameter or always recommended by reading the manual Once these variables have been set GRASS can also be integrated into CGI PERL and other scripts You can visit a quite complex example on the internet SlideLinks which is an online GIS based completely on CGI scripts a database management system and GRASS Since GRASS 5 0 you can alternatively skip the startup screen by directly specifying the database location and mapset 129 Chapter 53 Scripting GRASS Notes 130 grass5 home neteler grassdata katmandu innercity Ob
126. xy location without projec tion and then rectified geocoded in a second location with the chosen coordinate system xy kocatlon UTM target locatlon not geocoded with coordinates toposheet used 88 reference Transformation further maps geocoding i qroup i target scanned map points rectified map draft map i rectity Reference points are set on the scanned raw map in the xy location These reference points are taken from the analogous map and graphically assigned to the scanned 35 Chapter 15 Planning and constructing a GRASS database 36 map The next step is the geocoding of the scanned map through transformation from the xy location to the other location containing a projected coordinate system Now the map is ready for GIS work Example You have scanned a map at 300dpi This map we call the raw map In the Section called Definition of a project area with predefined geographical resolution you will find the necessary calculation methods in order to determine the correct scan ning parameters It is useful to use a map which already provides marks at the cross sections of coordinate lines These marks represent important coordinate points for the rectification of the map You should scan the map a few percentage points larger than needed in GRASS later so that the marks that are on the edge of the region of interest are clearly visible Note The edge of the paper is generally not parallel to the coordina
127. y do something with it This chapter will help you get going very quickly with some of the basic operations in GRASS Again this is not to replace further going sections later in this documentation but only to allow you to plunge into the fun as quickly as possible Basic tasks and their commands Using the GUI GRASS has a graphical user interface written in Tcl Tk the GIS Manager This functions as a front end to all the GRASS modules To start it type d m amp the amp allows you to keep on using the GRASS shell The GIS Manager generate automatically a GUI for every modules You can browse menus or type the name of a command without argument to lauch them For more information see Chapter 11 Managing your maps In order to list copy and remove your maps you can use g list g copy and g remove In the GIS Manager these commands are in the GIS gt Manage maps and grid3D files menu For more information see Chapter 17 Setting the region Before dealing with anything concerning your map you should make sure that the region is set correctly To do so use the command g region Type g region vect NameOfYourVectorMap or g region rast NameOfYourRasterMap This will set the current region to the extension and the resolution of your map Use g region p to display the current region settings You can access region settings in GIS gt Region menu of the GIS Manager For more information see Chapter 12

Download Pdf Manuals

image

Related Search

Related Contents

Table of Contents  GEDA System  Elegant Home Fashions HDT548 Instructions / Assembly  The LyX User's Guide  télécharger le cahier - Parc Naturel Régional du Vercors  Lapara LA-ON-1K-LCD uninterruptible power supply (UPS)  LS14TMH    Keithley - KuzyaTech    

Copyright © All rights reserved.
Failed to retrieve file