Elio Diaz
  • Member for 4 years, 5 months
  • Last seen this week
How to reinstall QGIS from scratch on Ubuntu?
9 votes

sudo software-properties-gtk there in the package manager remove qgis and ubuntugis from the list; sudo apt-get autoremove sudo apt-get autoclean sudo apt-get -f install sudo apt-get autoremove qgis ...

View answer
Adding site photos to a print composer atlas in QGIS
7 votes

I know you mentioned you do not code, but your task may be cumbersome in click and drag software, because you want paired images-filenames; your goal may be accomplished with very few (8 to be precise)...

View answer
Extract cells above certain values of raster file
Accepted answer
7 votes

As previously commented, you may accomplish all your task using R exclusively; in the following code, a raster is created and then filtered to values above the threshold, all other values will become ...

View answer
Creating raster object in R (raster package) by browsing directory
Accepted answer
5 votes

Function list.files() from base R allows to list files that match a pattern, in your case it would be .tif, or, if you only want those that start with wc it would be wc.*tif, using regular expressions....

View answer
Inspecting lat long of shapefile using QGIS?
5 votes

That's what shapefiles do: keep the coordinates in a binary where you cannot see them. In qgis go to the field calculator, ad a field "x": double, length 12 with 8 precision, and then write "$x" in ...

View answer
What are units for calculated area in QGIS?
Accepted answer
4 votes

you have to set your project>project_properties>CRS to utm, lambert or anything projected; otherwise it will give you a "square arcsec" or "square degree" value for area Edit ...

View answer
Changing resolution of rasterbrick using R
4 votes

The function you are looking for is rather resample, res is rather used to set a resolution: if used to change an existing one, outputs an empty raster ; in the following example, a dummy raster is ...

View answer
How to use v.clean in QGIS to fix polygon topology
3 votes

I first checked your data with Vector > Geometry > Check validity tool in QGIS, which yields a layer of the invalid output and the errors found; all errors where identified as "line 0 ...

View answer
Conditional statement in R based on multiple rasters
3 votes

If I understood, you will be overwriting raster_1, putting NA when the condition is met. Here, the key is get which fetches an object from the environment by a string name. library(raster) # we ...

View answer
Pivot sf geometry column such that each row contains a single polygon
Accepted answer
3 votes

You are passing dissolve = TRUE to the rasterToPolygons function, which means all pixels of a same value will be merged into a multipolygon; as you asked, st_distance returns the shortest distance. In ...

View answer
Removing overlapping sf lines in R
Accepted answer
3 votes

Here's an approach using st_covered_by, which will return TRUE if a same sized or longer LINESTRING covers the geometry, the longest line here is the second feature, so the order does not matter, ...

View answer
Convex hull that follows irregular points distribution
Accepted answer
3 votes

Using PostGIS ST_ConcaveHullyou may get the envelope to follow more closely the irregular shape, as stated in your post; ogr2ogr -f GPKG concave.gpkg points.gpkg -nln concave_layer -dialect sqlite -...

View answer
Combining two shapefiles using common attribute
Accepted answer
3 votes

As you state, you are trying to join only the non-spatial data; but sf standard doesn't allow two geometry columns; dplyr::select() for the non-spatial columns will fail, because, as stated in sf ...

View answer
QGIS-3.10 raster calculator crashing on Windows
Accepted answer
3 votes

The solution was to check the box in "Settings - Options - Acceleration - 'enable acceleration for opencl'". Grass's calculator did work without the setting.gdal_calc was not included in this osgeo4W ...

View answer
Area of click-selected features PyQGIS
Accepted answer
3 votes

The approach to what I was trying to achieve was to use the QgsProcessingFeatureSourceDefinition(layer.id(), True), this I found by reprojecting a layer using clicking menu, and checking the log, then ...

View answer
Merging two spatial objects in R: spCbind gives error "row names not identical"
Accepted answer
3 votes

As the output of sp::over is ordered to the input, you don't need to join/merge the two objects; you only need to add the targeted (or desired) columns from the output of over to your data frame. ...

View answer
How to extract pixel value counts from a raster in QGIS, in different polygons?
3 votes

you may use the grass plugin within qgis, or go directly to grass; there's the module called r.report which takes two rasters (just convert your shapefile with v.to.rast taking care of the resolution; ...

View answer
Rasterise vector into raster mask
Accepted answer
3 votes

When you open the rasterize option, you have to edit (click on the pencil icon) the code, what you are looking for is the "burn" option of the gdal_rasterize parameter; you should erase the "-a ...

View answer
How do I make a composer template that will display what is currently on the canvas in QGIS
Accepted answer
3 votes

you may use "set to map canvas extent" option in the map properties, that way you don't have to re-add a map object

View answer
black and white aerial ortophoto classification using texture with GRASS
3 votes

After researching a lot, I've found/developed this GEOBIA workflow for GRASS GIS in combination with R machine learning: in GRASS: calculate the texture with r.texture; make the objects with i....

View answer
NA outcome when running over() between a SpatialPoints and SpatialPolygonsDataFrame
Accepted answer
2 votes

The most important part you missed was setting the projection on the first tardigrade object and then converting either tardigrade or biogeo object to the CRS of the other object using spTransform. It ...

View answer
Using contours to create polygons around hills in R
Accepted answer
2 votes

This is just a small piece of R code, following the PyQGIS example you showed, which should get you on the road: library(sf) library(dplyr) contour = read_sf("contour_lines.gpkg") # ...

View answer
Lake shapes from OpenStreetMap (OSM) in R. Polygon vs multipolygon issues
2 votes

After taking a look at the data, and unless an osm expert points out a better filtering option, I suggest to filter out those polygons that "have" the islands and the islands as well, ...

View answer
Indexing RasterStack in for loop
Accepted answer
2 votes

You may pass a second argument, a string to specify the name of the layer which is the DTM; in the following example I filter out the dtm layer from the layer names, because it may happen it's not the ...

View answer
Using sf to combine polygons that share border with a polygon, but dropping the central polygon?
Accepted answer
2 votes

You may use the DE9-IM relationship (see st_relate help page), and the function st_filter providing the relationship pattern, which in this case would be "FF2F11212": library(sf) library(...

View answer
Assign raster values based on polygon intersection
Accepted answer
2 votes

You may as well use the function mask; according to the function help: "You can use inverse=TRUE to set the cells that are not NA (or other maskvalue) in the mask" library(raster) library(sf)...

View answer
How to determine left and right side of crossing lines?
2 votes

Here is an approach using Postgis, it shouldn't be difficult to replicate in Python, code finds the azimuths from the intersection to the starting points, if it geom A's azimuth is greater than geom B'...

View answer
Match centroids from one dataset with polygons of another
Accepted answer
2 votes

One of the few limitations simple feature standard for geometries has is that it cannot have two geometry columns; you may have two or more columns with WKT definitions but you have to decide which ...

View answer
Split Raster (by value) to Multi-Part Polygons
Accepted answer
2 votes

The following code first builds a sample data and uses function cut to make 5 classes, then converted to raster; converts to spatial and "dissolves" the polygons, merging together those ...

View answer
Calculating the minimal distance to the nearest polygon for multipolygons in different crs
2 votes

In R there are warnings, which do execute the code but give you feedback on something you should be considering, and errors, which halt the functions; repeating attributes for all sub-geometries for ...

View answer