

MongoDB 1.3.3 (just released) has basic support for geospatial indexes - simonw
http://www.mongodb.org/display/DOCS/Geospatial+Indexing

======
njl
For those of you who haven't tried it, MongoDB offers a pretty amazing balance
of features and usability. The user community is friendly, and the developers
are incredibly responsive. I just built my co-founder finder
(<http://amb.itio.us/>) with MongoDB as a backend, my second project with the
DB. My only regret was the lack of this exact feature.

~~~
amock
Have you had any issues with data loss after a crash? I've seen a few people
in the IRC channel saying that they lost tens of millions of records after
running a repair after a crash. While replication can help prevent data loss,
having to reinsert millions of records really puts a load on the other nodes
when you bring one up after a crash.

~~~
njl
A fair point. My datasets have been relatively small, topping out at less than
a gigabyte. I didn't have any crashes in production, and I had a small enough
database that I could export the whole thing to the file system every six
hours. Dumping and restoring from that dump was fast.

10gen has delivered, time and again. They're looking at ways to be smarter
about replication, and I am confident that by the time I need that level of
durability, they will have brought the product up to where I need it to be.

The additional productivity I feel I get from MongoDB is, of course, balanced
by the knowledge that I am working on a platform that is a bit of a moving
target. It's been a wild eight or nine months in some ways, but I've been
thrilled with both the product and the relentless drive from 10gen to improve
an already kick-ass tool.

------
bkudria
"Currently geo indexing is limited to indexing squares with no "wrapping" at
the outer boundaries."

~~~
Groxx
Out of curiosity, what would "wrapping" mean in this case?

~~~
wlievens
The international dateline; or more precisely the antemeridian. It's a
nontrivial problem, that even plagues the more famous gis applications (such
as Google Earth, which cannot render a polygon that crosses the antemeridian
properly).

~~~
Groxx
Really? ((loc + 180) % 360) - 180 = loc, wrapped past the antemeridian, for
any value. Just detect sign changes, and reverse the range on the reversing
side.

Seems to me graphics people have been doing this sort of thing for _years_. A
similar, but more complicated problem: painting the texture on a 3D model
(literally _onto_ the rendered model), even across seams. That's general-
cased, wrapping on a sphere is a rather trivial special case by comparison.

Granted, I haven't made any GIS systems, and the underlying structure may make
it more difficult than this. But this is definitely a solved problem, are they
just reluctant to modify their system?

~~~
wlievens
The real problem is that you can't tell inside from outside in a polygon that
wraps the antemeridian.

~~~
Groxx
Aaah, yeah, that's harder. Hm.

Personally, I'd just find the points that edges intersect the antemeridian,
and define two polygons, ORing the results. Know if there's a reason that
isn't done?

~~~
wlievens
That's the workaround, but that process is left to the user. Google Earth
doesn't do that for you (since it can't know how to split the polygon, because
it doesn't know the inside!).

------
jhancock
Note: This is "dev" release. 1.2.x is the current production release.

------
wlievens
Very nice, but obviously still ways off from something like PostGIS which
includes several hundred geometry operations.

