Tag Info

Hot answers tagged

17

The Python GDAL/OGR Cookbook has some sample code to Buffer a Geometry. from osgeo import ogr wkt = "POINT (1198054.34 648493.09)" pt = ogr.CreateGeometryFromWkt(wkt) bufferDistance = 500 poly = pt.Buffer(bufferDistance) print "%s buffered by %d is %s" % (pt.ExportToWkt(), bufferDistance, poly.ExportToWkt()) and to Calculate intersection between two ...


15

Use the Erase (Analysis) Tool:


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


10

Here is my list of Python geoprocessing software. Shapely, python OGR, python QGIS, pyqgis, python SagaGIS, python Grass, python spatialite, pyspatialite, python PostreSQL/PostGIS, Psycopg, python R Project, rpy2, python Whitebox GAT, python GeoScript, jython


9

I made a custom Create Buffer Interval toolbox for you: In ArcMap open ArcToolbox, right click in the whitespace and click Add Toolbox. Browse to the one I made and run the Create Buffer at Interval tool. Here's a screenshot of the parameters: It should be pretty straightforward, but let me know if you have any questions!


8

Shapely gives python access to GEOS which can do buffers/intersects/etc. GEOS is the library most OSGeo programs use to perform those operations.


8

To simplify, Shapely: manual allows all geometry processing of PostGIS in Python. The first premise of Shapely is that Python programmers should be able to perform PostGIS type geometry operations outside of an RDBMS... The first example of PolyGeo from shapely.geometry import Point, LineString, Polygon, mapping from shapely.wkt import loads pt = ...


8

Since Erase (as @Jens linked) only is available with an Advanced license, you can download ET Geowizards. It can be installed as an Arcmap toolbox. Although you have to pay for the full suite, there's a free part of the program and the Erase function is included there (Overlay group).


6

Using the buffer tool, you should be able to set the buffer to the values in a field. Selecting the 'field' radio button rather than the 'length' option in the Distance section, you can define the buffer width using table values.


5

It is a challenging question to do this in raster because you don't have the opportunity to use the value of the pixel for defining the size of the buffer. Therefore you would need to do the focal filter for each value, as you already said. Here is a possible answer to do it with only 3 filters (I couldn't find less), but not perfectly as mentioned by ...


5

Here's some R code that does the job, the caveat being we are in cartesian coordinates. The input matrix coords is a 5x2 matrix of x,y columns, with the last point being coincident with the first point. This is what you get out of spatial objects in R when you read a shapefile, for example. thinrect <- function(coords, factor=1/3){ dx = ...


5

In step 4, you have to change the CRS from NAD83 to another projection that uses metres as units. It depends on the extent of your data which one is best. Unfortunately, your data is located all over the world, so you could: Create a custom CRS using aeqd (or tmerc) for each one, and draw just that one buffer with it. Practically, you only have to create ...


5

Would something like this work for you? I'm assuming that the right of way area includes both sides of the road and that you know the length of the road you are measuring. // Use the same sq distance measurement as your buffer, a sq meter area uses a buffer in meters var_area = 500 road_length = 100 buffer_distance = (var_area/road_length)/2 ...


4

Another option would be to create separate rasters for each pixel value, in this case 4 rasters, with a condition. Then expand the rasters by a pixel count corresponding to the raster's value (by possibly iterating over a value list). Lastly, join the rasters (either algebraic or spatially), to create one binary raster for the tree crowns.


4

Vector-based approach This task can be done in three steps: Raster To Point; Buffer (using the VALUE field as buffer field); Feature To Raster. Note: using the buffer field avoids the calculation of a buffer for each crown radius value. Raster-based approach Avoiding the vector-based solution, this problem suggests to use a kind of Cellular Automata ...


4

from GRASS GIS: v.buffer: -c Don't make caps at the ends of polylines from the interface of v.buffer.distance in QGIS (Processing Toolbox): from the interface of v.buffer.column in QGIS (Processing Toolbox): or use GRASS GIS directly and not the GRASS plugin (as says zimmi)


4

Aha, I was confused for a while, but now I'm not. Generally, I would expect a buffer in UTM to match up pretty well to a geodetic buffer. Close enough you wouldn't be able to see the difference. But, looking at your map, it looks like you're working in a European city, but you're generating your PostGIS buffer in UTM 18, which is valid in the area of New ...


4

How about this for an idea. Run your data through the near tool to create a table of distances. Sort this table by distance then identify the distance that is your 50% of points. This would be the buffer distance.


4

If you use the v.buffer tool in the Grass Commands toolsets, you can make a flat buffer. There there are two choice boxes If you have Make outside corners straight set to No, and Don't make caps at the ends of polylines as Yes, the result should be similar to the ArcMap straight edge buffer. The following are the 3 combinations of the above two ...


3

Another free option if you don't have an Advanced license for ArcGIS is the Xtools Pro extension suite. Like ET Geowizards, some of the tools are only available if you buy a license but most of them are free forever, the Erase tool is one of the free ones.


3

Just to add for future reference, I got JSTS to work with Leaflet.js by exporting / importing GeoJSON between the two libraries. It's obviously not very efficient if you're doing a lot of processing but for simple one off conversions it's a pretty straightforward solution. function buffer(leafletGeometry, distance){ var reader = new ...


3

Here is a pure raster solution in Python 2.7 using numpy and scipy: import numpy as np from scipy import ndimage import matplotlib.pyplot as plt #create tree location matrix with values indicating crown radius A = np.zeros((120,320)) A[60,40] = 1 A[60,80] = 2 A[60,120] = 3 A[60,160] = 4 A[60,200] = 5 A[60,240] = 6 A[60,280] = 7 #plot tree locations fig = ...


3

This can be solved with a model but there are 4 caveats: You need an Advance (ArcInfo) license This model assumes your rectangle is a rectangle so the 2 vertical sides are longer Your rectangle is constructed from 4 vertices only If you want to automate this then all your rectangles must have the same dimensions So after running this model you you are ...


3

You can do this with a SQL Statement in MapInfo either thru the SQL Select dialog or thru the MapBasic window. If the polygons in your development table overlap, you might need to combine these to find the correct percentage, that is avoiding a common area to get calculated more than once in your percentage. If you need to combine the development objects ...


3

I suggest to use one of the LAEA or LCC Europe projections: EPSG 5633, 5635, 5636, 5638 LAEA Europe EPSG 5632, 5634, 5637, 5639 LCC Europe All EPSG codes of the same type seem to have the same projection parameters. ESRI also offers projections Europe_Albers_Equal_Area_Conic (102013) and Europe_Equidistant_Conic (102031), but they almost look the ...


3

There are two strategies to handle this. One is to replace the tracks by closely spaced sequences of points and then apply the alpha hull techniques suggested in some comments. Perhaps a simple and faster way uses a raster representation (such as the image in the question itself). I will discuss the latter. A little simplification--perhaps by dilating ...


3

your coordinates are probably in lat/long with degrees as a unit. therefore, along meridians or near the equator, one degree is approximately 111km (circumference/360). note that this will change depending on the distance to the equator. A good practice is to use a local projected coordinate system that is appropriate for your location in order to have a ...


3

Try using a combination of the Multiple Ring Buffer tool and then the Polygon to Line tool, this should give you what you are looking for.


3

As a shapefile FIDs' are contiguous and 0 based, you can use that to your advantage: import sys, os, arcpy InFC = sys.argv[1] # must be a shape file OutFC = sys.argv[2] # change as appropriate DivisorSize = 1000 BufferDistance = 100 TempDir = os.environ.get("Temp") MaxFeat = int(arcpy.GetCount_management(InFC).getOutput(0)) StepRange = ...


3

You have to use a projected CRS like UTM (for your part of the world) to get real circles and meters as units. Please do not use Google/Web Mercator, it does not use real meters as units (only at the aequator).



Only top voted, non community-wiki answers of a minimum length are eligible