couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "View_Snippets" by DirkjanOchtman
Date Fri, 05 Mar 2010 13:08:25 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "View_Snippets" page has been changed by DirkjanOchtman.
The comment on this change is: Add a note about using geohashes for spatial views..
http://wiki.apache.org/couchdb/View_Snippets?action=diff&rev1=34&rev2=35

--------------------------------------------------

    * [[#summary_stats|Computing simple summary statistics (min,max,mean,standard deviation)
]]
    * [[#interactive_couchdb|Interactive CouchDB Tutorial]]
    * [[#documents_without_a_field|Retrieving documents without a certain field]]
- 
+   * [[#geospatial_indexes|Using views to search for sort documents geographically]]
  
  <<Anchor(common_mistakes)>>
  == Common mistakes ==
@@ -704, +704 @@

  }
  }}}
  
- For example: yuu can now query your view and retrieve all documents that do not contain
the field `role` (view/NAME/?key="role").
+ For example: you can now query your view and retrieve all documents that do not contain
the field `role` (view/NAME/?key="role").
  
+ <<Anchor(geospatial_indexes)>>
+ == Using views to search for sort documents geographically ==
+ 
+ If you use latitude/longitude information in your documents, it's not very easy to sort
on proximity from a given point using the normal approach (of using a key of [<latitude>,
<longitude>]). This happens because they're on different axes, which doesn't map well
onto CouchDB's treatment of the index sorting -- which is a linear sort. However, using a
[[http://en.wikipedia.org/wiki/Geohash|geohash]] may solve this, by letting you convert the
coordinates of a location into a string that sorts well (e.g., locations that are close share
a common prefix).
+ 
+ (Note that I haven't actually used this approach, but this came up in IRC and geohashes
are conceptually a good match. Please reword/refactor this entry if I've stated the problem
or solution poorly.)
+ 

Mime
View raw message