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:


10

Summary This answer places the question into a larger context, describes an efficient algorithm applicable to the shapefile representation of features (as "vectors" or "linestrings" of points), shows some examples of its application, and gives working code for using or porting into a GIS environment. Background This is an example of a morphological ...


10

Let's break this down into simple pieces. By doing so, all the work is accomplished in just a half dozen lines of easily tested code. First, you will need to compute distances. Because the data are in geographic coordinates, here is a function to compute distances on a spherical datum (using the Haversine formula): # # Spherical distance. # `x` and `y` ...


9

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: http://ianbroad.com/downloads/CreateBufferIntervals.tbx 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 ...


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


7

It sounds like you are entering a value in miles or km (ie 10) but the projection is in geographic. The buffer tool will interpolate that as a 10 degree buffer. You will need to do one of two things. 1) translate you value to equal the buffer size in degrees, or, 2) reproject your data into a projection that is not geographic


7

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


6

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


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

I guess you have set the CRS for the layer in a false way. If the data was originally in WGS84 degrees, you have to reset the CRS to that, then rightclick on the layer and Save as... If you are in doubt, look at the extent of the layer under Properties, metadata tab. If it is in the range of +-180/90, it is definitely not UTM, but EPSG:4326, WGS84 degrees. ...


5

There is a "Distance or Field" parameter in ArcMap's Buffer Tool: http://resources.arcgis.com/en/help/main/10.1/index.html#//000800000019000000 To create the "inside" buffer, just use a negative number of the units.


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


4

If you are trying to create a buffered featured, ST_Buffer will work. If you are trying to select other features based upon a distance of your road network, you should consider using ST_DWithin, both as @simplexio suggested. See similar questions that should help you out: When should I use ST_Buffer? How to select all points within a circle in PostGIS? ...


4

A good way to buffer a zone is to query the Euclidean distance grid of its indicator. You wish to replace any cells in the intersection of Zone 3 and the buffer with Zone 2 values. Such conditional replacement is done with the mnemonic Con function. Notice this is not exactly what was requested: I understand from the legend in the figures that the intent ...


4

Something most likely went wrong with your projection settings along the way, but it's a bit hard to figure out where exactly the error lies, so it might be easier to walk through the process from the start. When you load the shapefile, you'll notice that you're asked to pick the coordinate reference system (CRS) your shapefile is in. Usually, this dialog ...


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

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

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.


3

In most GIS look for the process "Multipart to singlepart". This will break apart a multipart feature and make separate features of the constituent parts. I your example, you will end up with 4 separate polygon features. In QGIS go Vector->Geometry Tools->Multipart to singleparts. ArcGIS and MapInfo have similar tools (as does GRASS and pretty much any ...


3

Where your crime points have numeric fields which are amenable to simple statistics (mean, max, min, sum and median), this is straightforward. In QGIS go Vector->Data Management->Join Attributes by Location and set your target layer to the polygons and the 'join vector layer' to your points, then choose the summary statistics (second option). In ArcGIS, ...


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

If you want the user to specify both a distance and units, as can be found in the Buffer tool (and most other tools that specify a distance), you can use the Linear Unit parameter. You can pass this whole parameter value to the tool The distance passed to buffer can be numeric (in which case it's in the units of the feature class) or as numeric with units ...


3

Check out the Path Distance tool in Spatial Analyst. If I understand you correctly, you are essentially wanting a 3d-distance surface for which you can create a distance buffer. Using the Path Distance tool, use points as source locations, do not input a cost raster, and only input your DEM as the surface raster. The values in the surface raster are used to ...


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.



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