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

#run segmentation:

i.smap gr=segment su=segment sig=smapsig out=gsl3.smap d.rast gslS.smap

#vectorization and visual./report of land use/land cover map: r.poly -1 in=gsl3.smap out=gsl3.smap v.support gsl3.smap d.vect gsl3.smap

v.report gslS.smap type=area units=h

Depending on the training map, the result can be a vectorized land use/land cover map. However, this map may contain a lot of spurious areas. These can be filtered with the script r.reclass.area. As an example, only areas greater than 0.25 hectares will be preserved (note, this script only operates in georeferenced LOCATIONS):

r.reclass.area -g 0.25 gslS.smap gsl3.smap.flit d.rast gsl3.smap.filt

The deleted areas are filled with NULL (no-data) values. To reassign values to these NULL cells, we can use a mode filter which replaces the NULL cells by the dominating land use value in the 3x3 neighborhood. The mode filter is implemented in r.neighbors:

#mode filter to replace NULL cells:

r.neighbors gsl3.smap.filt out=gsl3.smap2 method=mode size=3 d.rast gsl3.smap2

#vectorization:

r.poly -1 in=gsl3.smap2 out=gsl3.smap2 v.support gsl3.smap2 d.rast gsl3

d.vect gsl3.smap2 col=yellow #area report:

v.report gsl3.smap2 type=area units=h

We have now the land use/land cover map available as raster and vector map layers. Special care has to be taken for shadows resulting from sun which may either be treated as a special class or reduced by image pre-processing.



Chapter 11

NOTES ON GRASS PROGRAMMING

GRASS provides a unique opportunity to improve and extend GIS capabilities by a new code development. The GNU General Public License (GPL) keeps the code as Free Software, while protecting the rights of the individual authors. Because the source code can be studied, modified and published again, there is an ongoing exchange of knowledge, methods and algorithms between GIS and software engineering experts.

To make the development of GIS tools more efficient, GRASS provides a large GIS library with documented application programming interface (API). The code is portable on numerous architectures and operating systems. The available programming documents and an ongoing reorganization of the code base will enable potential developers to better estimate the workload of adding functionality to GRASS. At the time of writing this book the restructuring is work-in-progress.

An important aspect of the GRASS development is the fact that the developers are advanced GRASS users who improve or extend the existing functionality, based on the needs of their daily GIS use in production.

11.1. GRASS PROGRAMMING ENVIRONMENT

Important communication channel supporting GRASS development is the GRASS 5 developers mailing list . Here advanced users exchange ideas and discuss problems related to code development or bugfixes. As the source code is managed in CVS (Concurrent Versioning System) the development is free from personal constraints, and the core team members can submit changes at any time. Write access to CVS is granted to those who contribute on a regular basis. The GRASS Programmers Manual is managed in CVS as well



and updated regularly. The access to the full source code, either as a released package, or as a weekly CVS snapshot, or directly extracted from CVS, allows the developers to study the code structure of a full featured GIS. We will describe the general code structure of GRASS 5.3 in greater detail below. Note that the code structure for GRASS 5.7 is different and more standardized. Figure 1.1 at the beginning of the book in Section 1.2 shows the current GRASS Development Model.

11.1.1 GRASS source code

The complete GRASS source code is available on the GRASS Web sites. Those who want to participate in the ongoing source code development of GRASS should learn more about the GRASS-CVS . This electronic management tool (CVS: Concurrent Versioning System1) for the source code is used in GRASS development since December 1999. The idea of CVS is to enable the developers to have direct read/write access to the GRASS source code for independent development. CVS supports the centralized management of GRASS development, as the developers work on a single code base with restricted write, but public worldwide read access. You can find more information about this topic on the GRASS Web servers. Another advantage is that the CVS client minimizes data transfer after an initial download: during a subsequent synchronization of the local GRASS source code copy with the centralized CVS server ( cvs update command) only new code changes are transferred through network.

CVS snapshots which cover the latest development are generated on a weekly basis and made available in a package for download. This is useful for skilled users who do not want to learn CVS but who would like to follow the latest development. However, knowledge about how to compile source code packages is required.

To compile the source code, first download either an officially released source code package, or the GRASS CVS snapshot , or the latest source code directly from CVS. Read the REQUIREMENTS.html file provided with the source code as well as the INSTALL file to make sure that you have all the necessary libraries installed on your system. After extracting the code (not needed when directly accessing the CVS server), the compilation is done with three steps:

./configure <parameters> make

make install

Note that the configure script may expect parameters depending on your local installation of required libraries. Please refer to the INSTALL file within the source code for further details and explanations.



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