Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    GeoModel 0.2.0

    Download button

    No screenshots available
    Downloads: 484  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Excellent (5.0/5)
    1 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Roman Nurik | More programs
    The Apache License 2.0 / FREE
    August 31st, 2009, 08:44 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    GeoModel description

    Indexing and querying geospatial data in App Engine

    GeoModel is a project that uses geohash-like objects called 'geocells' to provide a generalized solution for indexing and querying geospatial data in App Engine. GeoModel is optimized for the basic real estate finder/store locator use case, but can be adapted for use with large datasets.

    Using GeoModel, developers can instantly geo-contextualize datastore models by simply inherting from the GeoModel class. Currently, entities can be associated with a single geographic point and subsequently indexed and filtered by either conformance to a bounding box or by proximity (nearest-n) to a search center point.

    Creating and saving GeoModel-derived entities

    To use the GeoModel class, simply declare a new model class inheriting from the geomodel.GeoModel class like so:

     >>> import google.appengine.ext.db
     >>> import geo.geomodel
     >>> class MyEntity(geo.geomodel.GeoModel):
     ... foo = google.appengine.ext.db.StringProperty()
     ... bar = google.appengine.ext.db.IntegerProperty()


    Currently, only single-point entities are supported. Entities of the new MyEntity kind will have a location property of type db.GeoPt, which can be set as needed. Before put()'ing entities to the datastore, make sure to call update_location to synchronize the entity's underlying geocell indexing properties:

     >>> some_entity = MyEntity(location=google.appengine.ext.db.GeoPt(37, -122),
     ... foo='Hello',
     ... bar=5)
     >>> some_entity.location = google.appengine.ext.db.GeoPt(38, -122)
     >>> some_entity.update_location()
     >>> some_entity.put()
     datastore_types.Key.from_path(u'MyEntity', 1, _app=u'test')


    Querying your entities

    There are currently two types of basic geospatial queries supported by the GeoModel library:

    * bounding box queries
    * proximity (nearest-n) queries

    To perform a bounding box query, use the bounding_box_fetch class method like so:

     >>> import geo.geotypes
     >>> results = MyEntity.bounding_box_fetch(
     ... MyEntity.all().filter('bar >', 4), # Rich query!
     ... geo.geotypes.Box(39, -121, 37, -123),
     ... max_results=10)
     >>> results[0].foo
     u'Hello'


    Be careful not to request too many results or else you'll get a datastore or request timeout!

    To perform a proximity query, use the proximity_fetch class method like so:

     >>> result = MyEntity.proximity_fetch(
     ... MyEntity.all().filter('bar >> result[0].foo
     u'Hello'


    Note that for rich queries on multiple properties you'll need to set up the proper indexes in your index.yaml file. Testing your app on the development server should populate that file with the required indexes. Also, GeoModel currently requires many internal properties on each entity (one for each geocell resolution), which can lead to messy looking index.yaml files. That's something that will hopefully change in future versions.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    geohash-like objects | query geospatial data | App Engine | geocells | geospatial | data

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM