I have a shapefile of 1241 dam locations in Washington, if I open the attribute table I have only latitude and longitude.  I want to convert this to a raster with counts of the number of dams in each raster cell. I am using QGIS but could also use R.
86902
I have a point layer that shows the distribution of a species.   Is it possible in QGIS to convert this point layer to a raster grid in which the value of each cell corresponds with the amount of points within that cell?   Until now, I only managed to attach attribute values to the grid cells. I have already added a column in my attribute table that has the value '1' for each point, hoping that there is a way to use a sum of attributes for each grid cell.
54880
I have a polygon shapefile of many lakes, I also have a point shapefile of locations on those lakes where fish were caught.  The point shapefile contains the attributes: Fisherman_iD, Fish_Caught, Lat, Long.  The polygon shapefile contains the attributes Lake_name, Points_per_polygon(PNTCNT)  Each point obviously has differing entries under the fish_caught field.   What I want to get is the average fish caught per lake (polygon).  So I need to have a total number of fish caught, per individual polygon, and then I can divide that by the PNTCNT file I create using the Points in a Polygon tool.  Ideas? I am relatively new to QGIS.
81944
I'm trying to reclassify only a certain part of a raster...not the entire raster.  Here's the problem.  I have a LULC raster of the entire US.  There are some issues with the raster that I want to fix, namely some cells that should be water are classified as wetlands.  These are mainly off the coast, not inland.  However, some cells that are classified as wetlands should really be wetlands (mainly inland) and I don't want these to change.  I plan on using a ZIP Code boundary file to determine which cells are considered "off the coast" and which ones are not.  I have access to ArcGIS 10.1 and R with the appropriate raster packages I need so a solution in either software would be fine.  Can anyone help me figure this out?
93198
I’m new to ArcMap and was wondering if anybody could help me out. I have a shapefile with counties and wells in that county. In the table I’m trying edit it so that for each county calculate the total numbers of wells that fall into that county, and update the county table with the total count. I also want to calculate how many wells there are per area unit, and update the table with that value as well.  import arcpy featureClass = "C:/Lesson5_Data/Colorado_cities.shp" fieldList = "*"  with arcpy.da.SearchCursor(featureClass, fieldList) as cursor: for row in cursor: print row[4  population = 10000  whereClause = '"POP2007" &gt;= ' + str(population
98185
I'm trying to convert a shapefile into a raster within R. My approach is to read in the raster as follows:  library(rgdal) # Loads SP package by default demo &lt;- readOGR('F:/data/', 'shapefile') # Creates a SpatialPolygonsDataFrame class (sp)   This works fine, and I can plot it. However it is a large shapefile and I want to convert it into a raster. I've tried the following:  r &lt;- raster(ncol=180, nrow=180) Demo_ras = rasterize(r, demo, 'pop')  # pop is an integer here   Error message:  Error in function (classes, fdef, mtable)  :    unable to find an inherited method for function "rasterize", for signature "RasterLayer", "SpatialPolygonsDataFrame"   I'm slightly confused which is the correct order of the arguments. I've also tried this:  Demo_ras = rasterize(demo, r, 'pop')   Which results in the follow error:  Error in .polygonsToRaster(x, y, ...) :    polygon and raster have no overlapping areas   While it makes sense that a raster cannot be generated for an area that does not cover the SpatialPolygonsDataFrame, I'm not sure what information I need to specify so that the raster should contain the SpatialPolygonsDataFrame area.
46592
I am using ArcGIS Desktop to view one shapefile.   Only a select number of features are being displayed. The same number are showing in the attribute table even though the database file (.dbf) has a complete list with many more features.   I then tried opening the shapefile in QGIS and it informs me that the file is invalid. Upon inspection of the shapefile, I found that the .shx file is missing.  Can I recreate the missing .shx file so that all the attributes/features can be loaded?
45045
I am a beginner to python coding in GIS. I want to calculate the total number of counts in raster attribute table. In order to do that:   I would like to build a attribute table of raster data use a loop through attribute table using ARCPY.SearchCursor()   Therefore, I wrote a code to build an attribute table. However, I am getting an error while running the code and not able to figure out the error in the code.  Code:  import arcpy # Create the geoprocessing object  import arcgisscripting gp = arcgisscripting.create()  #To overwrite output arcpy.env.overwriteOutput = True  #Set environment settings gp.workspace = "C:/Subhasis/Test/raster-read"  #Build Raster Attribute Table gp.BuildRasterAttributeTable_management("sti-9", "Overwrite")  Error Message: Traceback (most recent call last):   File "C:/Subhasis/Test/raster-read/test.py", line 15, in &lt;module&gt;     gp.BuildRasterAttributeTable_management("sti-9", "Overwrite") ExecuteError: ERROR 000049: Failed to build attribute table Failed to execute (BuildRasterAttributeTable).
80896
How does one go about obtaining a summary of the counts of cell values within a raster in QGIS? I know QGIS is doing this, in order to provide the summary statistics and histogram in the properties of the layer. I do not need the summary statistics nor a histogram image, but rather counts of individual values.   It looks like there was at one point an attempt to add a special feature for this (Feature #4321, ).   Am I missing something really obvious?
46752
I'm not much of a GIS user, but I've got a big ascii file that I'm trying to convert into a   lat  long  data x1   y1     d1 x1   y2     d2 x1   y3     d3 x2   y1     d4 ... etc   format, so that I can work with it in R.  I've got global national identifier data (i.e.: which country occupies what grid) at 2.5 arc-minute resolution, but I want to coarsen it into half-degree, because that is the resolution of the rest of my data.  I could do so in R if the file weren't so large -- its 3.9GB and I can't read it into memory.  A NetCDF file would obviously be ideal for me, but I can't find a netcdf version of the data I want.  The data is categorical -- country identifiers.  What I want to do is simple to take each 12x12 block of gridcells, evaluate that N=144 matrix, and return the country that appears the most times.  (I'd also like it to ignore NA values, unless all values are NA).  This would be easy enough in R if I could only open the darn text file.  So I opened QGIS, but there doesn't seem to be any obvious way to "coarsen" a raster.    Is there one?    Then it occured to me that I could convert the data to vector, and then convert it back to raster, specifying the resolution that I want.    BUT is there a way to do so that would allow me to specify that each gridcell should be .5x.5 degrees, going from -180 to 180 and -90 to 90?    This seems like a pretty gross hack.    Is there a better way?    I've decided that it makes more sense for me to just make the file into a netcdf using a remote machine with the memory for it.
73941
I have a DEM file of one district, and I have used those following tools in spatial analyst tools in ArcGIS 10.1 to get files related to the original DEM file：   Fill Flow direction Flow accumulation   Besides, I already have the point shapefile that these points are vertices in the river the one belongs to the same district as DEM file, so I use the point shapefile as the pour points in the river.   I use the watershed tool, setting my flow direction file and point shapefile as input files, try to get the subbasin area in this river.  I just got this：   But here's the schematic photo that I want：I want to get every subbasin area and calculate them, assigning them to the attribute of the designated segment   In what way should I use tools in ArcGIS to achieve my goal, thanks for giving me any suggestion!  Although I have a great answer to this question, I got another problem afterwards：
65809
How could I convert values of 32767 to 0 using raster calculator in QGIS?
45137
This is a lake of approximately 13 ha with 81 sampled depth points in about 10 transect lines:    Previously in ARCgis with a 50 ha lake and about a 100 depth sampling points, I got decent output with the TopotoRaster tool. However, no such exact equivalent seems to exist with QGIS or open source software.  In QGIS, I got the interpolated raster below, using the TIN method in the Raster Interpolation plugin. However, this seemed to be a lucky outcome, when I tried to repeat, I got different results (unsatisfactory) in spite of not really varying any parameter.    These are more urban (constructed) tanks than lakes, therefore, they are fairly regular in their bed profile, hence the low point sampling density. Some articles seemed to suggest Inverse Distance Weighting (IDW) as the most suitable technique, yet I seemed to get the worst results with that (possibly owing to low point density).  Are there any heuristics which can be employed here considering the size of the lake, its regular profile and the point sampling density to arrive at which interpolation method is apt? (between Kriging, IDW, Bilinear, Cubic convolution, TIN or spline)  Or is it always a bit of trial and error?
86909
I am in QGIS. I have a raster layer of mountains and a lake. I have a vector layer (shapefile) of the lake. It sits nicely where it supposed to be over the raster level. I am going to convert this height map to an STL so that I can cnc this out of wood, so I'd like the actual lake to be something like 200 feet lower than it shows on the raster layer so that I can fill it with blue epoxy. I have read a lot of clipping and everything else, and I am lost.
32273
I'm 90% sure this basic question has been asked before but looking through the other posts I simply do not see a useful answer.  I need to calculate polygonal(vector) catchment areas from a raster based on minimum driving distance/cost from a set of points. I've already got the raster, and for that matter, the nodes(intersections with cost attribute) used to interpolate it. What I need now are polygons for each point describing the area nearer it than any other point. This is basically like a voronoi diagram but based on network distance rather than euclidean space.   How exactly can I do this using only open-source tools? I'm comfortable with the command line if I just know what I'm looking for. I feel like GDAL is going to be the answer, but if so, what exactly is the command I'm looking for?  Thanks!
69835
so I have a shapefile with buildings and the shapefile has the height of the buildings in the attribute table. I have a second shapefile with the districts the buildings are located in. Now I would like to count the mean height of the buildings in each district and add it to the attribute table of the districts. For raster data it would be easy using zonal statistics to get the mean for a specific area, but I cant figure out the solution for 'shapes within shapes'.
96451
how can I calculate sums, averages etc of raster-points (multi-band) per polygon of a vector-layer. I was told that this is called "zonal statistics". I tried that with QGIS first.   There is a way to do it but that is much too slow (convert raster to vector, intersect with second vector-layer, calculate geometry, export numbers, calculate statistics with spreadsheet or other program, re-import the results, takes forever for my 350.000 raster-points).  I was also given the hint to use saga-gis. That has "zonal statistics" but those are based on categories from a raster-band, not on polygons from a vector-layer. So to use this I would have to convert my vector-layer to raster and then calculate the statistics.  This seems to be the wrong way to solve this. There would be no way to account for raster-points that belong to 2 or more polygons because they are intersected by the polygon-boundary. I assume that polygon-based statistics should be able to handle this so I also assume that I haven't found the correct module yet.  Saga-gis has really many modules. Please let me know which one is the right one for this application.
31180
I have been able to import into QGIS a set of raster topographic maps and the associated DEM raster maps. It registered the two for me. From there I have calculated the associated slope raster map. Now I want to export the data to a CSV file (or similar format) for processing in a program that I am writing. Ideally the data would be structured in a way that would permit me to query for the slope and elevation data for any given point on the map.   If this is possible, then how do I do it?  Specifically, I have been able to export the data (slope &amp; DEM) to two different CSV files. However I would prefer the data in one file if possible.