[Groonga-commit] groonga/groonga [master] doc: revise usage section to more intuitive description

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 19日 (火) 17:52:38 JST


HAYASHI Kentaro	2012-06-19 17:52:38 +0900 (Tue, 19 Jun 2012)

  New Revision: 45c4b391866356cd1cc9d9897dc80d0a2f7dca5b
  https://github.com/groonga/groonga/commit/45c4b391866356cd1cc9d9897dc80d0a2f7dca5b

  Log:
    doc: revise usage section to more intuitive description

  Modified files:
    doc/source/functions/geo_distance.txt

  Modified: doc/source/functions/geo_distance.txt (+27 -9)
===================================================================
--- doc/source/functions/geo_distance.txt    2012-06-19 16:48:32 +0900 (9cb0b15)
+++ doc/source/functions/geo_distance.txt    2012-06-19 17:52:38 +0900 (8643ab0)
@@ -32,12 +32,11 @@ The unit of return value is meter.
 Usage
 -----
 
-This section explains ``geo_distance``.
 ``geo_distance`` is one of the groonga builtin functions.
 
 You can call a builtin function in :doc:`/reference/grn_expr` 
 
-``geo_distance`` function calculates the value of distance(approximate value)
+``geo_distance`` function calculates the value of distance (approximate value)
 between the coordinate of ``point1`` and the coordinate of ``point2``.
 
 .. note::
@@ -49,9 +48,6 @@ between the coordinate of ``point1`` and the coordinate of ``point2``.
     Use ``geo_distance(point1, point2, "sphere")`` instead of ``geo_distance2(point1, point2)``.
     Use ``geo_distance(point1, point2, "ellipsoid")`` instead of ``geo_distance3(point1, point2)``.
 
-Simple usage
-^^^^^^^^^^^^
-
 Lets's learn about ``geo_distance`` usage with examples.
 This section shows simple usages.
 
@@ -62,21 +58,41 @@ Those samples show how to calculate the value of distance between Tokyo and Sapp
 #. Using the explicitly specified value of location for calculating the distance (``Geo`` table)
 
 Using the column value of location
-""""""""""""""""""""""""""""""""""
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Here is a schema definition of ``Stations`` table.
+Here are a schema definition of ``Stations`` table and sample data to show usage.
 
 .. groonga-command
 .. include:: ../example/functions/geo_distance_setup_location.log
 
+There is a table named ``Stations``. ``Stations`` table has one column, ``location``.
+``location`` column stores the value of coordinate.
+The coordinate of Tokyo is stored as sample data.
+
+.. groonga-command
+.. include:: ../example/functions/geo_distance_location_rectangle.log
+
+This sample shows that ``geo_distance`` use the value of ``location`` column
+and the value of coordinate [#]_ to calculate distance.
+
+
 Using the explicitly specified value of location
-""""""""""""""""""""""""""""""""""""""""""""""""
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Here is a schema definition of ``Geo`` table.
+Here are a schema definition of ``Geo`` table and sample data to show usage.
 
 .. groonga-command
 .. include:: ../example/functions/geo_distance_setup_distance.log
 
+There is a table named ``Geo``. ``Geo`` table has one column, ``distance``.
+``distance`` column stores the value of distance.
+
+.. groonga-command
+.. include:: ../example/functions/geo_distance_distance_rectangle.log
+
+This sample shows that ``geo_distance`` use the coordinate of Tokyo
+and the coordinate of Sapporo to calculate distance.
+
 Parameters
 ----------
 
@@ -211,3 +227,5 @@ Here is a sample about calculating the value of distance with column value.
 .. rubric:: Footnote
 
 .. [#] You can specify whether TokyoGeoPoint or WGS84GeoPoint.
+
+.. [#] The coordinate of Sapporo is "155047000x508862800".
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index