Coffeehouse Thread

7 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

What is a good tool to calculate a grid of lat/longs at a given distance?

Back to Forum: Coffeehouse
  • User profile image

    Hi, friends,

    There is only one more month until is deleted forever.

    I am attempting to create as complete a list as possible of:

    • every username
    • every upload ID (whether that is an original photosynth, a panorama, or a tech preview synth)
    • every comment on each known upload
    • each user's list of favorites

    Using wildcard searches, collection type filtering, search categories, and either ascending or descending sort options it is possible to retrieve several hundred thousand collection IDs.

    The main problem is that the search API will not give you anything past 100,100 results, so you have to be creative with your searches to find more collection IDs and thereby more users.

    Once you know a username, you can ask for a list of all of their public uploads.

    To cut to the chase, there are two map querying options:

    1. search for all collections within a bounding box
    2. search for all collections within a radius of a geopoint

    What I need is some way, when searching for geotagged panoramas, is to calculate either

    1. a grid of bounding boxes or 
    2. a grid of geopoints for radius searches so that no part of the map is left unqueried for content

    The radius search has a maximum radius value of 8000 kilometers, so it may be more efficient to calculate a series of bounding boxes, but I need help either way.

    You can get a feel for how the
    Synths inside a geo bounding box and
    Synths within a distance of a geo point
    options work here.
    (Click the Code option on that page for a corresponding API URL)

    Here's a sample query for a bounding box query of the world:
    997,996 Geotagged Panos

  • User profile image

    I would say you need a GIS database or Datasource. Whenever I have performed GIS development, I have used sources like The National Ordinance Survey, the Royal mail have something similar or a company called Esri

    It has been a while since I have done any GIS work, but remember PostgreSQL being prominent, quite a bit different to Transact-SQL if you are used to that

  • User profile image

    Well I think one thing is to learn the google maps api  as you can give it an address and it will give you the lat/long for that address.

    that will help with some of what i think you need - the lat/long of a place when needed.

    another thing you will need to do some reasearch on is a thing that i think is called "the great circle" formula used in dealing with map / globe cacluations like how many miles from this lat/long to aother lat/long.

    also you need some math to deal with the way lat / long are plotted on a globe so part of the conversion of degrees to miles / kilometers is affected by how close to the poles the location is, the east / west distance gets squished as you near the poles.

    i hope that gives you some ideas on what to look up and such...

  • User profile image
  • User profile image

    wouldn't you just use sql server's geography datatype and the distance function.

  • User profile image

    wouldn't you just use sql server's geography datatype and the distance function.

    that only helps *if* he has a sql server to use and has the lat/long data to start with.

    with google maps you can use addresses to find the lat /long data and go from there....

    also if he needs to replace what photosynth did it may be good to use google maps as the basis for this....  

    but yes the sql geo is good stuff, i am working on a project right now that uses both google maps and sql server

    i call google maps and get the full data and store it in sql as json and store the lat / long in the sql geo type  and use that for several items like find the nearest company store to your current location via a sql query that gets all locations in a distance from a point and then orders them by distance

    so my results are like

    a 1 mile
    b 2 miles

    c 3 miles

    d 20 miles

    and so on....


  • User profile image

    use bounding box. Radius search is not applicable for your case.

    And radius system will be hard to predict unless you know they use Great Circle or exact configuration of the Ellipse. After all, Earth is not perfectly round. Either way, radius is useless for your use case.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.