couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Mische <volker.mis...@gmail.com>
Subject Re: GeoCouch weird issue / won't index
Date Thu, 18 Nov 2010 11:02:11 GMT
Hi Keith,

I only had a quick look, but the bounding box you are requesting seems to be
outside your data. Try something like bbox=-180,-90,180,90

Cheers,
  Volker.

Am 18.11.2010 04:16 schrieb "Keith Gable" <ziggythehamster@gmail.com>:

I'm trying out GeoCouch right now and I'm coming across something I've
been banging my head on for an hour or two now. I got the examples to
work, but I can't get anything to actually work with my real data.

Here is my spatial function (which is design_doc["spatial"]["geocode"]
in case I have it in the wrong spot, but it DOES run, so I doubt this):

function(doc) {
 if (doc['couchrest-type'] == 'Place') {
 if (doc['geo'] && doc['geo'].length == 2) {
  log('geo on ' + doc['_id'] + ' = ' + doc['geo'][0] + ',' +
doc['geo'][1] );
  emit({ type: "Point", coordinates: [ doc['geo'][0],
doc['geo'][1] ] }, doc['_id']);
 } else {
  log('no geo on ' + doc['_id']);
 }
 }
}

Here is one of the documents:
{
  "_id": "000c02eb-3372-4071-b56d-928f154a3357",
  "_rev": "4-5a1c3fe5d45fd164c6dc4216672d3f58",
  "address": "710 E Ben White Blvd",
  "title": "McDonald's",
  "alcohol": [
  ],
  "postal_code": "78704",
  "url": "www.mcdonalds.com",
  "human_id": null,
  "fare": [
      "Fast Food",
      "American",
      "Burgers"
  ],
  "created_by": "_system",
  "tags": [
  ],
  "bitly_hash": null,
  "atmosphere": null,
  "parking": null,
  "geo": [
      30.218978,
      -97.75523
  ],
  "phone_number": "(512) 707-6838",
  "couchrest-type": "Place",
  "reservations": null,
  "credit_cards_accepted": [
  ],
  "features": [
      "Kid Friendly"
  ],
  "updated_by": "_system",
  "path": [
      "875de01b-edb9-47a4-aabc-7acd97ecde43",
      "ea46e21f-889c-4960-b0eb-3cf65a093a1c",
      "bfff92eb-d35c-4df3-ae8f-01e68c3f8fc6",
      "6a26a5fd-34ef-47de-9d0e-7c4bce509b1b",
      "000c02eb-3372-4071-b56d-928f154a3357"
  ],
  "hours": null,
  "description": null,
  "owned_by": "_system"
}

The correct coordinates get outputted by my log() functions, but it
seems like nothing gets emitted.

This spatial query returns nothing:

http://localhost:5984/macrodeck-development/_design/Place/_spatial/geocode?bbox=0,0,180,90

The log isn't really entirely helpful either since it doesn't seem to
tell me if there was a problem with the GeoJSON. I'm running version
"1.1.0a771dd47-git" (latest version as of a few minutes ago).

Any tips to help diagnose this? Maybe I've just made a stupid mistake
and it's going to be a simple fix... :)

Thanks for any help anyone can provide.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message