Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:03:54+00:00 2026-06-12T19:03:54+00:00

I am trying to do a proximity_fetch with the GeoModel class for Google App

  • 0

I am trying to do a proximity_fetch with the GeoModel class for Google App Engine. The entity I want to use it for is ndb and I am not sure what I need to download and import and what I can just import from google in my python code. The websites seem to be a little outdated and I was wondering if anyone had more pertinant information. This is what I have so far and it is telling me that Location has no attribute proximity_fetch, which I know but I am not sure how I should define it in the Location(ndb.Model) class.

        g = geocoders.Google()

        place, (lat, lng) = g.geocode(inputlocation, exactly_one=False)


        bound = 20
        upper = lat + bound
        lower = lat - bound
        left = lng + bound
        right = lng - bound

        locations = []

        if lat and lng:
            locations = Location.proximity_fetch(
                                                 Location.query(),
                                                 geotypes.Point(lat, lng),
                                                 max_results=50,
                                                 max_distance=500000) 

Also when I try to import geomodel and geotype which seem pretty vital for this it gives me an import error and I am not sure where to get them from.

Any help or examples would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:03:55+00:00Added an answer on June 12, 2026 at 7:03 pm

    You should first checkout the latest code from the SVN repository. You can find the information about this at http://code.google.com/p/geomodel/source/checkout

    After you have the code locally on your machine, inside the main directory there is a directory called geo. You should copy this directory into your GAE project. Then in your code, you import what you need from this package. For example:

    from geo import geomodel
    

    Now, regarding your Location model, in order to be able to execute a proximity_fetch Query, your model should extend the provided model in geomodel called GeoModel. Thus, you should have something like this:

    class Location(ndb.Model, GeoModel):
    ....
    

    Notice that GeoModel currently uses the “old” GAE datastore layer db and not ndb that you are using in your code. However, it shouldn’t cause any trouble.

    For more information on how to use geomodel, you should also take a look at the demos that also exist in the code you got from SVN. You can find them in the demos directory.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use GeoModel python module to quickly access geospatial data for my
Trying to build out an exception if move.UserId does not equal currentUserId then Redirect
I'm trying to do some proximity detection of iPhones but I need to get
I'm trying to create an app that utilizes the proximity sensor in most Android
The user of the ASP.NET web app I'm building can select colors for use
Trying to use JSPX and running into a strange problem. Text inside jsp:text is
I have Sphinx Search installed as my search engine and I'm trying to add
Trying to install and use ruby 1.9.2 on my server. Running Ubuntu 11.10. $
Trying to debug a plugin in CRM 2011 can be extremely difficult. Not only
Trying to import a custom UITableViewCell and it keeps giving me a file not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.