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


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


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


8

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


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


6

Background map and your data fit together because you have "on-the-fly"-reprojection enabled. This makes sense if you want to see WGS-degree-data on projected map backgrounds. But If you want to create buffers, both layers must have the same CRS. For buffers in metres, you have to change the degree data to a projected CRS (like RGF93 Lanmbert). So you have ...


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


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


4

I believe you might be working your problem using the wrong tactic. Not being an expert in Postgis either, I would: Put the points data in a Postgis Database; Buffer the points according to their windspeed with St_Buffer; Agregate the pairs of adjacent polygon using ST_Collect and somekind of point order attribute; Pass the result by a St_ConvexHull ...


4

FYI, the buffer tool always use the input layer's Coordinate Reference System (CRS) units. In your case, to buffer your points, it will always use WGS84 in degrees (Since WGS84 is a geographic coordinate system, and not a projected one). Notice, that changing the CRS by using "set layer CRS" does not change their actual values, It only says to QGIS "from ...


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

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

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


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

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

By making a buffer you approximate the distances (as you do not get a true circle, but a polygonal approximation of one). You can improve the rgeos answer by increasing the number of segments of the circle with the "quadsegs" argument: nbg.bff2 <- gBuffer(nuremberg, quadsegs=50, width = 20000) table( unlist(extract(germany, nbg.bff2)) ) 0 1 118 91 ...


3

For an ArcGIS solution, you can accomplish this analysis with a combination of selections, an intersect and via the create random points tool. Use a select tool to identify your basin. Make sure it is highlighted (usually in light blue) Run the Buffer tool on the "selected" river basin layer. To combine the buffer and the selected feature, use Merge ...


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

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.


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



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