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 8651985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:12:07+00:00 2026-06-12T14:12:07+00:00

I am writing a website on Google App Engine in Python and I have

  • 0

I am writing a website on Google App Engine in Python and I have a Location datastore entity that has a string property containing GPS coordinates. I want to let the user search by GPS coordinates and I want to return all locations that at within +/- 10 points of Latitude or Longitude. Basically what I wanted to do is in the following code but I cannot sort the GPS that way, one because it is a string and two because it is the same property.

  inputlocation = self.request.get("userlocation")

        g = geocoders.Google()
        try:
            place, (lat, lng) = g.geocode(inputlocation)
        except ValueError:
            geocodespot = g.geocode(inputlocation, exactly_one=False)
            place, (lat, lng) = geocodespot[0]
         GPSlocation = "("+str(lat)+", "+str(lng)+")"
         GPSlocation = float(GPSlocation)

         bound = 10
         upper = GPSlocation + bound
         lower = GPSlocation - bound
         left = GPSlocation + bound
         right = GPSlocation - bound

        if GPSlocation:
            locations = db.GqlQuery("select * from Location where GPSlocation>:1 and where GPSlocation>:2 and where GPSlocation <:3 and where GPSlocation <:4 order by created desc limit 20", upper, lower, left, right)
#example GPSlocation in the datastore = "(37.7699298, -93.4469157)"

Can you think of any way to do basically this without having to change the way my datastore is set up? Is there any way to get that information without just making two properties one for Latitude and one for Longitude?

  • 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-12T14:12:08+00:00Added an answer on June 12, 2026 at 2:12 pm

    It looks like Google GAE has a few tools for doing what you want to do:

    • https://developers.google.com/maps/articles/geospatial
    • http://code.google.com/p/geomodel/

    the proximity_fetch looks like what you need

    def proximity_fetch(query, center, max_results=10, max_distance=0):
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a website with python and jinja2 in google app engine. My
I am writing a Google App Engine (Java) application that reads data from a
I'm making a website with google app engine, but I have a question about
I'm writing a python script that scrapes a website, where the website uses OpenID
I have started writing articles for my blog recently and then realized that google
I'm trying to use go instead of python for my website on google app
I'm currently writing a website in ASP.NET MVC, and my database (which doesn't have
I'm writing a website in ASP.NET MVC, using the ASP.NET MVC 1.0 template that
I am writing a new website that uses PHP and MySQL. I am trying
I'm writing a MVC website and using jqGrid. I have managed to get it

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.