Tag Info

New answers tagged

0

gdal_calc.py as stated in documentation: http://www.gdal.org/gdal_calc.html uses numpy array functions, in this case numpy.maximum, which is specified here: http://docs.scipy.org/doc/numpy/reference/generated/numpy.maximum.html It says you can use only 2 parameters. So your calculation expression for three grids must look like this: ...


0

You can try Grid – Filter→DTM Filter (slope-based). There is a very clear instruction in document by mr. Volker Wichmann, that could help you: http://geostat-course.org/system/files/pc_processing_with_saga.pdf. It's on page 26, but in your case it's worth to read all.


0

While I cannot comment on the suggested implementation, you may want to check an existing implementation of histogram matching done for GRASS GIS 7 (here an addon): https://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.histo.match For the manual and an example, see http://grass.osgeo.org/grass70/manuals/addons/i.histo.match.html The code is ...


0

The only way I can think of doing this in a raster environment is to take each raster that contributed to the weighting and reclassify into multiples of 10 then add all these together. At this point I am assuming your weighting rasters were essentially binary in nature. For example you had 4 weighting rasters A, B, C and D and for each raster it had a value ...


0

In your (excellent) description of the problem, one thing worries me: your use of the "Set Layer CRS". This should almost never be used, and often causes trouble. THis option has only one (rarely needed) purpose: If you load a layer which: Is lacking a CRS definition AND You know in advance what the correct CRS is then you can attach the correct CRS ...


1

using Arcmap 10.1 you can use an alternative option: 1. add your all geo-refed raster in a new arcmap 2. define the projection properly in the data frame properties 3. Go to windows menu and click on image analysis. 4. In image analysis tool select all your rasters and click on mosaic button present in a window below named "processing". 5. A temporary raster ...


0

In ArcGIS: Union the two feature classes (FCs), lets say FC1 is the main FC and FC2 is the FC you're testing to see whether it fits. Calculate summary statistics with statistics field being the min of the FID of FC1 and the case field being the FID of FC2. Join the resulting table back to FC2. Select by attributes where FREQUENCY = 1 and MIN FID of FC1 > ...


2

If you want to query by x & y coordinates, use Get Cell Value (Data Management) . If you want to query by point features, you can use Sample (Spatial Analyst) or Extract Values to Points (Spatial Analyst). If you want an array of raster values in an extent, you can use RasterToNumPyArray (arcpy).


1

If you specifically want a single elevation (or specific elevations) as lines you can use Contour List (3d analyst, Spatial analyst). Unlike Contour (3d analyst, Spatial analyst) which creates contours at a specific interval the contour list tool produces contour isolines at specific elevation values.. for this example you would supply the value 0 for ...


2

I am using vector and raster approach to solve it. The script below has 3 input parameters: a) polygons (must be single part), b)output point feature class to store the points most distant from polygon boundary c) tolerance in map units. Algorithm: POLYGON =shape geometry calculate centroid of POLYGON (p1) Define distance from centre to polygon outline ...


0

Clearly the file is corrupted. Try downloading it 'by hand' and see if it is OK. If so, try download.file(, mode="wb")


5

You could take the resulting raster from your initial conversion and use Spatial Analyst --> Math --> Times to multiply the raster by -1.


1

Images can only contain full pixels. Keeping both the the pixel size and exact clipping area is only possible if the clipping area is multiple of the pixel size. You can keep 200 by 200 pixels with 2000x2000 meters sized output but not if the output area is 2001x2101 meters. By default the area is kept accurate and pixel size is adjusted. You can alter the ...


0

Here is a solution on QGIS(if i got you correctly) You should first do a copy your layer, then install the plugin called spatial request : docs You can now do the usual GIS Stuff ie : select features that are completely whtin another feature, ect... see the post from Slslam ! This plugin will select these features, if you want to save them in another ...


2

For that kind of dataset I would argue that would be un-wise and try to reproject-on-the-fly. It can be done with ST_Transform(rast), but if you want to go that road be sure to include spatial extents (rast type can be casted to geom type). As aerial images are mostly for viewing I would suggest to consider using an intermediate step by using a ...


0

using arcmap 10.1 Open the attribute table of reclassify raster and select the areas whose intersection to be checked with road lines, this is optional and need only when you are checking relation ship with specific area for example river area with road lines. 2.Open the arc toolbox and expand Conversion toolbox. Expand "From raster" tools and select ...


2

If i got you, you want to check if your circle can be inscribed inside the polygons.You can do it in ETGEOWIZARD,an arcmap addin, (see pics below) for those polygon and separate those maximum inscribed circles have area greater than or equal to that of your supplied circle-you can use select by attribute to separate those circles(>= your sample circle ...


0

The following requires a Spatial Analyst license. The ArcPy Raster Object provides a pretty intuitive interface to working with rasters. Once a Raster Object is created, you're allowed to perform math operations on it in a very similar manner to operations on python built-in objects. Properties and methods onboard the Raster Object should also be useful for ...


0

It would help if you provided details on OS, R and package versions. You can use sessionInfo() to collect this information. I recall a similar issue associated with 16bit JPEG's coming up years ago, but I believe that it has been fixed. Check the validity of your raster with rgdal directly. Using the "GDALinfo" function you can do this without reading the ...


0

Try the following approach: require(raster) # Create raster layer r = raster("C:/path/to/your/image.tif") # Inspect raster layer class(r) > class(r) [1] "RasterLayer" attr(,"package") [1] "raster"


2

Here’s my solution. I gave up with ArcGIS and QGIS, instead opting to output the data to file and perform the calculation in R. # Load library library(raster) # Load chlorophyll data chloro <- raster("../data/chloro.tif") # Load polygons poly <- shapefile("../data/poly.shp") # Extract data in polygons poly.chloro <- extract(chloro, poly) # ...


1

I would avoid using ArcGIS (arcpy) in this case and do this using a pure Python solution. This will be faster and much cleaner. Since you are renaming tif files you do not need to use ListRasters() or arcpy.Rename()...see this example: import os import glob def rename_files(new_names_file, file_folder): files_list = glob.glob(os.path.join(file_folder, ...


3

I would do this the other way around from current comments/answer. I am assuming your scenario changes are where the flood values, not the buildings, change. Convert your buildings to raster with Polygon to Raster, using your flood raster as the extents and matching cell size/row column count/etc. There is some risk that a resulting cell won't be classed as ...


3

This is probably a bit of a roundabout way of performing this analysis, but I just did a quick test and it worked for me: Use the Raster to Polygon tool convert your raster, with the simplify polygons option unchecked. This should provide a polygon representation of the raster cells with the 'gridcode' attribute being the value of the raster cells. ...


1

Spatial Analyst is necessary for most raster tasks in ArcGIS beyond simple display and clipping. If you have that... You can use Extract by Attributes to create new rasters of just one value. It would be the value from the original raster though, and you'd have to Reclassify it to 1 or 0. You can use Reclassify directly to generate a new raster and map the ...


3

You can do this sort of renaming by utilizing enumerate. The general idea is to add an index with each raster name and then call that index to reference the specific item in the text file list. import arcpy arcpy.env.workspace = r'C:\path\to\input\rasters' txtfile = r'C:\path\to\textfile.txt' # Generate a list of items from text file with open(txtfile, ...


1

There are a couple of ways of tackling this problem. The first is to try and find a tool to do the job. The second is to use a bit of Python scripting to do it manually. Since finding tools seems to be hard, here's a python solution. You'll need to figure out how to install python/gdal/numpy yourself, but once you do you won't be disappointed. It's ...


1

Try using Raster to Float (Conversion). Two outputs are created: an IEEE floating-point format 32-bit signed binary file with a .flt extension and an ASCII header file with a .hdr extension. Both will use the same output floating-point raster file name.


0

Since extract by mask creates an entirely new raster, I wouldn't necessarily expect it to preserve any attribute table associated with the original. The actual values of the new raster should be present and match the original. If using this tool (or similar tools which generate a new raster) you may need to use the Build Raster Attribute Table tool and then ...


0

Could you calculate quintiles for the raster within each polygon and use these values to create contour lines where the lower quintile represents the 80/20 boundary?


0

I would convert the polygon layer into a raster data set with feature to raster tool and then do a raster overlay analysis using raster calculator. Make sure you are using the same projection and coordinate systems for both or your results will be wrong. Good luck!


2

Edit based on the comments below: Assigning the gdal_array.SaveArray(a, "test.tif") call to a variable returns an osgeo.gdal.Dataset object that can be managed as a per the below gotchas. Using the above example this should work: a = np.arange(300).reshape((3, 10, 10)) ds = gdal_array.SaveArray(a, "test.tif") ds = None ...


1

I had an issue similar to the above, and also similar to this: http://osgeo-org.1560.x6.nabble.com/Print-Composer-Rotation-of-Shapefiles-with-transparency-td5100394.html I finally fixed it in the style box of the Layer Properties - I set the transparency in the top Layer Rendering box to 0, and instead changed the layer transparency in the symbol colour ...


3

You need to use the Combine tool. Unlike simply adding together the rasters to get a total, this tool will create a new raster with values based on the unique combination of the other rasters. So the value created where frog and bird overlap will be different than that where frog and fox overlap, which is different yet again from where bird and fox overlap. ...


4

You can use Zonal Statistics as Table (Spatial Analyst) for this type of operation. The tool accepts both vector and raster data as input. You can join the results to your input feature class if you wish.


0

An accurate and relatively automatic way to perform this (commonly needed operation) is to Preprocess the image into a single-band raster. The purpose is to identify clear boundaries to the islands, which in a multi-band image may just taper off into a set of colors (such as the grays in the example). The could be done by separating the image into bands, ...


0

Try to use Spatial Analyst Tool > Extraction > Extract by Mask. Extracts the cells of a raster that correspond to the areas defined by a mask. In your case, input raster would be Raster2 and feature mask data would be Raster1.


1

Here's my solution. I used the Raster Calculator to determine where my raster is greater than X, outputting a layer that is 1 (greater than X) or 0 (less than or equal to X). I then used the Zonal Statistics plugin to calculate the mean value of this new layer within each polygon. This gives the proportion of the polygon where the raster is greater than X. ...


1

N1 and A1 are already raster objects. Therefore you do not need arcpy.Raster(), which creates a raster object from a name. addRas= A1 addRas = addRas+A1


2

For raster processing, "clip" usually refers to the extraction of rectangular subset. So you are looking for "mask" which extract a region of interest. This post will show you a simple way to mask a raster in QGIS (using raster calculator), but most of the time I prefer masking "on the fly" with the mask plugin. In any case, you'll need a layer with the ...


1

You can access raster statistics using the Python GDAL/OGR API. from osgeo import gdal # open raster and choose band to find min, max raster = r'C:\path\to\your\geotiff.tif' gtif = gdal.Open(raster) srcband = gtif.GetRasterBand(1) # Get raster statistics stats = srcband.GetStatistics(True, True) # Print the min, max, mean, stdev based on stats index ...


1

I don't know if you solved this? There may be a more streamlined way but this works fine for me in the latest QGIS (v2.8.1): Create a new polygon with an attribute column for height/level. draw a polygon shape with a larger extent than the raster extent you want to change. rasterise this polygon using raster > conversion > rasterise tool. using GDAL ...


2

the Y value is the values "if false" (and X is the value "if true"). You can enter a constant values (e.g. could be 0 in your case), a layer (could be your weighted overlay raster). Also, testing equality in the raster calculator is done by using "==" ("=" will not work)


1

yes, perfect! it works. Do not know why it (CellStat) did not work in ModelBulder and this is the reason I asked. Also, I found that way, a little bit around/longer. import arcpy arcpy.CheckOutExtension("Spatial") # Define input workspace and create list of rasters arcpy.env.workspace = r'X:\path\to\rasters' rasters = arcpy.ListRasters() i = 0 #loop ...


2

Cell Statistics (Spatial Analyst) was designed for this type of operation. This is how you would implement cell statistics with Python: import arcpy arcpy.CheckOutExtension("Spatial") # Define input workspace and create list of rasters arcpy.env.workspace = r'C:\path\to\your\rasters' rasters = arcpy.ListRasters() # Run cell statistics calc = ...


1

Tom Hengl told me this: Set the 'check.module.exists = FALSE' and 'warn=FALSE' -> this usually does the trick (http://www.rdocumentation.org/packages/RSAGA/functions/rsaga.geoprocessor). And Alexander Brenning told me that: did you notice the warning message, Warning message: In rsaga.geoprocessor(lib, module, param = list(h = ""), env = env, : This ...


0

A straight 'clip' using gdalwarp should work (I know this is a hella-old question: 18 months IRL is like a geological epoch in internet years). I have a 70Gb aerial (ECW, 94000x81000 pixel at 10cm/px), and GDAL can arbitrarily clip it with a shapefile using gdalwarp -cutline [clipfile] -crop_to_cutline [infile] [outfile] at the Windows command-line. (I ...


1

Thanks mr.adam! For future reference, here's a summary of what I did. The main tutorial I used was the one given by mr.adam above. After successfully following the tutorial I managed to get a correct folder structure which I could then upload/ host. I also tried MapTiler which you can also use to make the tiles. I personally found it to be very helpful as ...


1

The CALS format is apparently a DoD 1bit raster. I did a quick search and don't see any support for it in ArcGIS, GDAL, or even FME. It seems your best bet would to be locate a specialized converter tool and batch them into PNG, TIF, or something else most GIS can handle. Map3D might have a method of doing so. Below are a few options (random Google results), ...


1

Since you are analyzing a binary landscape matrix for connectivity, there is a very robust model available. I would direct you to the Guidos toolbox software, which is an implementation of the "Morphological Spatial Pattern Analysis model" (Vogt et al., 2007). This model uses mathematical morphology to decompose a series of scales to assess core habitat and ...



Top 50 recent answers are included