-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stored procedures. #21
Comments
yes, that's good. btw, to get the tiles that intersect with a bounding box viewport, see query 1 in #9. |
So, my ignorance of stored procedures leads me to ask more questions. When it comes to subselecting only pixels in the user's viewport: Is there any reason not to call one stored procedure from another? Ie, I have one that creates a polygon from 2 lats and 2 lons:
Then one that uses that to eg select centroids:
Is that kosher? |
Also, I presume a polygon made in such a way is made from four great circles (as it would be in |
the code above runs through and calling stored procedures within other stored procedures should be fine, but let's ask @TanuMalik here to be safe. not sure i understand the other question fully. i mean if the user selects a quad in a d3 viewport and we use an equirectangular projection then we are going to end up with a rectangle on the plane, aren't we? |
If we assume that the polygon is constructed by connecting the points by the shortest lines, then all four edges of the bounding box will be great circles (like how a plane from NY to Copenhagen flies further north in order to get the shortest route). So if we pass the SW, SE, NE, NW corners of the viewport, the segments Unless there's some manner of telling PostGIS not to draw straight lines assuming a spherical geometry, but to draw straight lines in the projected planar geometry. Otherwise you could pass enough intermediate points between |
hmmm, but why do we assume that 'the polygon is constructed by connecting the points by the shortest lines' in the first place? i mean if we use |
@legendOfZelda the thing on using I need a little of time to think on the projection issue. Usually the database is able to provide the reprojections, specially if it is |
Actually I made a mistake on this assumption. I was looking into the ATLAS code, and it seems that we use an However, when displaying, we have some sort of Azimuthal projection, and probably the parameters acquired from the viewport would reflect that. I've got confused in this. @njmattes are we using a "base" projection for the data that we receive from the database, and when displaying it, we reproject it? |
Sorry, we have an on-campus interview happening today, so I won't be able to look to deeply into this until the weekend. But I'm pretty sure that the current version of ATLAS only uses equirectangular. The old prototype used three projections each at a different scale. But I don't remember off the top of my head what they were. Highest zoom level was equirect though. |
@legendOfZelda @ricardobarroslourenco Started a branch for stubbing out the various stored procedures we need. In order to minimize network traffic, we'll want to return only the data within the user's viewport. Probably best to pass a bounding box as an argument to the stored procedures.
Hack away!
The text was updated successfully, but these errors were encountered: