databaseintro.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Database management in GRASS GIS</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <meta name="Author" content="Markus Neteler/GRASS Development Team">
  7. <link rel="stylesheet" href="grassdocs.css" type="text/css">
  8. </head>
  9. <body bgcolor="white">
  10. <!-- This page is grass6/db/databaseintro.html -->
  11. <img src="grass_logo.png" alt="_\|/_ GRASS logo"><hr align=center size=6 noshade>
  12. <h2>Database management in GRASS GIS</h2>
  13. <h3>Attribute management in general</h3>
  14. GRASS can be linked to one or many database management systems (DBMS).
  15. The <em>db.*</em> set of commands provides basic SQL support for
  16. attribute management, while the <em>v.db.*</em> set of commands operates
  17. on the vector map (see <a href="vectorintro.html">Vector introduction</a>).
  18. <h3>Available drivers</h3>
  19. Available drivers are listed in <a href="sql.html">SQL support in GRASS GIS</a>.
  20. <p>
  21. <b>Notes</b>:<br>
  22. The default DBF driver provides only very limited SQL
  23. support (as DBF is not an SQL DB) while the other DBMS backends (such
  24. as PostgreSQL, MySQL etc) provide full SQL support since the SQL
  25. commands are sent directly to the DBMS.
  26. <h3>DB connection management</h3>
  27. The current database management settings are shown or modified with
  28. <a href="db.connect.html">db.connect</a> for current mapset. Available DBMI drivers
  29. are listed with <a href="db.drivers.html">db.drivers</a>. Some DBMI backends
  30. require a user/password for driver/database to be set with <a href="db.login.html">db.login</a>.
  31. In order to test a driver, run <a href="db.test.html">db.test</a>.
  32. <h3>Attribute data import and export</h3>
  33. Attribute data can be imported with <a href="db.in.ogr.html">db.in.ogr</a> from
  34. various formats and exported with <a href="db.out.ogr.html">db.out.ogr</a>. To internally
  35. copy a a full table or selectively parts of it, use <a href="db.copy.html">db.copy</a>.
  36. <p>
  37. Further conversion tools:
  38. <ul>
  39. <li><a href="http://mdbtools.sourceforge.net/">MDB Tools</a>: Convert MS-Access data to SQL, DBF, etc.</li>
  40. <li><a href="http://grass.osgeo.org/wiki/Openoffice.org_with_SQL_Databases">Openoffice.org with SQL Databases</a>
  41. </ul>
  42. <h3>SQL commands</h3>
  43. GRASS supports to main SQL operations, execution of an SQL statement
  44. (<a href="db.execute.html">db.execute</a>) and selection
  45. of data from a table (<a href="db.select.html">db.select</a>).
  46. See the <a href="sql.html">SQL help page</a> for examples.
  47. <h3>Managing the default DBMI settings</h3>
  48. Per default vector map attributes are stored in DBF table files. This default
  49. definition can be modified with <a href="db.connect.html">db.connect</a>. If an
  50. external DBMS is used, <a href="db.login.html">db.login</a> may be required.
  51. <h3>Creating a database</h3>
  52. Specific commands are explained on the individual driver pages (these
  53. pages are only available if driver was compiled in this installation):
  54. <ul>
  55. <li>DBF: see <a href="grass-dbf.html">DBF</a> page</li>
  56. <li>SQLite: <a href="grass-sqlite.html">SQLite</a> page</li>
  57. <li>mySQL: <a href="grass-mysql.html">mySQL</a> and <a href="grass-mesql.html">meSQL</a> pages</li>
  58. <li>ODBC: <a href="grass-odbc.html">ODBC</a> page (connect to Oracle, etc.)</li>
  59. <li>PostgreSQL: <a href="grass-pg.html">PostgreSQL</a> and PostGIS page</li>
  60. </ul>
  61. <h3>Metadata</h3>
  62. All columns for a given table are listed with <a href="db.columns.html">db.columns</a>.
  63. The command <a href="db.describe.html">db.describe</a> describes a table in detail. To
  64. list all available tables for a given database, run <a href="db.tables.html">db.tables</a>.
  65. <h3>Table maintenance</h3>
  66. To drop a column from a selected attribute table, use <a href="db.dropcol.html">db.dropcol</a>.
  67. With <a href="db.droptable.html">db.droptable</a> an attribute table can be deleted.
  68. <h3>Database Schema</h3>
  69. Currently schema support only works for PostgreSQL connections. Default schema
  70. can be set with <a href="db.connect.html">db.connect</a>. Note that the default
  71. schema will be used by all db.* modules.
  72. <p>
  73. <a href="db.tables.html">db.tables</a> returns 'schema.table' if schemas are
  74. available in the database.
  75. <h3>See also</h3>
  76. <ul>
  77. <li><a href="vectorintro.html">Introduction to GRASS vector map processing</a></li>
  78. <li><a href="rasterintro.html">Introduction to GRASS raster map processing</a></li>
  79. </ul>
  80. <HR>
  81. <BR>
  82. <a href="index.html">Main index</a> -
  83. <a href="database.html">database index</a> -
  84. <a href="full_index.html">full index</a>
  85. <p><i>Last changed: $Date$</i></p>
  86. <P>&copy; 2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></P>
  87. </body>
  88. </html>