Tag Info

New answers tagged

0

Actually the problem was that the raster that I was looking at was loaded from a GRASS database and did not offer pixel size in it's metadata. I then saved the raster onto disk, loaded it, and it did show pixel size.


0

As a remark, topological problem are better solved with vector, but in this case there is a raster-based solution. use "expand" of one pixel to create a buffer around all your lines. Then you can do your region group and remove small parts (e.g. reclassify with threshold = 20, remember you have "buffers") for isolated groups. Finally, assuming that rivers ...


0

To clarify, say, there is a raster and with random values 1-10. I want to input this raster and return a new raster that is all no data except for where the original raster = 5 I use numpy.where for that. Something like: numpy.where ( [condition], [if TRUE do this], [if FALSE do this] ) outarray = numpy.where((outarray==5),5 , 9999) ...


2

The plugin layer has no functionality to export to an image file. Instead, you can save map canvas image (File - Save as Image. A world file is outputted together), and then convert the image to GeoTIFF with the Translate (Convert format) tool of GDALTools. In the tool dialog, the target SRS field should be filled with the CRS of your map (EPSG:27039).


2

You just right click the layer and select Properties. Then go the Metadata tab. Scroll down and look for "Pixel Size".


3

I would use either the Con or Reclassify tools to create a new raster with the value range that you are interested in and then perform the raster-to-vector conversion on this newly created raster. Two steps and you're done!


2

There are a number of sources with examples showing what syntax can be used for rasters. Basically, common mathematical logics are used such as: Mathematical (+, -, *, /) Trigonometric (sin, cos, tan, asin, acos, atan) Comparison (<, >, =, <=, >=) Logical (AND, OR) Here you can find how some of those syntax are used in some examples. Other sources ...


0

For the task, it is of course important that you have a sampling of profiles that is dense enough to ensure that the result becomes precise enough. If you have a 1,6m DEM and profiles pr. 100 m. then your profiles may be more precise, but your overall uncertainty will be huge. If you have sufficient data in profiles, then you create points along your ...


0

Impossible to know from your description. But you can try things like the below to see what is going on: # get values of a few cells cells <- 100000:100010 x <- data.frame(w1[cells]) x predict(s2.rf, x, type='response') s2.predict[cells]


1

For those who want to do this in 10.2, this modification of above worked for me: # Import system modules import sys import string import os import arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create(10.2) # Load required toolboxes... gp.AddToolbox("C:/Program Files (x86)/arcgis/Desktop10.2/ArcToolbox/Toolboxes/Data Management ...


0

To revert line direction you can go with v.edit and the flip option.


2

ArcGIS solutions: Convert the x,y,z data to a feature class then: Build a TIN using x,y,z data and then convert this to a raster. Interpolate the x,y,z to raster. Use Anudem (topo2raster) to create a DEM. Convert point to raster and just set a cell size that is suitable for your x,y,z data (usually only for dense data). I would output a GeoTiff. x,y,z ...


0

Not elegant, but how about converting each raster into a set of points using Raster to Point? Then giving those points a z value using Feature To 3D By Attribute. Then find the closest fault point (near feature) to each bathymetry point (in feature) using Near 3D. There are two potential downsides (1) there is a limit in how many points can be generated ...


2

In ArcGIS, use the Resample tool to resample two of the three rasters into a cell size that matches the third on. You'll need to consider what you're doing to your data when you resample. With that in mind I would pick the Land Use raster as the one that goes unmodified since the others are likely already interpolations of discrete samples of continuous ...


2

If the rasters have the same basis (extent, resolution etc) then you just get the values and plot them. Something like: plot(values(r1), values(r2)) I'm not sure exactly what the "correlation of determination" is, but the simple "correlation" can be computed by: cor(values(r1), values(r2)) Note these are both dependent on the rasters having identical ...


1

I have a similar situation - point data stored in PostGIS database and I need display heatmap of this points in web. I write shell script (put in cron for automatically update raster if changes values in points) which make next: convert data from PostGIS table in local csv file (x,y,value) using gdal_grid command I receive TIFF raster from values of csv ...


2

The raster constraints are used to ensure that all rasters have the same SRID, pixel dimensions, pixel types and alignments, as you can see from RT_AddRasterConstraints docs. These are important if you want to do intersections, resampling, unions, reprojections, or vector-raster overlays, etc, as I'm sure you know. I was surprised that you could add an ...


3

In addition to @Ryan Garnett answer, you can convert the VRT file to BIGTIFF using gdal_translate if you absolutely need a unique file (this is often not necessary as most software can read vrt's). Just make sure that you use gdal_translate -co BIGTIFF=YES -co TILED=YES source.vrt result.tif if your tif exceed 4 Go


1

Basically you can treat each band as a separate raster and use it as input of the Composite Band tool. If you want to automate the process, there must be a structure in the name of the bands, like raster.tif\rainfall_year_month. If you have such a structure (at least with the year mentioned) you could use this code (not fully tested): arcpy.env.workspace = ...


1

Under Settings -> Options, CRS tab, enable Prompt for CRS for new layers. Then you will be asked explicitely for the CRS, which should be the same as you georeferenced to in Arcgis. You might get a datum shift of up to 100m, as this is not stored by Arcgis. But QGIS has bundled the shift with the common projection definitions.


3

If this is typical raster data (or can be converted into typical raster data), I can think of a couple of options: Use a map server (like MapServer, GeoServer) to host the raster data, and pull this into Leaflet via WMS Assuming you can symbolize this the way you want it to look in a GIS (e.g. QGIS), and export as an image, you could then use a tool such ...


1

If you want an arcpy solution: import numpy as np #not sure how arcpy imports numpy r = arcpy.RasterToNumPyArray('your raster name') for val in np.unique(r): area = np.sum(r == val) #multiply this by your pixel area print 'value ', val, ' : ', area alternatively you can write the values to a csv/text file.


2

ListRasters will list the rasters in your workspace. ListLayers will list the rasters in a map document. rasters = arcpy.mapping.ListLayers(MXD, "", DF) for raster in rasters: #do work Use the wildcard argument to limit your results.


2

EDIT : I assume that you have a correct list of rasters, you can check this using print(raster) you need to save your raster at each iteration in order to persist it. Note that it is not necessary to use the mxd. outMeasurement = "PERCENT_RISE" zFactor = 1 arcpy.env.workspace = in_workspace #note that it is recommended to avoid spaces in your ...


1

1) the current google maps terms and license agreement is not friendly towards openlayers version 3. google prefers if you access their map tiles through their own google maps api so expect to get blocked if you release a live site that uses openlayers. 2) it is possible...see this link for an example proof of concept ...


3

Joseph has provided a 'how to' for OpenWind. However, if you are like me, you may prefer to do the cartography in QGIS. In which case go to the Transparency tab of the raster layer properties. Set the transparency for the whole layer to about 50%. Then click the little green plus button on the RHS of the dialog box to add a new custom transparency option. ...


1

There doesn't seem to be a Google Maps example on the OL Examples page yet, but there is a Bing Maps one if you want to start with that: http://openlayers.org/en/master/examples/bing-maps.html The only difference is probably going to be changing the source section to be google specific. source: new ol.source.BingMaps({ key: ...


0

So assuming that the raster is correctly loaded in PostGIS you can get your raster via readGDAL in R in the following way: library(raster) library(rgdal) dsn="PG:dbname='plots' host=localhost user='test' password='test' port=5432 schema='gisdata' table='map' mode=2" ras <- readGDAL(dsn) # Get your file as SpatialGridDataFrame ras2 <- raster(ras,1) # ...


4

From the openWind Forum website, it is mentioned here: "...set the invalid value to -9999. What this does is make sure that areas outside of the raster are painted as transparent due to being interpreted as NoData values. This is in the Interpretation Tab of the layer properties." I cannot confirm if this will work as I am not experienced with using ...


0

You can do the rescaling using gdalwarp and Geotiff for temporary output: gdalwarp -overwrite -of GTiff -tr 0.000241 0.000241 D:\Download\NEU\asc.txt D:/Download/NEU/asc-square.tif and then convert to ASCII grid: gdal_translate -of AAIGrid D:/Download/NEU/asc-square.tif D:/Download/NEU/asc-square.asc Alternatively, you can use gdal_translate with ...


1

QGIS seems to default to the Golden Surfer version of AAIGrid is pixels are not square but puts out a "traditional" ASC header if they are square. Most systems will not support the dx/dy options (apart from Golden Surfer). You are also right that forcing the cell size sets the cellsize to be the X cell size and that could cause distortion. Alternatively, ...


1

You could create a GDALDataset with as many bands as you have raster bands, then copy the data from each of your bands into the corresponding band in the GDALDataset. Here's some example code in C++ (since that's where I'm most familiar with GDAL). //create the dataset const char *filename = "example.tif"; GDALDriver *pDriverTiff = ...


1

You might consider the Shuttle Radar Topography Mission (SRTM) 30 product, which is a coarse resolution near-global 30-arcsecond DEM. You can download the data at the following FTP site: http://dds.cr.usgs.gov/srtm/version2_1/SRTM30/ There is also the GTOPO30 elevation data set that is commonly used for these applications. EDIT The GTOPO30 dataset has ...


1

If you have the Spatial Analyst extension for ArcGIS, then you may consider this approach: Convert your buffered polygons to a raster layer using the Polygon to Raster tool. The result will be a Boolean image of 1's and 0's, with cells with value 1 being within the buffered area. Use the Combine tool to get the cell count for each class within the buffered ...


1

to accomplish what your code is doing, # reclassify raster values equal 16 to 7 using Numpy temp = numpy.equal(raster, 16) numpy.putmask(raster, temp, 7) another, perhaps more intuitive way is: # reclassify raster values equal 16 to 7 using Numpy temp = raster == 16 #gives you a numpy array of bools with same shape raster[temp] = 7 #or a short cut ...


0

So, georeferencing panel in ArcMap provides 2 options - update georeferencing and rectify. Update georeferencing creates jgwx, pnwx, tfwx extensions and this can't be opened in geoserver. Solution is to rectify all images, which creates pgw-like extensions. To define a world file's projection in geoserver you have to make exact copy of projection definition ...


1

In the end I wrote the following script that solved my problem. The script converts raster pixels with a specified value to vector lines. For example the blue pixels (value = 0) are converted to vector lines. There is definitly room to improve the script, as you can see in the result image. The script can be found and edited here. Raster Image Raster ...


1

I tried your commands and changed filename raster, to filename char(250), , assuming you meant to use a string for that (and declaring it as a raster is a typo??). The commands seem to work without -C. With -C, I got some warnings/notices about numeric field overflow and no_data. But I guess that's just something in my data. What I tried is: echo ...


4

I think that the script is expecting to read in a set of regularly spaced points, with deviations less than the minimum tolerance. Your set of points is actually quite irregularly spaced: You can see that there are large missing areas. Also, if you zoom in closer, you'll see that even at the fine scale, the points are not regularly spaced on a grid ...


1

you could automate this with a loop in Python. Arcpy uses "lazy computing, so this will be evaluated when you save. import arcpy from arcpy.sa import * imList = glob.glob("your_path/*.jpg") outraster = raster(imList[0]) i=0 for im in imList: if i>0: outraster += raster(im) i+=1 outraster.save("outputname")


2

Here is an example that does roughly what you ask for. The main parameters are the geotransform array that gdal uses to describe a raster location (position, pixel scale, and skew) and the epsg code of the projection. With that, the following code should properly georeference the raster and specify its projection. I did not test this much, but it seemed to ...


4

You cannot directly delete a row in a raster attribute table. This is because deleting a row would essentially be reclassifying the cells in that grid to NoData within the attribute table, which is not supported in ArcGIS. ArcGIS has a variety of tools to effectively "delete rows" including (to name a few) Reclassify and Con. These tools actually ...


0

Most times I use a boundary polygon to clip the raster. You can find the tool under Raster Processing.


2

If you go to Symbology under Layer Properties of your image, there is an option to Display Background Values. You can choose 'No Color' and that should remove the black sea part.


0

If you want to extract value from a SRTM data then you should use a point shapefile because raster image change their pixel value at different level and in polygon layer you can not find right value. so you have to need a point shapfile to extract value.


0

Ok, I'm still fuzzy on what exactly your export file is but I'll assume "#of cells" is simply the number of pixes for each raster and "Value" is some identifier for each raster (parse the file name??). In absence of how to get "Value", I just put an incremented variable. This script will require gdal. import glob from osgeo import gdal import numpy as np ...


0

if you want to convert to geotiff with raster package: input_name=raster("c:/file.bil") #if you use output_name="c:/output.tif") writeRaster(input_name, output_name,format="GTiff",datatype='INT1U',overwrite=TRUE) the data type depends of your input data type, in this case 8bits. if you want to convert to geotiff with gdalUtils package: ...


2

You can create overviews in RRD format with gdaladdo http://www.gdal.org/gdaladdo.html. However, without being able to test with your program I can't say if they will for sure work with it. Test and report how it goes. There are two ways for creating the RRD overviews: gdaladdo --config use_rrd yes image.tif 2 4 8 16 32 64 This will create an .aux file ...


0

You need to stretch the NDVI floating point values (-1 to 1) to 8-bit unsigned (0 - 255). If you convert the float to integer directly, the resulting raster will have only one integer value. You can stretch the values in the Raster Calculator using the following equation: (NDVI - -1) * 255 / (1 - -1) + 0


2

The above code looks more like you just clone shp into shputm and then assign the output of crs(shp) to shputm without performing an actual reprojection. Anyway, if you import both the shapefile and the NDVI raster, and then reproject shp using spTransform, subsequent data extraction should work out fine. Also, the output of extent(shp_utm) roughly agrees ...



Top 50 recent answers are included