TerraLib: An Open Source GIS Library for Large-Scale Environmental and Socio-Economic Applications

  • Gilberto Câmara
  • Lúbia Vinhas
  • Karine Reis Ferreira
  • Gilberto Ribeiro De Queiroz
  • Ricardo Cartaxo Modesto De Souza
  • Antônio Miguel Vieira Monteiro
  • Marcelo Tílio De Carvalho
  • Marco Antonio Casanova
  • Ubirajara Moura De Freitas
Part of the Advances in Geographic Information Science book series (AGIS, volume 2)


This chapter describes TerraLib, an open source GIS software library. The design goal for TerraLib is to support large-scale applications using socio-economic and environmental data. TerraLib supports coding of geographical applications using spatial databases, and stores data in different database management systems including MySQL and PostgreSQL. Its vector data model is upwards compliant with Open Geospatial Consortium (OGC) standards. It handles spatio-temporal data types (events, moving objects, cell spaces, modifiable objects) and allows spatial, temporal, and attribute queries on the database. TerraLib supports dynamic modeling in generalized cell spaces, has a direct runtime link with the R programming language for statistical analysis, and handles large image data sets. The library is developed in C++, and has programming interfaces in Java and Visual Basic. Using TerraLib, the Brazilian National Institute for Space Research (INPE) developed the TerraView open source GIS, which provides functions for data conversion, display, exploratory spatial data analysis, and spatial and non-spatial queries. Another noteworthy application is TerraAmazon, Brazil’s national database for monitoring deforestation in the Amazon rainforest, which manages more than 2 million complex polygons and 60 gigabytes of remote sensing images.


Geographic Information System Cellular Automaton Cellular Automaton Spatial Database Cell Space 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Aguiar A, Câmara G, Cartaxo R (2003) Modeling spatial relations by generalized proximity matrices. V Brazilian Symposium in Geoinformatics – GeoInfo 2003, Campos do Jordão, SP, BrazilGoogle Scholar
  2. Aguiar APD (2006) Modeling Land Use Change in the Brazilian Amazon: Exploring Intra-Regional Heterogeneity. PhD Thesis, Remote Sensing Program. Sao Jose dos Campos, INPEGoogle Scholar
  3. Aksoy S, Koperski K, Tusk C, Marchisio G (2004) Interactive training of advanced classifiers for mining remote sensing image archives. ACM International Conference on Knowledge Discovery and Data Mining, Seattle, WA, ACMGoogle Scholar
  4. Alexandrescu A (2001) Modern C++ design: Generic programming and design patterns applied. Addison-Wesley, ReadingGoogle Scholar
  5. Allen JF (1983) Maintaining knowledge about temporal intervals. Commun ACM 26:832–843CrossRefGoogle Scholar
  6. Almeida CM, Batty M, Monteiro AMV, Câmara G, Soares-Filho BS, Cerqueira GC, Pennachin CL (2003) Stochastic cellular automata modeling of urban land use dynamics: empirical development and estimation. Comput Environ Urban Syst 27:481–509CrossRefGoogle Scholar
  7. Anselin L (1988) Spatial econometrics: methods and models. Kluwer, DordrechtGoogle Scholar
  8. Anselin L (1989) What’s special about spatial data: Alternative perspectives on spatial data analysis. Santa Barbara, CA, NCGIA Report 89-4Google Scholar
  9. Anselin L (1995) Local indicators of spatial association – LISA. Geogr Anal 27:91–115Google Scholar
  10. Anselin L, Bao S (1997) Exploratory spatial data analysis linking Spacestat and ArcView. In M Fischer and A Getis (eds.) Recent Developments in Spatial Analysis, Springer Verlag, Berlin.Google Scholar
  11. Anselin L (1999) Interactive techniques and exploratory spatial data analysis. In: Longley P, Goodchild M, Maguire D, Rhind D (eds) Geographical Information Systems: principles, techniques, management and applications. Geoinformation International, CambridgeGoogle Scholar
  12. Anselin L, Syabri I, Kho Y (2006) GeoDa: An introduction to spatial data analysis. Geogr Anal 38:5–22CrossRefGoogle Scholar
  13. Andrade PR, Ribeiro PJ (2005) A process and environment for embedding the R Software into TerraLib. VII Brazilian Symposium on Geoinformatics (GeoInfo 2005), Campos do Jordao, Brazil, INPE/SBCGoogle Scholar
  14. Arthur B (1994) Increasing returns and path dependence in the economy. The University of Michigan Press, Ann Arbor, MIGoogle Scholar
  15. Assunção R, Neves M, Camara G, Freitas CDC (2006) Efficient regionalisation techniques for socio-economic geographical units using minimum spanning trees. Int J Geogr Inf Sci 20:797–812CrossRefGoogle Scholar
  16. Austern M (1998) Generic programming and the STL: Using and extending the C++ standard template library. Addison-Wesley, Reading, MAGoogle Scholar
  17. Batory D, Singhal V, Sirkin M, Thomas J (1993) Scalable software libraries. SIGSOFT Softw. Eng. Notes 18:191–199CrossRefGoogle Scholar
  18. Batty M (2000) GeoComputation using cellular automata. In: Openshaw S, Abrahart RJ (eds) GeoComputation, Taylor & Francis, London, 95–126Google Scholar
  19. Blanchette J, Summerfield M (2006) C++ GUI programming with Qt 4. Prentice Hall, Indianapolis, IndianaGoogle Scholar
  20. Blaschke T, Hay G (2001) Object-oriented image analysis and scale-space: theory and methods for modeling and evaluating multiscale landscape structure. Int Arch Photogramm Remote Sens 34:22–29Google Scholar
  21. Bivand R, Neteler M (2000) Open source geocomputation: using the R data analysis language integrated with GRASS GIS and PostgreSQL data base systems. 5th International Conference on GeoComputation, Greenwich, UKGoogle Scholar
  22. Burrough P (1998) Dynamic modelling and geocomputation. In: Longley P, Brooks S, McDonnell R, Macmillan B (eds) Geocomputation: A Primer. John Wiley, New YorkGoogle Scholar
  23. Câmara G, Souza R, Freitas U, Garrido J (1996) SPRING: Integrating remote sensing and GIS with object-oriented data modelling. Comput Graph 15:13–22Google Scholar
  24. Câmara G, Souza RCM, Pedrosa BM, Vinhas L, Monteiro AMV, Paiva JAC, Carvalho MT, Raoult B (2001) Design patterns in GIS development: the TerraLib experience. III Simpósio Brasileiro de GeoInformatica, Rio de Janeiro, RJGoogle Scholar
  25. Carneiro T (2006) Nested-CA: a foundation for multiscale modeling of land use and land change. Computer Science Department. Sao Jose dos Campos, INPE. Doctorate Thesis in Computer ScienceGoogle Scholar
  26. Chang SK, Yan CW, Dimitroff D, Arndt T (1988) An intelligent image database system. IEEE Trans Software Eng 14:681–688CrossRefGoogle Scholar
  27. Couclelis H (1997) From cellular automata to urban models: New principles for model development and implementation. Environ Plann B 24:165–174CrossRefGoogle Scholar
  28. Daratech (2006) GIS markets and opportunities 2006 survey. Cambridge, MA, Daratech IncGoogle Scholar
  29. DeWitt D, Kabra N, Luo J, Patel J, Yu J-B (1994) Client-server paradise. VLDB Conference, Santiago, ChileGoogle Scholar
  30. Diggle P (2003) Statistical analysis of spatial point patterns. 2nd edn Edward Arnold, LondonGoogle Scholar
  31. Diggle P, Ribeiro PJ (2007) Model-based geostatistics. Springer, HeidelbergGoogle Scholar
  32. Dutton G (ed) (1978) First international advanced study symposium on topological data structures for geographic information systems. Addison-Wesley, Reading, MAGoogle Scholar
  33. Elliott J, Eckstein R, Loy M, Wood D, Cole B (2002) Java swing. O’Reilly Press, Sebastopol, CAGoogle Scholar
  34. Erwig M, Schneider M (2002) Spatio-temporal predicates. IEEE Trans Knowl Data Eng 14:881–901CrossRefGoogle Scholar
  35. Feitosa F, Camara G, Monteiro AM, Koschitzki T, Silva MS (2007) Global and local spatial indices of urban segregation. Int J Geogr Inf Sci 21:299–323CrossRefGoogle Scholar
  36. Ferreira KR, Queiroz G, Paiva JA, Souza RC, Câmara G (2002) A software architecture for building spatial databases with object-relational DBMS. XVII Brazilian Symposium on Databases, Gramado, RSGoogle Scholar
  37. Ferreira KR, Vinhas L, Queiroz GR, Câmara G, Souza RCM (2005) The architecture of a flexible querier for spatio-temporal databases. VII Brazilian Symposium in Geoinformatics, Campos do Jordao, BrazilGoogle Scholar
  38. Fonseca F, Egenhofer M, Agouris P, Camara G (2002) Using ontologies for integrated geographic information systems. Trans GIS 6:231–257CrossRefGoogle Scholar
  39. Fotheringham AS, Brunsdon C, Charlton M (2002) Geographically weighted regression: The analysis of spatially varying relationships. Wiley, ChichesterGoogle Scholar
  40. Fowler GS, Korn DG, Vo K-P (1995) Principles for writing reusable libraries. Proceedings of the 1995 Symposium on Software reusability. Seattle, Washington, United States, ACM PressGoogle Scholar
  41. Galton A (2004) Fields and objects in space, time, and space-time. Spat Cogn Comput 4:39–68CrossRefGoogle Scholar
  42. Gamma E, Helm R, Johnson R, Vlissides J (1995) Design patterns: Elements of reusable object-oriented software. Addison-Wesley, Reading, MAGoogle Scholar
  43. Goodchild ME (2003) Geographic information science and systems for environmental management. Ann Rev Environ Resour 28:493–519CrossRefGoogle Scholar
  44. Goovaerts P (1997) Geostatistics for natural resources evaluation. Oxford Univ Press, New YorkGoogle Scholar
  45. Grenon P, Smith B (2003) SNAP and SPAN: Towards dynamic spatial ontology. Spat Cogn Comput 4:69–104CrossRefGoogle Scholar
  46. Güting RH, Schneider M (2005) Moving objects databases. Morgan Kaufmann, New YorkGoogle Scholar
  47. Henzinger TA (1996) The theory of hybrid automata. Proceedings of the 11th Symposium on Logic in Computer Science (LICS’96), IEEEGoogle Scholar
  48. Hornsby K, Egenhofer M (2000) Identity-based change: A foundation for spatio-temporal knowledge representation. Int J Geogr Inf Sci 14:207–224CrossRefGoogle Scholar
  49. Ihaka R, Gentleman R (1996) R: A language for data analysis and graphics. J Comput Graph Stat 5:299–314CrossRefGoogle Scholar
  50. Krasner GE, Pope ST (1988) A cookbook for using the model-view controller user interface paradigm in Smalltalk-80. J Object-Oriented Program 1:26–49Google Scholar
  51. Krueger CW (1992) Software reuse. ACM Comput Surv 24:131–183CrossRefGoogle Scholar
  52. Martin D (2003) Extending the automated zoning procedure to reconcile incompatible zoning systems. Int J Geogr Inf Sci 17:181–196CrossRefGoogle Scholar
  53. Medak D (2001) Lifestyles. In: Frank AU, Raper J, Cheylan J-P (eds) Life and Motion of Socio-Economic Units. ESF Series. Taylor & Francis, LondonGoogle Scholar
  54. Meinel G, Neubert M (2004) A comparison of segmentation programs for high resolution remote sensing data. Int Arch Photogramm Remote Sens XXXV:1097–1105Google Scholar
  55. Meyer B (1990) Lessons from the design of the Eiffel libraries. Commun ACM 33:68–88CrossRefGoogle Scholar
  56. Mockus A, Fielding R, Herbsleb J (2002) Two case studies of open source software development: Apache and Mozilla. ACM Transactions on Software Engineering and Methodology 11Google Scholar
  57. Navulur K (2006) Multispectral image analysis using the object-oriented paradigm. CRC Press, Boca Raton, CAGoogle Scholar
  58. Openshaw S, Alvanides S (2001) Designing zoning systems for representation of socio-economic data. In: Frank A, Raper J, Cheylan J (eds) Time and Motion of Socio-Economic Units, Taylor and Francis, LondonGoogle Scholar
  59. Parks BO (1993) The need for integration. In: Goodchild MJ, Parks BO, Steyaert LT (eds) Environmental modelling with GIS. OUP, Oxford, 31–34Google Scholar
  60. Pebesma E, Bivand R (2005) Classes and methods for spatial data in R. R News 5:9–13Google Scholar
  61. Pedrosa B, Câmara G, Fonseca F, Souza RCM (2002) TerraML – A cell-based modeling language for an open-source GIS library. II International Conference on Geographical Information Science (GIScience 2002), Boulder, CO, 2002Google Scholar
  62. Queiroz GR (2003) Algoritmos Geométricos para Bancos de Dados Geográficos: Da Teoria à Prática na TerraLib (Geometric Algorithms for Spatial Databases: From Theory to Practice in TerraLib). Computer Science. São José dos Campos, INPE. MsCGoogle Scholar
  63. Rodrigues VL, Andrade MVA, Queiroz GR, Magalhães M (2006) An efficient map overlay algorithm for TerraLib. VIII Brazilian Symposium on GeoInformatics, GeoInfo2006, Campos do Jordão, SP, Brazil, INPEGoogle Scholar
  64. Rodrigues VL, Cavalier AP, Andrade MVA, Queiroz GR (2005) Exact algorithms for map manipulation in TerraLib. VII Brazilian Symposium on GeoInformatics, GeoInfo2005, Campos do Jordão, SP, Brazil, INPEGoogle Scholar
  65. Rowlingson B, Diggle P (1993) Splancs: spatial point pattern analysis code in S-Plus. Comput Geosci 19:627–655Google Scholar
  66. Silva MPS, Camara G, Souza RCM, Valeriano D, Escada MIS (2005) Mining patterns of change in remote sensing image databases. The Fifth IEEE International Conference on Data Mining, New Orleans, Louisiana, USAGoogle Scholar
  67. Sistla AP, Wolfson O, Chamberlain S, Dao S (1997) Modeling and querying moving objects. Proceedings of the Thirteenth International Conference on Data Engineering 422–432Google Scholar
  68. Veldkamp A, Fresco L (1996) CLUE: A conceptual model to study the conversion of land use and its effects. Ecol Model 85:253–270CrossRefGoogle Scholar
  69. Vinhas L, Ferreira KR, Ribeiro G (2007) TerraLib programming tutorial. São José dos Campos, Brasil, INPE (avaliable on Scholar
  70. Vinhas L, Queiroz GR, Ferreira K, Câmara G, Paiva JA (2002) Generic programming applied to GIS algorithms. IV Brazilian Symposium on Geoinformatics, Caxambu, BrazilGoogle Scholar
  71. Vinhas L, Souza RCM, Câmara G (2003) Image data handling in spatial databases. V Brazilian Symposium on Geoinformatics, Campos do Jordão, BrazilGoogle Scholar
  72. Warmerdam F (2007) Shapefile C Library V1.2, accessed July 28th, 2008Google Scholar
  73. Weber S (2004) The success of open source. Harvard University Press, Cambridge, 75Google Scholar
  74. Worboys M (2005) Event-oriented approaches to geographic phenomena. Int J of Geogr Inf Syst 19:1–28CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Gilberto Câmara
    • 1
  • Lúbia Vinhas
    • 1
  • Karine Reis Ferreira
    • 1
  • Gilberto Ribeiro De Queiroz
    • 1
  • Ricardo Cartaxo Modesto De Souza
    • 1
  • Antônio Miguel Vieira Monteiro
    • 1
  • Marcelo Tílio De Carvalho
    • 2
  • Marco Antonio Casanova
    • 2
  • Ubirajara Moura De Freitas
    • 3
  1. 1.National Institute for Space Research (INPE), Av dos Astronautas 1758Brazil
  2. 2.Catholic University of Rio de Janeiro (PUC-RIO)Brazil
  3. 3.Space Research and Applications Foundation (FUNCATE), Av. Dr. João GuilherminoBrazil

Personalised recommendations