Tag Info

New answers tagged

3

Here is one example from the John Hutton Institute in Aberdeen (formerly The Macaulay Institute - where I headed up their commercial GIS team, though didn't create this game), Scotland, which might provide some ideas.


1

I declared one point in each octant of the globe, transformed it to XYZ using the equations I had, and then tested martin f's answer. It didn't returned the same points. Then I delved deeper into Wikipedia's equations, and I finally understood how they worked. Then I adapted them. latitude(r, x, y, z) = arcsin(z/r)(180/π) longitude(r, x, y, z) = if (x ...


0

The wiki reference you cite is based on a mathematical, not a geographic/cartographic, convention, as you say. It does however try to relate the geographic/cartographic equivalents. Here's my interpretation of the equivalencies: Mathematics Geography/Cartography r, radial distance R + h, radius + altitude φ, polar angle 90 - φ, ...


5

You need to use a spatial index. Without an spatial index, you must iterate through all the geometries. With a bounding spatial index, you iterate only through the geometries which have a chance to intersect the other geometries. Popular bounding spatial index in Python: R-tree index (Python modules Rtree or pyrtree) Quadtree index (Quadtree module) ...


2

When it comes to optimizing code, don't guess - profile http://stackoverflow.com/questions/582336/how-can-you-profile-a-python-script. Just looking at your code, a similar statements : avail_area = pt_buffer.intersection(sa).area seems like it would get called even more than the statement you identified, since it's nested in yet another loop. Also, you ...



Top 50 recent answers are included