Skip to content

Instantly share code, notes, and snippets.

@hackervera
Created August 16, 2010 00:52
Show Gist options
  • Save hackervera/526179 to your computer and use it in GitHub Desktop.
Save hackervera/526179 to your computer and use it in GitHub Desktop.
geo function
function(doc) {
if (doc.loc) {
emit({
type: "Point",
coordinates: [doc.loc[0], doc.loc[1]]
}, [doc._id, doc.loc]);
}
else {
emit({
type: "Point",
coordinates: [10.898333, 48.371667]
}, [doc._id, [10.898333, 48.371667]]);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment