Tag Info

New answers tagged

4

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 ...


1

If you are particularly interested in using meters as the unit for the search, you can use geography data types instead of geometry types. All geography based calculations return values in meters. Also, ST_DWITHIN is designed for this type of queries: select * from zones z where ST_DWITHIN(Geography(ST_Transform(z.geom,4326)), ...


4

Maybe check out the properties of Projected Coordinate Systems, to get a view into their utility? There are 3 aspects or properties presented in Projected Coordinate Systems that establish their utility and rationale. Any projection of 3D space on a 2D surface will of course exhibit distortion versus reality. Depending on your application, using a specific ...


7

There's a good answer over at Stack Overflow, which goes a little something like this: The geography type is a little bit more restrictive than geometry. It can't cross different hemispheres and the outer ring must be drawn counter-clockwise. The rest can be found here. Another article goes into some more detail: If you’re looking for the ...



Top 50 recent answers are included