Bienvenue sur PostGIS.fr

Bienvenue sur PostGIS.fr , le site de la communauté des utilisateurs francophones de PostGIS.

PostGIS ajoute le support d'objets géographique à la base de données PostgreSQL. En effet, PostGIS "spatialise" le serverur PostgreSQL, ce qui permet de l'utiliser comme une base de données SIG.

Maintenu à jour, en fonction de nos disponibilités et des diverses sorties des outils que nous testons, nous vous proposons l'ensemble de nos travaux publiés en langue française.

source: trunk/workshop-foss4g/introduction.rst @ 8

Revision 8, 18.5 KB checked in by djay, 13 years ago (diff)

Small fix for links

RevLine 
[1]1.. _introduction:
2
3Partie 1 : Introduction
4************************
5
6Qu'est-ce qu'une base de données spatiales ?
7============================================
8
9PostGIS est une base de données spatiales. Oracle Spatial et SQL Server 2008 sont aussi des bases de données spatiales. Mais qu'est-ce que cela signifie, qu'est-ce qui différentie un serveur de base de données spatiales d'un non spatiale ?
10
11La réponse courte, est ...
12
13**Les base de données spatiales permettent les stocage et la manipulation des objets spatiaux comme les autres objets de la base de données.**
14
15Ce qui suit présente briÚvement l'évolution des base de données spatiales, puis les liens
16entre les données spatiales et la base de données (types de données, indexes et fonctions).
17
18#. **Types de données spatiales** fait référence aux géométries de type point, ligne et polygone;
19#. L'**indexation spatiale** est utilisée pour améliorer les performance d'exécution des opérations spatiales;
20#. Les **fonctions spatiales**, au sens :term:`SQL`, sont utilsées pour accéder à des propriétées ou des relations spatiales.
21
22Conbiné, les types de données spatiales, les indexes et les fonctions fournissent une structure flexible pour optimiser les performance et les analyses.
23
24Au commencement
25----------------
26
27Dans les premiÚres implémentations :term:`SIG` historiques, toutes les données
28spatiales étaient stoquées sous la forme de fichiers plats et certaines applications
29 :term:`SIG` spécifiques étaient nécessaires pour interpréter et manipuler les données.
30Ces outils de gestion de premiÚre génération, avaient été conçu pour répondre aux
31besoins des utilisateurs pour lesquels toute les données étaient localisé au sein de leur
32agence. C'est outils étaient propriétaire, des systÚme specifiquement créé pour gérer les
33données spatiales.
34
[4]35La seconde génération des systÚmes de gestion de données spatiales stoquaient certaines données dans une base de données relationelle (habituellement les "attributs" ou autres parties non spatiales) mais ne founissaient pas encore la fléxibilité offerte par une intégration complÚte des données spatiales.
[1]36
[4]37**Effectivement, les bases de données spatiales sont nés lorsque les gens ont commencé à considérer les objet spatiaux comme les autres objets d'une base de données .** 
[1]38
[4]39Les bases de données spatiales intÚgre les données spatiales sous formes d'objets de la base de données relationelle. Le changement opéré passe d'une vision centrée sur le SIG à une vision centrée sur les bases de données.
[1]40
41.. image:: ./introduction/beginning.png
42
[4]43.. note:: Un systÚme de gestion de base de données peut être utilisée dans d'autre cadre que celui des SIG. Les bases de données spatiales sont utilisées dans divers domaines : l'anatomie humaine, les circuits intégrés de grandes envergures, les structures moléculaires, les champs electomaniétiques et bien d'autre encore.
[1]44
45
[4]46Les types de données spatiales
47------------------------------
[1]48
[4]49Une base de données classique propose les types chaînes de caractÚres et date par exemple. Une base de données spatiales ajoute les types de données (spatiales) pour représenter les **entités géographiques**. Ces types de données spatiales permettre d'accéder à des propriétés de l'entité géographique comme les contours ou la dimension. Pour bien des aspects, les types de données spatiales peuvent être vu simplement comme des formes.
[1]50
51.. image:: ./introduction/hierarchy.png
52   :align: center
53
[4]54Les types de données spatiales sont organisés par une hierarchie de type. Chaque sous-types hérite de la structure (les atrributs) et du comportement (les méthodes et fonctions) de son type supérieur dans hierarchie.
[1]55
56
[4]57Indexes spatiaux et étendue
58---------------------------
[1]59
[7]60Une base de données ordinaire fournit des "méthodes d'accÚs" -- connues sous le nom d'**index** -- pour permettre un accÚs efficace et non séquentiel à un sous ensemble de données. L'indexation des type non géographique (nombre, chaînes de caractÚres, dates) est habituellement faite à l'aide des index de type `arbres binaires <http://en.wikipedia.org/wiki/B-tree>`__. Un arbre binaire est un partitionnement des données utilisant l'ordre naturel pour stoquer les données hierarchiequement.
[1]61
[4]62L'ordre naturel des nombres, des chaînes de caractÚres et des dates est assez simple à déterminer -- chaque valeur est inférieure, plus grande ou égale à toutes les autres valeurs. Mais, étant donné que les polygones peuvent se chevaucher, peuvent être contenu dans un autre et sont représenté par un tableau en deux dimensions (ou plus), un arbre binaire ne convient pas pour indexer les valeurs. Les vraies bases de données spatiales fournissent un "index spatial" qui répond plutÎt à la question : "quel objet se trouve dans une étendue spécifique ?"
[1]63
[4]64Une **étendue** correspond au rectangle de plus petite taille capable de contenir un objet géographique.
[1]65
66.. image:: ./introduction/boundingbox.png
67   :align: center
68
[4]69Les étendues sont utilisées car répondre à la question : "est-ce que A se trouve à 'intérieur de B ? " est une opération couteuse pour les polygones mais rapide dans le cas ou ce sont des rectangles. Même des polgones et des lignes complex peuvent être représenté par une simple étendue.
[1]70
[4]71Les index spatiaux doivent réalisé leur ordanencement rapidement afin d'être utile. Donc au lien de fournir des résultats extacts, comme le font les arbres binaires, les index spatiaux fournisse des résultats approximatifs. La question "quelles lignes sont à l'intérieur de ce polygone" sera interprété par un index spatial comme : "quelles lignes ont une étendue qui est contenue dans l'étendue de ce polygone ?"
[1]72
[4]73Les incréments spatiaux réels mis en application par de diverses bases de données varient considérablement.
[8]74Les index spatiaux actuellement utilisés par les différents systÚme de gestion de bases de données varient considérablement. L'implémentation la plus commune est l'`arbre R <http://en.wikipedia.org/wiki/R-tree>`_ (utilisé dans PostGIS), mais il existe aussi des implémentations de type `Quadtrees <http://en.wikipedia.org/wiki/Quadtree>`_, et des `indexes basés sur une grille <http://en.wikipedia.org/wiki/Grid_(spatial_index)>`_.
[1]75
[4]76Fonctions spatiales
77-------------------
[1]78
79For manipulating data during a query, an ordinary database provides **functions** such as concatenating strings, performing hash operations on strings, doing mathematics on numbers, and extracting information from dates.  A spatial database provides a complete set of functions for analyzing geometric components, determining spatial relationships, and manipulating geometries.  These spatial functions serve as the building block for any spatial project.
80
81The majority of all spatial functions can be grouped into one of the following five categories:
82
83#. **Conversion**: Functions that *convert* between geometries and external data formats.
84#. **Management**: Functions that *manage* information about spatial tables and PostGIS administration.
85#. **Retrieval**: Functions that *retrieve* properties and measurements of a Geometry.
86#. **Comparison**: Functions that *compare* two geometries with respect to their spatial relation.
87#. **Generation**: Functions that *generate* new geometries from others.
88
89The list of possible functions is very large, but a common set of functions is defined by the :term:`OGC` :term:`SFSQL` and implemented (along with additional useful functions) by PostGIS.
90
91What is PostGIS?
92================
93
94PostGIS turns the `PostgreSQL <http://www.postgresql.org/>`_ Database Management System into a spatial database by adding adding support for the three features: spatial types, indexes, and functions.  Because it is built on PostgreSQL, PostGIS automatically inherits important "enterprise" features as well as open standards for implementation
95
96But what is PostgreSQL?
97-----------------------
98
99PostgreSQL is a powerful, object-relational database management system (ORDBMS). It is released under a BSD-style license and is thus free and open source software. As with many other open source programs, PostgreSQL is not controlled by any single company, but has a global community of developers and companies to develop it.
100
101PostgreSQL was designed from the very start with type extension in mind -- the ability to add new data types, functions and access methods at run-time. Because of this, the PostGIS extension can be developed by a separate development team, yet still integrate very tightly into the core PostgreSQL database.
102
103Why choose PostgreSQL?
104~~~~~~~~~~~~~~~~~~~~~~
105
106A common question from people familiar with open source databases is, "Why wasn't PostGIS built on MySQL?".
107
108PostgreSQL has:
109
110  * Proven reliability and transactional integrity by default (ACID)
111  * Careful support for SQL standards (full SQL92)
112  * Pluggable type extension and function extension
113  * Community-oriented development model
114  * No limit on column sizes ("TOAST"able tuples) to support big GIS objects
115  * Generic index structure (GiST) to allow R-Tree index
116  * Easy to add custom functions
117
118Combined, PostgreSQL provides a very easy development path to add new spatial types. In the proprietary world, only Illustra (now Informix Universal Server) allows such easy extension. This is no coincidence; Illustra is a proprietary re-working of the original PostgreSQL code base from the 1980's.
119
120Because the development path for adding types to PostgreSQL was so straightforward, it made sense to start there. When MySQL released basic spatial types in version 4.1, the PostGIS team took a look at their code, and the exercise reinforced the original decision to use PostgreSQL. Because MySQL spatial objects had to be hacked on top of the string type as a special case, the MySQL code was spread over the entire code base. Development of PostGIS 0.1 took under a month. Doing a "MyGIS" 0.1 would have taken a lot longer, and as such, might never have seen the light of day.
121
122Why not Shapefiles?
123-------------------
124
125The `shapefile <http://en.wikipedia.org/wiki/Shapefile>`_ (and other file formats) have been the standard way of storing and interacting with spatial data since GIS software was first written. However, these "flat" files have the following disadvantages:
126
127* **Files require special software to read and write.**  SQL is an abstraction for random data access and analysis. Without that abstraction, you will need to write all the access and analysis code yourself.
128* **Concurrent users can cause corruption.** While it's possible to write extra code to ensure that multiple writes to the same file do not corrupt the data, by the time you have solved the problem and also solved the associated performance problem, you will have written the better part of a database system. Why not just use a standard database?
129* **Complicated questions require complicated software to answer.** Complicated and interesting questions (spatial joins, aggregations, etc) that are expressible in one line of SQL in the database take hundreds of lines of specialized code to answer when programming against files.
130
131Most users of PostGIS are setting up systems where multiple applications will be expected to access the data, so having a standard SQL access method simplifies deployment and development. Some users are working with large data sets; with files, they might be segmented into multiple files, but in a database they can be stored as a single large table.
132
133In summation, the combination of support for multiple users, complex ad hoc queries, and performance on large data sets are what sets spatial databases apart from file-based systems.
134
135A brief history of PostGIS
136--------------------------
137
138In the May of 2001, `Refractions Research <http://www.refractions.net/>`_  released the first version of PostGIS. PostGIS 0.1 had objects, indexes and a handful of functions. The result was a database suitable for storage and retrieval, but not analysis.
139
140As the number of functions increased, the need for an organizing principle became clear.  The "Simple Features for SQL" (:term:`SFSQL`) specification from the Open Geospatial Consortium provided such structure with guidelines for function naming and requirements.
141
142With PostGIS support for simple analysis and spatial joins, `Mapserver <http://mapserver.org/>`_ became the first external application to provide visualization of data in the database.
143
144Over the next several years the number of PostGIS functions grew, but its power remained limited. Many of the most interesting functions (e.g., ST_Intersects(), ST_Buffer(), ST_Union()) were very difficult to code.  Writing them from scratch promised years of work.
145
146Fortunately a second project, the "Geometry Engine, Open Source" or `GEOS <http://trac.osgeo.org/geos>`_, came along. The GEOS library provides the necessary algorithms for implementing the :term:`SFSQL` specification. By linking in GEOS, PostGIS provided complete support for :term:`SFSQL` by version 0.8.
147
148As PostGIS data capacity grew, another issue surfaced: the representation used to store geometry proved relatively inefficient. For small objects like points and short lines, the metadata in the representation had as much as a 300% overhead. For performance reasons, it was necessary to put the representation on a diet.  By shrinking the metadata header and required dimensions, overhead greatly reduced. In PostGIS 1.0, this new, faster, lightweight representation became the default.
149
150Recent updates of PostGIS have worked on expanding standards compliance, adding support for curve-based geometries and function signatures specified in the ISO :term:`SQL/MM` standard. Through a continued focus on performance,  PostGIS 1.4 significantly improved the speed of geometry testing routines.
151
152Who uses PostGIS?
153-----------------
154
155For a complete list of case studies, see the `PostGIS case studies <http://www.postgis.org/documentation/casestudies/>`_ page.
156
157Institut Geographique National, France
158~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159
160IGN is the national mapping agency of France, and uses PostGIS to store the high resolution topographic map of the country, "BDUni". BDUni has more than 100 million features, and is maintained by a staff of over 100 field staff who verify observations and add new mapping to the database daily. The IGN installation uses the database transactional system to ensure consistency during update processes, and a `warm standby system <http://developer.postgresql.org/pgdocs/postgres/warm-standby.html>`_ to maintain uptime in the event of a system failure.
161
162GlobeXplorer
163~~~~~~~~~~~~
164
165GlobeXplorer is a web-based service providing online access to petabytes of global satellite and aerial imagery. GlobeXplorer uses PostGIS to manage the metadata associated with the imagery catalogue, so queries for imagery first search the PostGIS catalogue to find the location of the relevant images, then pull the images from storage and return them to the client. In building their system, GlobeXplorer tried other spatial databases but eventually settled on PostGIS because of the great combination of price and performance it offers.
166
167What applications support PostGIS?
168----------------------------------
169
170PostGIS has become a widely used spatial database, and the number of third-party programs that support storing and retrieving data using it has increased as well. The `programs that support PostGIS <http://trac.osgeo.org/postgis/wiki/UsersWikiToolsSupportPostgis>`_ include both open source and proprietary software on both server and desktop systems.
171
172The following table shows a list of some of the software that leverages PostGIS:
173
174+-------------------------------------------------+----------------------------------------------+
175| Open/Free                                       | Closed/Proprietary                           |
176+=================================================+==============================================+
177|                                                 |                                              |   
178| * Loading/Extracting                            | * Loading/Extracting                         |   
179|                                                 |                                              |     
180|   * Shp2Pgsql                                   |   * Safe FME Desktop Translator/Converter    |     
181|   * ogr2ogr                                     |                                              |       
182|   * Dxf2PostGIS                                 |                                              |         
183|                                                 | * Web-Based                                  |         
184| * Web-Based                                     |                                              |             
185|                                                 |   * Ionic Red Spider (now ERDAS)             |             
186|   * Mapserver                                   |   * Cadcorp GeognoSIS                        |           
187|   * GeoServer (Java-based WFS / WMS -server )   |   * Iwan Mapserver                           |     
188|   * SharpMap SDK - for ASP.NET 2.0              |   * MapDotNet Server                         |     
189|   * MapGuide Open Source (using FDO)            |   * MapGuide Enterprise (using FDO)          |   
190|                                                 |   * ESRI ArcGIS Server 9.3+                  |         
191| * Desktop                                       |                                              |           
192|                                                 | * Desktop                                    |               
193|   * uDig                                        |                                              |           
194|   * QGIS                                        |   * Cadcorp SIS                              |     
195|   * mezoGIS                                     |   * Microimages TNTmips GIS                  |         
196|   * OpenJUMP                                    |   * ESRI ArcGIS 9.3+                         |           
197|   * OpenEV                                      |   * Manifold                                 |   
198|   * SharpMap SDK for Microsoft.NET 2.0          |   * GeoConcept                               |       
199|   * ZigGIS for ArcGIS/ArcObjects.NET            |   * MapInfo (v10)                            |           
200|   * GvSIG                                       |   * AutoCAD Map 3D (using FDO)               |   
201|   * GRASS                                       |                                              |           
202|                                                 |                                              |             
203+-------------------------------------------------+----------------------------------------------+
204
Note: See TracBrowser for help on using the repository browser.