New answers tagged

1

I think you are wrong with the naming convention of the arcgis featueclass, for details of naming convention get details at here. According to these rules your featureclass name can not be started with numbers. %n% means the loop number in the arcgis model builder. So your intended name must be like string+(number)+%n% e.g. Test_%n%


0

Here is a function that does just that. Some comments will follow the code. sampleClasses <- function(r = raster, n = 8) { # function gets a raster object and a sample size. It samples n cells from each class # in the raster and return a vector with the cells indices vals <- unique(getValues(r)) # Get all classes for (val in vals) { cellVal <-...


0

Maybe this is just a problem with your GDAL installation. You may need to do some more checks: 1) Are you able to use GDAL from the command line ? Does the following work ? gdalinfo --version 2) Does your gdal installation include the proper georaster plugin ? Does it appear in the following list ? gdalindo --formats 3) Can you check a raster stored ...


1

Yes, you are right - the layers list currently only shows the name of raster layers. Symbology and values could be added in the future, but they're not there now. To achieve what you want manually, export and then edit the exported file. You'll have to use Leaflet format, as the OL3 layer switcher doesn't support symbology. Open index.html in a text editor ...


0

Just for the record, the reply below; gradouxju was somehow right in his assumption that I should go ahead and start to combine these raster files. There was no need to 'break up' any of the cells as I mistook the single entry in the raster attribute table as a sign that I don't have individual 1000x1000 m tiles but a 'polygon-like' large raster tile. It ...


0

I think you are describing features of Web Coverage Service (WCS) so maybe see if this data is being served that way too. Using WCS with ArcMap is described at Adding a WCS service to ArcMap - it's just like adding a WMS but gives access to grid cells themselves rather than just a rendered picture of them.


0

gdal_translate has a specific -b switch, that allows the selection of input bands. -b band: Select an input band band for output. Bands are numbered from 1. Multiple -b switches may be used to select a set of input bands to write to the output file, or to reorder bands. Starting with GDAL 1.8.0, band can also be set to "mask,1" (or just "mask") to ...


0

Set one image to the values you want, copy the full file name of said raster, insert full file name into script below, and drop this script in Python box. Hit enter+enter and sit back and relax. mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "")[0] refLayer = arcpy.mapping.ListLayers(mxd, "ReplaceWithNameofRaster.tif", ...


3

Your clipping fails because the raster has the odd nodata value of -3.4E+38. Unfortunately, you can not enter that value in the input form. So I suggest to use gdalwarp to change the nodata value and clip as well, but to the extent of the polygon layer: gdalwarp -overwrite -s_srs EPSG:32634 -dstnodata -10 -q -cutline forest_2013_extent.shp -...


0

I've tried out a bit and found that: RasterBricks, as mentioned by RobertH's answer, do work and are more user-friendly and easy to use; Rgdal methods like readGDAL also work, but with more parameters it's a little bit less user-friendly; So which option should one use? According to my tests (on my 420GB GeoTiff with dimensions of 18660x21592 and 374 ...


0

If I understand your question, you want the same result you get from PointToRaster, but you'd prefer to have zeroes in all the NoData cells? Simply follow PointToRaster with Spatial Analyst > Reclassify, converting the NoDatas to zero and the data values to whatever makes sense for your project. Then set the symbology to get the visual contrast you are ...


1

Because a raster is continuous and points are discrete, you will need to use an interpolation method to create the kind of raster you would like. There are several different interpolation methods that may be better or worse for a specific application - but, here is a pretty brief overview of interpolation: http://pro.arcgis.com/en/pro-app/tool-reference/3d-...


1

If I get you correctly, You need to use the below steps- Use point to raster, it will give you a raster of points but blank where no points(i.e. NoData area rendered with nocolor)- maintain same pixel size with layer 2 e.g. 5*5 To get the background, convert polygon of UK into raster after setting the value for this layer 0- maintain same pixel size with ...


0

In R, this can easily be done using the mapview package. For instance, displaying Landsat 8 band 5 with a customized color scheme and breaks works as follows: library(mapview) ## custom color palette cols <- colorRampPalette(c("green", "blue")) ## visualize data m <- mapview(poppendorf[[5]], col.regions = cols(100), at = seq(5750, ...


1

0 (and 360) represents North, as long as a pixel "above" another pixel is indeed north of it --- that is almost always the case. However, if you have a rotated data set (a rare thing) such that N is not up, you would have to apply that rotation to the output to get the true direction. This is not stated in the documentation because it seemed obvious, but ...


0

As you have a single file, you should create a RasterBrick. That should make things faster as it could indeed benefit from the by pixel interleave. By creating a RasterStack you create a list of RasterLayers, i.e. you treat each "band" as a separate file.


0

From your original post it sounds like you may have already found info on how to publish tile layers online, but here's a link to the step-by-step process I used when I've done this in the past (I followed the "Define and publish a map in ArcMap" instructions): http://doc.arcgis.com/en/arcgis-online/share-maps/publish-tiles.htm If your ESRI license is ...


0

Since /vsis3/ is implemented in GDAL you can also use rasterio to read Windows of S3 datasets. This requires either your credentials to be set up for boto or using rasterios AWS session handler. import rasterio with rasterio.open('s3://landsat-pds/L8/139/045/LC81390452014295LGN00/LC81390452014295LGN00_B1.TIF') as ds: window = ds.read(window=((0, 100), (...


2

I've found when something isn't particularly well documented in GDAL, that looking through their tests can be useful. The /vsis3 test module has some simple examples, though it doesn't have any examples of actually reading chunks. I've cobbled together the code below based on the test module, but I'm unable to test as GDAL /vsis3 requires credentials ...


0

To reduce credit usage first build tile packages in ArcMap or Pro. Then you will upload the tpks to AGOL which will create a hosted tile service of your raster data. Then you can have control to share the layer to your organization and not to everyone. This will keep the content inside your organization and will not be accessible to users outside your org.


1

The general approach would be: Rasterize the point "west Myara site" Generate the buffer (there are plenty of tools for buffering raster, look for "raster distance" or "proximity". QGIS has this algorithm) Use raster calculator using the formula, f stands for frequency of the wave (a constant value) and d will be buffer layer you calculated previously.


0

Never done it before, but I think that the GRASS algorithm r.resamp.stats should be able to do what you're looking for. You can run the algorithm through QGIS's processing toolbox. The documentation for r.resamp.stats is here: https://grass.osgeo.org/grass64/manuals/r.resamp.stats.html


1

Try using an XML file to store the WMS info in, more details are at the GDAL WMS documentation. Here's an example WMS XML file to retrieve data from Mapzen's Elevation API: <GDAL_WMS> <Service name="TMS"> <ServerUrl>https://s3.amazonaws.com/elevation-tiles-prod/geotiff/${z}/${x}/${y}.tif</ServerUrl> </Service> <...


0

I don't know much about S3 buckets but it seems that it's a cloud storage drive with authentication using http REST services. i.e. could be used as an ordinary mounting point, with an associated uri. If you are looking for cropping parts of images/raster then the file needs to be in an appropriated format. Take a look at the TMS specification http://...


1

I believe My Maps from google will let you share a map so people can add places. Since lots of people know how to use google maps, the interface will be familiar


2

There is a tool in the 3D analyst toolbox called Interpolate Shape that will do this: According to ESRI, the tool description is: The Interpolate Shape tool converts a 2D point, polyline, or polygon feature class into a 3D feature class by interpolating z-values for input features from a surface. The input surface can either be a raster, triangulated ...


1

The error above is due to calculations being attempted in a computational region that extends outside of the input rasters. So before doing the r.statistics: g.region -p rast=stands FAQ #0 in almost all GRASS raster processes: Pay attention to region settings. GRASS and computational region need to go together like peanut butter and jelly :-) Here are ...


0

Thank you for your answers. I checked with r.stat the count of Null cells. Everything was fine. So I did all the process again. I downloaded my shapefile again, I rasterised it once again and I did r.grow.distance once again. And it worked. Yet, I didn't change anything but it worked. One more thing, I realised the rasterisation from QGis for a r.grow....


3

You can do it like this: # I'm assuming cat is the full path to a raster # or a raster object TempDir = os.environ.get("TEMP") # Your temp folder ColFile = os.path.join(TempDir,"TEMP_CLR_FILE.clr") with open(ColFile,'w') as ColWrite: ColWrite.write("1 255 0 0\n") # 1 = red ColWrite.write("2 0 0 255\n") # 2 = blue arcpy.AddColormap_management(cat,...


1

Transform the point to the coordinate system of the raster. Make the point into a SpatialPointsDataFrame in the lat-long coordinate system: > e <- data.frame(x=148.1, y=-35.6, id=1) > coordinates(e)=~x+y > projection(e)=CRS("+init=epsg:4326") then transform to the coordinates of the raster: > et = spTransform(e,projection(r)) > plot(r)...


0

I know it is a little late to answer but I had a similar problem and wanted to convert my Raster tab file to a esri world file (tiff + tfw). I could not use command files as it is blocked from my IS department.I tried to convert from FME but it could not read my tab file (which had a Pt4 line missing).So I worked it out myself = See step by step guide on ...


0

Maybe the following example is useful. It is in an unprojected Location, i.e.: g.proj -p XY location (unprojected) # some arbitrary region g.region rows=30 cols=30 -p # generate random vector points v.random output=random_points npoints=50 # rasterise the points v.to.rast in=random_points out=random_points use=cat d.rast random_points Note, it is ...


0

MapInfo Pro doesn't allow you to "browse" the data behind a raster grid. If you want to work with raster grids in MapInfo Pro, I would recommend that you take a look at MapInfo Pro Advanced which can be considered the 64-bit replacement for the "classic" 32-bit Vertical Mapper. But maybe this tool can help you out for now: Grid Analyser It's not exactly ...


1

Yes, all of the datasets you want to mosaic should be in the same spatial reference system, same cell sizes, and share the same vertical datums and units of measure to avoid introducing errors into the output.


1

The alternative to doing this in the raster calculator is to use the Cell Statistics tool in ArcToolbox. You can select all of your rasters at once and then pick which ever summary statistic you are interested in. It saves a lot of typing!


0

In Raster Calculator: ( "raster_1"+"raster_2"+...+"raster_n" )/n Where n is the number of rasters.


0

I found a solution using the mutate function in dplyr package. Make sure you have a data frame with a column defining the months e.g m1, m2 etc df_Seasons <- df %>% mutate(season = ifelse(month %in% c(m1, m2, m3), "Season 1", ifelse(month %in% c(m4, m5, m6), "Season 2", ifelse(month %in% c(m7, m8, m9), "Season 3", "Error"))))


1

I've built an R package called dggridR which wraps around the DGGRID software that Craig suggests in their answer, making it easy to compile and work with. It may be useful to you in exploring different grid possibilities. An example of choosing random cells and plotting them is available here.


5

You can select the feature of interest (e.g. roads) and run Zonal Statistics (Spatial Analyst) with a "SUM" statistic. This will produce your desired raster output. Repeat for any other features of interest.


1

This problem is inherently an NxN comparison and a Mantel or Partial Mantel are quite inappropriate here. A Mantel is a pairwise matrix correlation and is entirely dependent on distance (ie., ecological, geographic). I have a function "mwCorr" in the spatialEco package that implements a moving window version of the Dutileul modified t-test, accounting for ...


2

You might want to ask a more general question of the stats of this on Cross Validated. If you look for significant differences between multiple pairs you need to correct for family wise error, to avoid this problem: https://www.xkcd.com/882/. Basically, at a 5% significance you should expect a false positive every twenty times. For the specifics of your ...


1

I just used this and it solved the problem. From http://www.inside-r.org/packages/cran/raster/docs/shift: r <- raster() r <- shift(r, x=1, y=-1)


0

I'm not 100% sure, but I think you may have to set the coordinate system of the canvas as well. There is a post here that indicates this: http://gis.stackexchange.com/a/151867 For example, the answer there shows code like the following: mycrs = QgsCoordinateReferenceSystem(32611) iface.mapCanvas().mapRenderer().setDestinationCrs(mycrs) I would suggest ...


2

Union the Polygon feature class Add Centroid xy to the attribute table (steps below) Summary Statistics - get the Max value at each Centroid for the Statistics field select Value and max for the Case field select xy Join the Summary Table to the Unioned FC on xy Dissolve the Union FC on Max value Addxy steps: add field x_coord Double add field y_coord ...


1

Set the values via the index, once you tabulated it: r <- raster(ncol=5,nrow=5) r[] <- 0 vec <- c(1,1,1,3,4,5,6,7,8,8,8,9) tab <- tabulate(vec, ncell(r)) r[vec] <- tab[vec] That's wasteful for large rasters, but we need more details about how this needs to be done if that's a problem. This is also a great example of how painful some ...


1

Great question you've written here. There are two problems with your code. The first and most crucial is shown below: states.spdf$frac.pop = states.spdf$total.pop / (states.spdf$ALAND10+states.spdf$AWATER10)*raster.res You are assuming that population is equally distributed in space, however you treat density wrong. Instead of using raster.res to ...


0

My experience is that Mac is not working properly when combining vector with raster data. Raster calculations is not a problem but vector and raster is an issue. Sometimes it simply takes a lot of time and calculations are done. In other cases it does not work.


0

please provide a reproducible example. Perhaps this is because there are values in between 2 and 3 and 3 and 4? To sum the layers you should do sum(reclass) library(raster) s <- stack(system.file("external/rlogo.grd", package="raster")) s <- stack(s, s, s) ss <- reclassify(s, matrix(c(-Inf, 254, 0, 254, 255, 1), ncol=3, byrow=TRUE)) sum(ss) # ...


3

This would not be fire frequency because, if it is point data, it would either be an ignition event or an area (polygon) generalized into a point location. Thus it would aptly be ignition frequency or a misrepresentation of a fire process. Inherently, fires occur across space and as such are associated with area and not discrete point location(s). Sorry ...


0

If you are simply looking to assign the raster value based on the number of points in a cell, the tool you'll use is 'Point to raster' in Conversion Tools->To Raster. For the 'Cell assignment type' you will select Count. If you points hold counts or some sort of other attribute you need to sum, then select the appropriate operator from the menu and the ...



Top 50 recent answers are included