- Timestamp:
- 27/09/2011 17:23:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workshop-foss4g/geography.rst
r48 r49 70 70 .. image:: ./geography/lax_cdg.jpg 71 71 72 Working with geographic coordinates on a cartesian plane (the purple line) yields a *very* wrong answer indeed! Using great circle routes (the red lines) gives the right answer. If we convert our LAX-CDG flight into a line string and calculate the distance to a point in Iceland using ``geography`` we'll get the right answer (recall) in meters. 72 Répondre à cette question en travaillant avec un plan cartésien fournit une trÚs mauvaise réponse en effet ! En utilisant la ligne rouge, nou sobtenon sune bien meilleure réponse. Si nous convertissons notre vol LAX-CDG en une ligne et que nous calculons la distance à un point en Islande, nous obtiendrons la réponse exacte, en mÚtres. 73 73 74 74 .. code-block:: sql … … 83 83 531773.757079116 84 84 85 So the closest approach to Iceland on the LAX-CDG route is a relatively small 532km. 86 87 The cartesian approach to handling geographic coordinates breaks down entirely for features that cross the international dateline. The shortest great-circle route from Los Angeles to Tokyo crosses the Pacific Ocean. The shortest cartesian route crosses the Atlantic and Indian Oceans. 85 Donc le point le plu sproche de l'Islande pendant le vol LAX-CDG est de 532 kilomÚtres.S 86 87 L'approche cartésienne pour manipuler les coordonnées géographiques pert tout son sens pour les objets situées au dessus de la ligne de date internationale. La route "sphérique" la plus courte entre Los-Angeles et Tokyo traverse l'océan Pacifique. La route "cartésienne" la plus courte traverse quant à elle les océans Atlantique et Indien. 88 88 89 89 .. image:: ./geography/lax_nrt.png … … 107 107 108 108 109 U sing Geography110 --------------- 109 Utiliser 'Geography' 110 ------------------- 111 111 112 112 In order to load geometry data into a geography table, the geometry first needs to be projected into EPSG:4326 (longitude/latitude), then it needs to be changed into geography. The :command:`ST_Transform(geometry,srid)` function converts coordinates to geographics and the :command:`Geography(geometry)` function "casts" them from geometry to geography. … … 222 222 If, on the other hand, you need to measure distance with a dataset that is geographically dispersed (covering much of the world), use the ``geography`` type. The application complexity you save by working in ``geography`` will offset any performance issues. And, casting to ``geometry`` can offset most functionality limitations. 223 223 224 Function List 225 ------------- 224 Liste des fonctions 225 ------------------- 226 226 227 227 `ST_Distance(geometry, geometry) <http://postgis.org/docs/ST_Distance.html>`_: For geometry type Returns the 2-dimensional cartesian minimum distance (based on spatial ref) between two geometries in projected units. For geography type defaults to return spheroidal minimum distance between two geographies in meters.
Note: See TracChangeset
for help on using the changeset viewer.