New answers tagged

0

It seems to be known that GeoServer does not validate SLD like you have but it should still work From: Ian Turton - 2017-08-01 10:57:00 https://sourceforge.net/p/geoserver/mailman/geoserver-users/thread/CAJaHrDzHyPrvv_OVRoGuesib5%3DPx5%3DCkyfm1p0gMhroi%2BpZ8Yw%40mail.gmail.com/ It is right but it is technically invalid SLD so the validator rejects ...


0

LYR file is NOT data just reference to data and symbology label and scale dependency information. GDAL works great at converting GeoPDF to TIF.and OGR2OGR for GeoPDF to vector GIS file. Why don't you download some basemaps as TPK or TPKX. ESRI even have separate tool for this Tile Package Kreator. I use global mapper with GEOPDF no conversion needed


1

One way to do this is with the gdallocationinfo utility: micha@TP480:GTOPO30$ gdallocationinfo -geoloc gt30e020n40.tif 31 29 Report: Location: (1320P,1320L) Band 1: Value: 15 You enter the X-Y the -geoloc parameter, and X-Y coords at the end, and it returns the Pixel and Line numbers (together with the value at that pixel)


0

Remove this line: fcn.classifyColorRamp(5) QGIS doesn't seem to like this for some reason, you should submit a new bug report issue. The rest of your code looks fine.


2

SELECT ST_VALUE (rast,1,(ST_GeomFromText('POINT(319006 212230)',27700))) FROM public.country_rast WHERE ST_Intersects(rast, ST_GeomFromText('POINT(319006 212230)',27700))


0

which program are you using? qgis, arcMap? If you have an attribute table that would be the simplest way with the field calculator tool.


0

A way to approach this issue is the following: Use QGIS'Create Grid tool (Vector ->Research tools) to create a vector file representing the grid of your coarse resolution DEM (in Grid type select rectangular and in Grid extend select the DEM). Use the zonal statistics tool to calculate the mean elevation for each polygon of your grid (use as raster input ...


0

Just a short remark to the extract function from raster package when you work with lat and lon values - use SpatialPoints: x<- 44.8386 y<- 0.5783 value<-extract(raster, SpatialPoints(cbind(x,y))) Without it, you may just receive NA values.


3

For a non memory-safe option you can efficiently use an apply type function on an sp SpatialPointsDataFrame object. This has the advantage of not having to use which, which replicates a vector the size of your raster (which could be huge), is much faster than a for loop and directly results in an sp point object. Add libraries and create data library(sp)...


0

I was able to use r.mapcalc to create a raster for all of the x and y values of the original maximum elevation raster. For example: if(maxElevationRast,x(),null()) Then I used r.grow.distance to extrapolate the x and y values, covering all null cells. Finally, I used r.mapcalc and simply found the difference between the x() and y() moving-window values and ...


1

I think it is because you use WMS layer which can be served like a tiled image - not "real" DTM. Why not to use SRTM or EU-DEM? SRTM http://dwtkns.com/srtm30m/ EU-DEM https://www.eea.europa.eu/data-and-maps/data/copernicus-land-monitoring-service-eu-dem This is an example of using EU-DEM data. I cropped some part using a polygon layer in SAGA-GIS and then ...


1

I believe the reason you cannot access the values from this DTM is because it is being served as a WMS, which QGIS is unable to obtain data from. Sometimes some WMS work as WFS if this one does, the second answer here might be of help.


1

One approach is to resample your second raster (elevation correction) to fit the size of your DEM. Of course, as you are going from a bigger pixel size to a smaller one, you will have repeated values for each original pixel (see picture below). Image taken from Chris Garrard's Geoprocessing with Python On ArcGIS, you can use the Resample tool and use your ...


1

The problem, as you observed, is that the Rasterize program sets the values outside of the polygons to NODATA (or dummy), and the raster calculator outputs a dummy wherever either raster has a dummy. In QGIS 3.6.3 I've solved this problem by specifying the output carefully in the Rasterize program to give everything outside of the polygons a value of zero. ...


0

If you created the grid using the Grid tool from the processing toolbox, it has the X and Y values of the grid stored as attributes: left top right bottom Use these attributes to create the corner coordinates. Use the corner coordinates in a Geometry Generated style to create triangular geometries. Each grid square has corner coordinates like this: Use ...


-1

I found this code which might help other people as well: https://github.com/environmentalinformatics-marburg/heavyRain/commit/30edea7e11a1fd41f98ed397fea32c4376560891#diff-f4c1e81d0b0b30884c2c20442238b2e4


0

As far as I can tell the logic for those classes is down it org.jaitools.media.jai.zonalstats.ZonalStats but it is fairly opaque. For a simpler way to do it have a look at this code: private double findMax2(int band) throws TransformException { double max = Double.NEGATIVE_INFINITY; GridSampleDimension sampleDimension = cov.getSampleDimension(...


2

As your data points are regularly distributed (0.25 x 0.25 degrees), you can just rasterize (or "burn") to create a raster layer... you do not have to perform gridding task, About the the linked question in your comment, unfortunately, the interval between data points were only slightly irregular (like 0.1666 vs. 0.1667) which required to be gridded (by ...


1

Try defining the output extent in the coordinate system you are reprojecting the raster to. You can reproject your extent using the following code: # Code for QQIS 3.xx - QgsCoordinateTransform is different in v 2.xx # crsSrc = QgsCoordinateReferenceSystem(rlayer.crs()) crsDest = QgsCoordinateReferenceSystem(4326) #epsg of target crs xform = ...


2

I have it working. My solution was to generate a world file (.pgw in my case as my image was a PNG) Link and invaluable assistance provided by @MichaelStimson. Here it is the working code: IEnvelope envelope = ArcMap.Document.ActiveView.Extent; byte[] image = await GetImageAsync(endpointUri, accessToken); MemoryStream ...


1

You need to re-run Point Density and in the tool environment setting, set the output extent and snap raster to "Raster A":


1

ratify is the right option, but you should do an extra step. You need to create a dictionary to store desired values and create a numeric column to be used in rasterize process: library('raster') library('rgdal') # Load a SpatialPolygonsDataFrame example (Brazil administrative level 2) shapefile dat <- raster::getData(country = "BRA", level = 2) # get ...


1

Add the layer to the your current map before drawing or refreshing the view. (ArcMap.Document as IMxDocument).FocusMap.AddLayer(rasterLayer);


0

Okay, I figured it out after finding this link: https://datacarpentry.org/r-raster-vector-geospatial/02-raster-plot/ Instead of using the inset_raster function. I transformed my raster into a dataframe and used the geom_raster function to add it to my ggmap, which has a more straight-forward mapping to the legend. Next, I used coord_fixed instead of ...


2

Your question is related to LAScatalog processing engine tuning. A topic not documented in the official documentation. The only one existing documentation at the time being (june 2019) is a wiki page that provide an example to change the drivers. In short the drivers used to write objects to files are stored in the LAScatalog object. You can access to them ...


1

Finally I have found a solution for my problem and is this: rCalcEntry1 = QgsRasterCalculatorEntry() rCalcEntry1.ref = 'r1@1' rCalcEntry1.raster = rasterInput1 rCalcEntry2 = QgsRasterCalculatorEntry() rCalcEntry2.ref = 'r2@1' rCalcEntry2.raster = rasterInput2 MinValues = '((r1@1 < r2@1) * r1@1 ) + ((r2@1 < r1@1) * r2@1 ) + ((r2@...


3

As described by @Kazuhito, the tiles should be combined into a virtual raster. Their method is performed within QGIS. If you have a large number of tiles you may prefer to do this from the commandline. To do so open a shell in the directory containing the SRTM tiles and run gdalbuildvrt combined.vrt *.hgt The resulting virtual raster (combined.vrt) can ...


3

The logical approach is correct, but 60 Gb is a massive raster file: I would first asses if all that detail is really needed. A 0.3 raster over Hong Kong seems a little far, if the input data does not have that resolution. Keep also in mind that the contouring process by definition introduces a smoothing of the data. If reducing the detail is not an option ...


12

SRTM tiles (3601 px * 3601 px in this case) have 1-pixel overlaps in between. When you apply transparency (or reduced opacity) to your hillshade layer, such overlapping pixels stand out. You may have observed this also on the original images, if you apply transparency (see below). ..... original SRTM, Pseudo-color + 60% opacity Anyway, you can avoid ...


1

Suppose your regression model is of type Y = b0 + b1*X + e. Interpolate the explanatory variable (X) to the area of interest (AOI). This means to fill in the empty 100m X 100m grid. Which method/tool to pick up for this depends on the analysis. Use tool raster calculator to create a new raster with values for the response variable Y in the AOI based on the ...


1

Considering a case for instance the original raster has 30m x 30m resolution (pixel size), and we want it be 100m x 100m. If we can find a common divisor between before-after resolutions (10m in this case) then; disaggregate() to refine 30m grid to 3 x 10m grid, then; aggregate() to upscale 10m grid to 100m grid. And the code will be: library(raster) # ...


5

From the screenshot, it's clear that this is a projection issue. The layers all have sufficient detail, that their misalignment cannot be due to low resolution. Also, they are offset by varying amounts in different places. So, to fix this issue we have to figure out the cause of the projection issue. Here are the various things to check: If using a version ...


0

If you're not doing any analysis with the raster after erasing or clipping out the section covered coincident with the polygons you can just cover/hide it by layering it all correctly in your table of contents. I assume the background color of your dataframe is white (if not, just check what it is in the data frame properties). Make your polygons white (...


1

It is difficult to understand the memory problems you report as you do not show the code that causes it. Perhaps you do something wrong. It could also be useful to see the results of show(big.raster) and canProcessInMemory(big.raster, 4, TRUE) (this would look something like this) #memory stats in GB #mem available: 53.67 # 60% : 32.2 #mem ...


0

You can use "Create layer from extent" processing algorithm selecting the desired raster layer as extent source


2

Try eq(a, 11) With an example of 6x6 dummy raster (values 1-6 and NoData=0): giving eq(a, 3) It will return a new raster which 3 has become 1, and others are 0 (thus transparent NoData). In case you want to extract the cell value 11 itself, try a*eq(a, 11) instead (the righthand side image).


0

I am not sure this is the solution you are looking for, but I think it works. If you want to show the change between rasters, this accomplishes that goal. This is the workflow for comparing the change between 2 rasters. The workflow is: 1. Convert rasters to vector using the GDAL: Polygonize tool 2. Use the QGIS: Difference tool to compare change(found ...


2

Extracting cell values to vector points will allow us to further manipulate them through the Field Calculator. (1) Generate points (pixel centroids) inside polygons tool (Processing Toolbox > Vector creation) This tool takes a raster and a vector polygon layer, to generate a point (vector layer) at the center of each pixel. However, this tool does ...


0

I use rasterio and geopandas. My example uses UTM coordinates. Obviously these fields will depend on your particular shapefile. In my experience this produces indentical results to the QGIS Point Sampling Tool. I like this method because the resulting DataFrame of point and corresponding raster values is easy to analyze (e.g. compute the difference between ...


3

The SpatialReference object which can be accessed using Describe has the name property: import arcpy arcpy.env.workspace = r'X:\somefolderwithrasters' rasters = arcpy.ListRasters() for r in rasters: spatref = arcpy.Describe(r).spatialReference print 'Raster: {0} has spatial reference: {1}'.format(r, spatref.name) Example output: Raster: s1milj....


0

What worked for me was setting the primary display field to the field I wanted to classify values by, then removing and re-loading the raster to the map.


0

Reclassify in to your consolidated classes (Reclassify tool). Ensure the resulting classes are integer values In ArcMap’s table of contents, right-click and open the attribute table for the reclassified raster. The “count” field represents the number of cells in each raster class; multiply these by cell size^2.


0

An alternative to the approach suggested in the other answers is to use the rasterio package. I had issues generating these using gdal and found this site to be useful. Assuming you have another tif file(other_file.tif) and a numpy array (numpy_array) that has the same resolution and extent as this file, this is the approach that worked for me: import ...


0

You are barely at the start of this analysis. As such, I would highly recommend trying to track down any resources as a starting point to learn the basics of spatial analysis in R. Honestly, Google is a good start and it is clear that you did not search this StackExchange very well because the fundamentals of your task have been covered numerous times herein....


0

I don't believe you can access those properties as the symbologyType property on a raster layer with a stretched symbology returns the unsupported "other".


0

Here's code that follows what you are doing. First make a raster like your source: source = raster(nrow = 467, ncol = 805, xmn=-119, xmx=-85.45833, ymn=13.54167, ymx=33) crs(source) = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0" Fill it with zeroes plus a diagonal line of 99s so we can test alignments: source[] = 0 source[seq(1,...


0

I believe this is very much related to how the pixel is constructed. Imagine that QGIS or ArcMAP, or any other software creates a virtual grid on top of the polygons with the extent of these. Then it takes the "centroids" to create the pixels. I did the same with small and medium polygons, of all sort of figures, and those polygons that are thin (like a ...


1

Please put the libraries in your code, or use ::; it's time consuming to have to infer what packages might be in your namespace. Your data is irregular points. If you just want them in a dataframe, then covert them to sf or sp objects. Your data values are also nominal, so unless you want to calculate proportions there's no sensible way to convert that to ...


0

Instead of moving the files, you could copy them over to a new destination, remove the currently loaded files and add the newly copied ones into the same group: from shutil import copyfile root = QgsProject.instance().layerTreeRoot() main_group = root.findGroup('Hydrology') my_folder = "/home/" for layers in main_group.children(): layer = layers.layer(...


0

I am having this exact same problem trying to batch process a Warp reprojection. Works fine in single mode, not in batch. I think it has something to do with saving to temporary files -- its allowed in single but not batch mode. See page 380 of user guide: ftp://ftp.ncaor.gov.in/Quantarctica3/QGIS_UserGuide.pdf


Top 50 recent answers are included