Tag Info

New answers tagged

2

Looking over your code, I don't see how it will be faster than pure Python. It's exclusively calling Python methods (rasterio methods, np.dstack is Python) and those aren't executed any faster just because the function is compiled with Cython. The key to speeding things up is in here: # Iterate over rows and columns in this block for x in ...


2

For using processing standalone, it must be initiated with an interface. Thus, you can create a dummy iface before calling processing: import qgis app = qgis.core.QgsApplication([], True) import processing class DummyInterface(object): def __init__(self): self.destCrs = None def __getattr__(self, *args, **kwargs): def dummy(*args, ...


12

If you are interested in an implementation look at jsts a Javascript implementation of the much used Java Topology Suite library -- depending on whether you prefer reading Javascript or Java, I suppose. A general idea of how the algorithm works. For points, it is trivial, you simply buffer them by a given radius. If you have multiple points, you will have ...


1

In my MPSuperShape product, it is possible to apply a buffer to a convex polygon. This is performed by moving the vertices outwards on the line that bisects the two edges at that vertex. The distance is chosen using trigonometry so that the edges both move out a user-specified distance. This works well but acute vertices can extend disproportionately. Ie. ...


0

Thank you for the answer, in case that anyone else has the same problem be informed that i solved my problems using the geoPHP library!


0

To compute the buffer on the client side, you could use JSTS and its buffer function. See the example here. On the server side, it seems MySQL extension for spatial data also has a buffer function. If you need to compute high distance buffers, be aware the projection matters.


1

You shouldn't need to re-implement the wheel, there are lots of geospatial libraries out there. As you've noticed, PostGIS includes a buffer function, unfortunately MySQL has sub-standard spatial support and therefore doesn't include one. If possible you may wish to consider switching to PostGIS if spatial functionality is important to you. There are ...



Top 50 recent answers are included