You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by e0...@student.tuwien.ac.at on 2011/06/07 14:24:48 UTC

GeoCouch - Encountered spatial query bug

Hello community,

during developing and web application using GeoCouch I came across a  
small bug. I'm actually unsure if it's a real bug or if maybe I did  
something wrong. If this is a known issue please apologize, I didn't  
find something similar.

My application provides the user the ability to mark their own  
location on an dynamic map, for which I use the OpenLayers framework  
to display and handle events. But after one has added a few locations  
suddenly GeoCouch only queries the last added feature. This happens as  
it seems, totally randomly as I didn't recognize any pattern till now.  
Even a plain curl spatial query with a 0,0,180,90 bounding box only  
returns the last added feature as if the rest wouldn't exist. But the  
other features still remain within the database and can be queried by  
CouchDB's normal views. Often a restart of the GeoCouch server helps  
to solve this problem.

This is only guess but it seems that this bug only occurs if there is  
a long interval between two adds.

The spatial map function I use is pretty simple and uses a GeoJSON  
point as key value:

function (doc) {
	if (doc.type == "news") {
		if (doc.geometry) {
			var file;
			if (doc._attachments) {
				for (fname in doc._attachments) {
					file = fname;
				}
			}
			else {
				file = null;
			}

			emit(doc.geometry, {
				'attachments': file,
				'content': doc.content,
				'type': doc.type
			});
		}
	}
}

May someone else encountered a similar problem.

Best regards
Bernhard

Re: GeoCouch - Encountered spatial query bug

Posted by Volker Mische <vo...@gmail.com>.
Hi Bernhard,

sorry for the late reply.

I haven't encountered such a problem yet. The easiest way for me to
debug the problem would be if you could provide a database where this
problem happens, that I can replicate to a local instance.

Cheers,
  Volker

On 06/07/2011 02:24 PM, e0075088@student.tuwien.ac.at wrote:
> 
> Hello community,
> 
> during developing and web application using GeoCouch I came across a
> small bug. I'm actually unsure if it's a real bug or if maybe I did
> something wrong. If this is a known issue please apologize, I didn't
> find something similar.
> 
> My application provides the user the ability to mark their own location
> on an dynamic map, for which I use the OpenLayers framework to display
> and handle events. But after one has added a few locations suddenly
> GeoCouch only queries the last added feature. This happens as it seems,
> totally randomly as I didn't recognize any pattern till now. Even a
> plain curl spatial query with a 0,0,180,90 bounding box only returns the
> last added feature as if the rest wouldn't exist. But the other features
> still remain within the database and can be queried by CouchDB's normal
> views. Often a restart of the GeoCouch server helps to solve this problem.
> 
> This is only guess but it seems that this bug only occurs if there is a
> long interval between two adds.
> 
> The spatial map function I use is pretty simple and uses a GeoJSON point
> as key value:
> 
> function (doc) {
>     if (doc.type == "news") {
>         if (doc.geometry) {
>             var file;
>             if (doc._attachments) {
>                 for (fname in doc._attachments) {
>                     file = fname;
>                 }
>             }
>             else {
>                 file = null;
>             }
> 
>             emit(doc.geometry, {
>                 'attachments': file,
>                 'content': doc.content,
>                 'type': doc.type
>             });
>         }
>     }
> }
> 
> May someone else encountered a similar problem.
> 
> Best regards
> Bernhard