kercos / geomodel

Automatically exported from code.google.com/p/geomodel
0 stars 0 forks source link

Port geomodel to the upcoming ndb datastore API #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Google App Engine looks likely to release an improved datastore API called ndb 
[http://code.google.com/p/appengine-ndb-experiment/] in the not-too-distant 
future as part of the official SDK.

ndb offers a number of benefits - particularly relating to performance and 
executing queries asynchronously.

My app already uses ndb instead of db, and I also plan to use geomodel. For now 
I'm going to port the current version of geomodel to ndb myself, but it would 
be awesome if the geomodel project could be made ndb-compatible so that 
developers like myself can benefit from future updates.

Original issue reported on code.google.com by j...@simplylisted.com on 5 Sep 2011 at 8:26

GoogleCodeExporter commented 8 years ago
please post your geomodel ndb port when complete :)

Original comment by richard....@gmail.com on 18 Feb 2012 at 12:10

GoogleCodeExporter commented 8 years ago
hey, was wondering about your experience porting geo models to ndb... how's it 
going?

Original comment by iceanf...@gmail.com on 26 May 2012 at 4:05

GoogleCodeExporter commented 8 years ago
Hey, I ported it to ndb. Attached is a patch. 

The ext.ndb version is a mixin class, and not a base model as in the ext.db 
version. This is because ndb allows mixins, while they are a little problematic 
with ext.db.
So you do:

    class MyModel(geo.GeoModel, ndb.Model):
        # ...

Take a look at the geomodel_test.py to see it in action. 

Original comment by rodrigo.moraes on 4 Jun 2012 at 5:25

Attachments:

GoogleCodeExporter commented 8 years ago
Hello,
I added a small extension to do proximity and bbox searches as @ndb.tasklets. 
this looks promising because these queries can be a bit slow so making them 
async might help. nothing fancy

Original comment by S.Shpiz@gmail.com on 14 Sep 2012 at 2:39

Attachments:

GoogleCodeExporter commented 8 years ago
I was just curious what we need to do to get this to work.  Should I delete all 
lines with '-' and do I need all of the @@lat, long@@ statements?  Thanks for 
the port by the way!

Original comment by pgray...@gmail.com on 15 Oct 2012 at 9:41

GoogleCodeExporter commented 8 years ago
Do you mean how to get the diff file to work? its a diff from the trunk file 
(geo.py i htink)

hope that helps

Original comment by S.Shpiz@gmail.com on 15 Oct 2012 at 9:53

GoogleCodeExporter commented 8 years ago
But what do I actually do with it?  Do I need to alter it before putting it 
into my project source?

Original comment by pgray...@gmail.com on 16 Oct 2012 at 5:32

GoogleCodeExporter commented 8 years ago
You need to use the patch program to apply the diff

http://ariejan.net/2007/07/03/how-to-create-and-apply-a-patch-with-subversion 
might help

Original comment by Dylan.S...@gmail.com on 18 Oct 2012 at 2:00

GoogleCodeExporter commented 8 years ago
To get the patch to work, you'll first need an SVN binary, a list of which can 
be found here: http://subversion.apache.org/packages.html

Personally I just went with the VisualSVN command line tools for Windows:
http://www.visualsvn.com/downloads/

Once you've added the extracted folder to your environment PATH, fire up the 
command line.  Checkout the source code. Copy the .diff file into your geo 
folder.  Then on the command line do: svn patch geo_ndb.diff

Voila.

Thanks rodrigo.moraes!

Also, some related discussion over on SO:
http://stackoverflow.com/questions/11765202/what-are-the-current-options-for-sto
ring-indexing-and-querying-geospatial-data

Original comment by clemm...@gmail.com on 18 Aug 2013 at 7:11