Нефть и песок О стали Компрессор - подбор и ошибки Из истории стандартизации резьб Соперник ксерокса - гектограф Новые технологии производства стали Экспорт проволоки из России Прогрессивная технологическая оснастка Цитадель сварки с полувековой историей Упрочнение пружин Способы обогрева Назначение, структура, характеристики анализаторов Промышленные пылесосы Штампованные гайки из пружинной стали Консервация САУ Стандарты и качество Технология производства Водород Выбор материала для крепежных деталей Токарный резец в миниатюре Производство проволоки Адгезия резины к металлокорду Электролитическое фосфатирование проволоки Восстановление корпусных деталей двигателей Новая бескислотная технология производства проката Синие кристаллы Автоклав Нормирование шумов связи Газосварочный аппарат для тугоплавких припоев
Главная --> Промиздат -->  Map principle 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ( 26 ) 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

To apply the rules to the roads map and create a new reclassed map roads.qual, we run:


The first command just shows the table. We send the table to the GRASS module using the pipe into the second command. With d.rast or r.report you can check the resulting map roads.qual.

The second example explains reclassification of a continuous field map. We want to reclass the elevation map into elevation ranges reflecting the typical vegetation. To cover all elevations appearing in the map, it makes sense to check the data range in advance:

r.info elevation.dem

Then we create a reclass rules table elevation.recl:

1000 thru 1299 = 1 mountainous zone 1300 thru 1499 = 2 subalpine zone 1500 thru 1749 = 3 alpine zone

Note that these values are only for illustration and do not reflect the real situation in the Spearfish area.


As another example, we show a mixture of the reclass rules described above. The mixed rules table reclasses the landuse map to a reduced number of classes:


As above, we store this table to a file landuse.recl and run r.reclass on the landuse map:

cat landuse.recl

cat landuse.recl r.reclass landuse out=landuse.simple\

title= Landuses

A hint: To minimize typing efforts, you can start from the category table of the landuse map, store it to the file landuse.recl and modify it accordingly.



The module r.cats outputs the category table; we can redirect it to an initial reclasstable:

r.cats landuse > landuse.recl

Use a text editor to prepare the reclass table from file landuse.recl. Be cautious with reclass maps. Since r.reclass generates a table referencing the original raster map rather than creating a real raster map, a reclass map will no longer be accessible if the original raster map upon which it was based is later removed. However, g.remove prints a warning if such a case occurs. Use r.mapcalc to convert a reclass map to a regular raster map:

r.mapcalc landuse.new=landuse.reel

In case that you need to filter areas by size, use r.reclass.area:

r.report vegcover

r.reclass.area in=vegcover out=vegcover.1000 great=1000 r.report vegcover.1000

This script will generate a new map vegcover.1000 where the minimum area size is 1000 hectares, setting the omitted small areas to NULL. These no-data area could be filled again with surrounding values (r.neighbors, e.g. mode parameter, see Section 5.4.1).

5.1.6 Assigning category labels

Raster maps may include category labels that are stored in a special category table. Sometimes, this table does not exist, for example, when the map has been created by r.mapcalc or when it was imported without labels. In other cases you may want to modify/update existing labels.

Modifying existing category labels for a raster map. The module r.support is used to update existing category labels. As an example, we modify existing labels of the soils map by replacing some of the soil type acronyms with the full description. First, let us look at the original map:

r.report soils

Because the map is stored in the read-only PERMANENT MAPSET we cannot modify it (see Section 3.1.2 for explanations). In order to do it, we have to create a copy within our MAPSET:

g.copy soils,mysoils

The category label editor is included in the module r.support. Start it without parameters and enter the map name mysoils. Then proceed with <ENTER> to Edit the category file for [mysoils]? , and enter y here. You will



get to the first screen where the highest category number should be defined. Because you are not going to change the number of categories, you can accept the current value and continue with <ESC><ENTER>. This takes you to the category table where you can move around with cursor keys. The table displays the first 10 categories, the rest is on the next page(s). If you want to change just few categories, you can get directly to it by entering its number into the field Next category . As an example, proceed to the category number 24: Enter 24 in that bottom line and hit <ESC><ENTER>. Now you have the requested category number on top of the table which should read McD . Go to the line and enter the full name Midway-Razor silty clay loams .1 You can then go to the category number 10 and then to 20 to learn how it is working. To leave this mode, either scroll through the full table with <ESC><ENTER> orjust type end into the line Next category . Now you get back to the questionnaire mode of r.support, you can skip the rest of the questions with <ENTER> to exit the module. Finally, check the updated table with r.cats or r.report. This procedure looks a bit old-fashioned, but you can use it even remotely through low-bandwidth network access because no graphical user interface is required.

Note that you can create categories for floating point maps representing continuous fields such as elevation or precipitation. To do this, you can run r.support and create categories for ranges of FP data. See Section 12.1.3 for an example.

Assigning new attributes to a raster map (f-). The next application is a bit more sophisticated because we want to automatically assign new attributes to a raster map based on calculations. For illustration, we create a new raster map fields.areas by changing the category labels that represent field owners in the map fields to labels representing field areas. The procedure will read the map fields, calculate the areas for the individual fields, output the results as reclass rules and reclass the fields map according to the rules.

To get the area information, we can use r.report or r.stats. Compare the results of both (we use -h to suppress page headers):



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ( 26 ) 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127