Tag Info

New answers tagged

1

You can set the GDAL_MERGE process up with QGIS using the GUI and that might be a good way to start testing. Also, test on two tiles that are next to each other first. I reckon it's something to do with NODATA. Please post your command in your question so that we can see how you're achieving the merge.


0

what do you mean exactly of 'segmented'?. if you want to classify image in ERDAS, you can go directly to menu Classification. You can choose whether Supervised Classification or Unsupervised Classification. If you have training sample or ground checking area, that would better to guide you to precise result of classification.


0

Assuming it's in ArcGIS from your other posts... Repeat the following process three times, once for each of the values 1, 2 and 3. For example the 3's: Import the different bands to ArcMap separately. Repeat ten times**, once for each year: Create a raster where all values of 3 are replaced by 1, the rest are replaced by 0. In order to achieve this, Open ...


-1

SAGA GIS allows you to edit pixel values in a raster, one at a time. This is very useful for some purposes, e.g. remote sensing where you might what to select a specific pixel for spectral analysis. If you select the grid that you want to edit in the 'manager' panel, select the 'attributes' tab in the properties panel, and you can select a single pixel, or ...


0

The code in my above question does work for some queries, but is unreliable. I have ended up settling with for now this query which takes in elmo's process but without creating any new tables. I am not sold on it as it requires more work than I would like - an extra half a second to return. SELECT ST_AsGDALRaster(rast,'GTiff') FROM ( SELECT ...


2

You need to reproject your polygon to your raster projection, then you can clip the raster. This is how you can perform it : R = raster u_R = union of raster P = Polygon 1-Select tiles which intersects with your polygon Create table tiles_R as SELECT * from R where ST_Intersects(u_R.raster,st_transform(P.geom,st_srid(tiles_R.raster))) 2-Perform the ...


2

Three other possibilities: Project/Save as image, you'll get a georeferenced image of canvas (limited/screen resolution) In Print composer Composer/Export as image, you will get az image of the set page size, no georeference From the command line use --snapshot switch, huge image can be created with georeference (qgis exit after creating the image, can be ...


1

You can use this R script You will need these packages: library(rgdal) library (raster) For example for a map called "Prodes1": Prodes1<-readOGR(dsn="E:/PRODES/PDigital2014_22768_shp", layer="PDigital2014_22768__pol", dropNULLGeometries=TRUE) Prodes1$Grd_ranks<-rank(Prodes1$mainclass) #Creating a numeric column for rasterize i<-1 ...


0

Landsat 8 data is available for anyone to use via Amazon S3. You should try it. https://aws.amazon.com/public-data-sets/landsat/


0

You need to reclassify the raster. To query by the original Grid value you can either use conditional statements in Raster Calculator or ArcPy or just look up the value in the CSV, of course. In ArcMap you need Spatial Analyst Extension for this. If you do not have it and cannot afford it then you can try QGIS. If your reclassification is simple then ...


1

I had the same problem with a similar file and found that it was due to complex polygons and polygons that only contained NA values. In particular there were one or two countries in my case that were causing it to crash - you can see these by looking at where the zonal statistics data ended before it stopped. To fix this I: Deleted all polygons from the ...


0

As of version 1.8, GeoDjango does support raster data handled by GDAL. https://docs.djangoproject.com/en/1.8/ref/contrib/gis/gdal/


0

A simple method is: mean pixel value * total number of pixels The source tab in layer properties has all the information you need for this calculation.


0

Have you tried cutting out ArcPy by converting it to an array and then using numpy's minimum function?


1

so, as whuber gave me the nice quick piece of code to create a raster with the values that are the same between rasters, i thought i'd finish the entire job; create rasters and subtract one from the other to get a 'change' raster (full of 0s that need examining as well); r <- raster(ncol=10,nrow=10) r[] <- sample(c(1,2,4,8),size=100,replace=T) ...


1

Just worked out how to do this with gdal_calc.py - to get around issues with files with different dimensions (and resolutions) you can use a VRT. gdalbuildvrt -separate combined.vrt dem1.tif dem2.tif gdal_calc.py -A combined.vrt -A_band=1 -B combined.vrt -B_band=2 --calc="A-B" --outfile diff.tif


0

Probably a little late, but my solution to this problem was saving the result in a different folder than the inputs. A temporary file is created in the work folder with a default name, which is erased after the process is finished, but it generates problems when the output is created.


5

What you want is a conditional calculation: return the value of r whenever r and r1 are equal and otherwise set the output to NA. The cell-by-cell arithmetic operations seem to be fastest. (They are much faster than, say, using mask or the reclassification functions.) Since they do not appear to offer an actual conditional operator, use two time-honored ...


2

In the Metadata Layer Properties of your raster base, copy the equivalent of this information: Layer Extent (layer original source projection) 354971.3488602247089148,4414903.3223166307434440 : 479272.4038835020037368,4473428.4023900907486677 and put in this format: -te 354971.3488602247089148 4414903.3223166307434440 479272.4038835020037368 ...


0

I have a similar challenge, but the approach above using gdal_translate (througgh the gdal plugin in QGIS) does not work for my dataset. I work with a 3 band photo, angled and made into square GTiff's by using value of 65535 as NoData value. I've tried using gdal translate to make it into a single band image with nodata, and succeeded, but ImageBoundary ...


1

Try r.out.gdal. First, at the layer properties, you can see the raster data type of the original raster. Afterward, at the Modules List of next image, you have the parameters used by me for exporting the raster as *.tif. At the next image you can see that the process was successfully finished. The resulting raster (it was as I expected; without the ...


1

Just in case anyone has come here for a problem like this one here are a few notes: • epsg: 3577 (as Steven Kay used) is the correct spatial reference in this case (Australia) because it preserves area. Spatial references that don’t exactly preserve area (like epsg:4283) will return a slightly wrong area. Everything will need to be re-projected to the ...


1

Viewsheds have been mentioned. These will show which grid cells are visible from a given point. They don't tell you the distance, however. If it's the distance you're after, SAGA GIS has the ability to do this. The tool is under Terrain Analysis > Lighting > Visibility You can either specify one or more observer coordinates from a shape layer, or use ...


1

The better way to do this is to set a '1' for 'no cloud' and '0' or 'nan' for cloud. Then you can just multiply them together and all the 1's make 1 and a single 0 sets it all to 0. @user55937 has the solution, though I think it can do conditionals. Try something like: not(("Raster1@1" = 255) OR ("Raster2@1" = 255)) which should return 1 if they are all ...


2

I don't see how you could do that without conditionals, and Conditional Statements in QGIS raster calculator? suggests (and I think too) that the default QGIS raster calculator doesn't support conditionals. But that link provides a link to RaserCalc, which is another calculator plugin that does support conditionals. Alternatively, if you're ok with using ...


5

If you have the opportunity to get LAS or LAZ instead of TXT ... absolutely go for it. It will be trivial for you to go from LAS or LAZ to TXT (for example with the free and open source las2txt tool from LAStools). Ordering TXT instead of LAS means to loose many important attributes that you may not care about today but will in a few months or years. It also ...


2

Point cloud files are of type non-binary or binary. Non-binary files (also known as ASCII files) are the ones with extensions '.xyz' and '.txt'. They have the advantage of being easily opened with text editors to visualize what is in there (but it is not a big advantage). Each line of the ascii file represent a laser return record with spatial coordinates ...


3

As the other replies say the statistics are likely out of date. If you prefer using ArcGIS try the Calculate Statistics tool in the Data Management toolbox. This should update the statistics for you.


0

@geowurster's request on stack trace made me do one more debugging round. The raster's dimensions were 5033x5665 pixels, and I found that it crashes while writing the tile including pixels (0-63)x(4992-5055). I assigned the dimensions to the new raster in the wrong order, so it tried to write outside the raster. I switched the shape indexes and it works: ...


9

ArcGis has a new LiDAR dataset at 10.1 which will allow you to view your LiDAR data directly and also see more information than what's in a raster... for example you can add to ArcMap and then filter down the display to just tree classes, or just first returns! LiDAR data contains much more than just elevation, there's intensity that is stored by default ...


3

Set the Output Extent environment setting with arcpy.env.extent, then make a copy of the raster import arcpy from arcpy.sa import * arcpy.CheckOutExtension('Spatial') arcpy.env.extent = arcpy.Extent(0,0,10,10) arcpy.env.cellSize = 1 #Dummy raster just for demonstration a = CreateConstantRaster(1) print a.extent.XMin 0.0 #Widen Extent arcpy.env.extent = ...


1

Use ceiling. Here is an example in which a raster with values in the interval [1,180] is generated randomly and reclassified. The code then produces a scatterplot of the original and reclassified values to show it has worked correctly. To make it clear that the endpoints of each class are being treated properly (because this is where bugs can arise), the ...


1

I imported my raster file to PostGIS and I used this function to make vectorization of my raster. I used this query SELECT (ST_DumpAsPolygons(rast)).geom,(ST_DumpAsPolygons(rast)).val from my_raster


0

I was not able to dublicate your example. Using the same projection settings the dialoog completes with no errors. What option did you choose at the previous step? are you making a rational model or a polynomial? I would choose projection D000 (WGS84 meters, in PCI) and not E012 which is rather the datum than the projection.


0

This is very simple with the reclassify function from the rasterpackage which takes a 3 column matrix with the values (from, to, becomes) or a vector that can be converted to such with byrow=True. In your case: rcl_vec <- c(0,10,1, 11,20,2, ...) rcl_mat <- matrix(rcl_vec, ncol=3, byrow=True) reclassified_raster <- ...


0

GRASS-GIS-tool r.to.vect will do it. Select point as output. You have to install GRASS-GIS for that.


6

As whuber mentioned, often statistics found in the raster properties are sometimes approximate or are out-of-date. They are predetermined properties that can be misleading to the actual raster values. Calculated your own min / max values from 100% of the actual data using NumPy arrays. See Working with NumPy in ArcGIS, and RasterToNumPyArray (arcpy). E.g.: ...


0

I'm not sure I'm understanding the question properly but I believe you simply want to write a multispectral raster to disk. If, for example, you want a multilayer geotiff you just have to run the following line of code: writeRaster(yourStackObject, filename="multilayer.tif", options="INTERLEAVE=BAND", overwrite=TRUE) In filename you can include whichever ...


5

Step 1 Make bit rasters for each of the unique classes. This can be a 1-band rasters for each class, or a single raster with a band for each class (e.g. GeoTIFF). If using GTiff, you can use the creation option NBITS=1 to conserve space. You may also want to consider twobit rasters to store three-valued logic where the third (e.g. 2) is NODATA, which would ...


1

This question is similar to: Clip raster by raster with data extraction and resolution change, but coming from a different angle. However, I think the answer is likely the same. First off, choose which raster you wish to be definitive. I'll repeat my previous answer here for ease: Load required libraries: library(raster) library(rgdal) Read rasters: r1 ...


12

If your image comes without pre-computed statistics QGIS and ArcGIS will produce a quick estimate of what the ideal min/max for displaying the image is. This does not change the values you are seeing, just the color range. You can easily test this by comparing the pixel values. If you want to see the computed band statistics you can right click on the layer ...


5

Reading Rasters by block can be done in rasterio and I'd argue it's easier than in GDAL. There is even a tutorial on windowed read/write over at GitHub. Let's take a look at the read functions arguments, which allows you to set a window to read data from: def read(self, indexes=None, out=None, window=None, masked=False, boundless=False): """Read ...


1

I wasn't able to locate an API method in QGIS to do it, but there is a GDAL function: GDALRasterizeGeometries (there are a couple of variants.) This method is used internally by gdal_rasterize.


0

Original dataset showing flood depth and polygon I've created along it: Let's produce points on the boundary of flood plain using flood level raster called RL, raster calculator plus some tools: Next - assign proximity areas to above points and convert those areas into corresponding flood level: Final step using raster calculator to define flood ...


0

the pixels that fall within the polygon, and get the sum of the pixel value CREATE TABLE gtur_srtm_inter AS SELECT id, (gv).geom AS the_geom, (gv).val FROM (SELECT id, ST_Intersection(rast, the_geom) AS gv FROM srtm_tiled, gtru_poly_vect WHERE ST_Intersects(rast, the_geom) ) foo; The values ...


2

According to the docs thinning is for line features. Remember to select "area" as the feature type in r.to.vect.


0

How about testing St_MapAlgebraExp SELECT ST_MapAlgebraExp(t1.rast,t2.rast ,'([rast1]+0.001)/([rast2]+0.001)') AS rast FROM img1 t1, img2 t2


1

I don't know any way of doing this without writing custom code.. this is a use case I've come across in the past, but there doesn't seem to be an easy way to do it. I'd be delighted if someone points out an easier/quicker solution! There are several good stats based plugins, but they're for vector layers. Zonal Statistics is good for finding summary stats ...


0

Yes. You need to resample your rasters in order for them to be the same size and have the same extent. R doesn't deal with that by itself. Given that neither of your rasters fully contain the other, you should consider creating a minimum-extent raster with your preferred resolution, and then resample and crop the others to match that.



Top 50 recent answers are included