Hot answers tagged

7

You can use a script like this: layers = QgsProject.instance().mapLayers().values() for layer in layers: # get the first feature's UNIT_NAME value name = layer.getFeature(0)["UNIT_NAME"] layer.setName(name) Note: The script changes the name of the single layer that has 72 categories, too, if it exists in Layers panel. So you can add ...


5

If the website doesn't provide a style file (.lyr) then you should manually assign a different color to each unique class. The documentation in this zip file contains RGB colors in the image. In ArcMap Open Layer Properties dialog box Navigate to Symbology > Categories > Unique values. In Value Field select the field referring the class name, the ...


5

It may not be the most elegant way. However, you use "Extend line" to extend lines by the distance of the longest edge of the polygon. The output looks like this and you can clip by Polygon with the "Intersection" tool. And the output looks like this


5

Use this expression with geometry generator or the Geometry by expression tool - the expression is adapted to the data you provided (layer name: 'Bounding Box', distance to extend the line: 65): intersection ( extend ( $geometry,65,65 ), geometry ( get_feature_by_id( 'Bounding Box',0 ) ) )


4

So extending Kadir's answer, because I did not want all layers to be renamed, just those that got assigned names with a specific string through affine transform, I came up with the following, which worked nicely. import re RES_STRING='Palinspastic' STRING=re.compile(RES_STRING) layers = QgsProject.instance().mapLayers().values() for layer in layers: ...


4

Use select by expression with this expression: "Distance"=minimum( "Distance", "ID")


3

An unsupervised learning approach using density based clustering could be applied to determine the clusters the OP is looking for. To this end, this proposed solution is implemented using PostGIS, however the idea can be conveyed to QGIS, too. To obtain the clusters, a perpendicular will be required intersecting all parallel input lines which will yield a ...


3

I downloaded shapefile available in the question and it looks as follows in QGIS3. It can be observed that lines are not equally spaced between groups and it could be difficult to exclude a manual decision for a quick useful approach. However, it can be summarized in a python script because there are several algorithms in processing tool that it can be used. ...


3

What you want to achieve is basically a kind of "clustering" of lines: grouping lines that are close together. You need one manual decision, a maximum distance up until which lines should be considered part of the same group: see end of step 2 for details. This solution has five steps, one step for preparing the data, step 2 as the main step to ...


2

I understood your description that in the first case the blue area is totally overlapping the yellow area and in the second case the yellow area has a hole that is totally filled with the blue area. If you want to express those cases in WKT as one geometry you must use GeometryCollection. Case 1: Big polygon without holes + small polygon GEOMETRYCOLLECTION (...


1

Looks to be a data set / provider issue. While not ideal the complete USGS National Woodland Landcover data set does not have this issue. https://www.sciencebase.gov/catalog/item/5eae3b7382cefae35a279d6f


1

You need to change the snapping option in the snapping toolbar from All layers to Active layer to be able to snap only the target layer as you can see in the following screenshot: The above option will make sure that only the target layer in the edit mode will be snapped.


1

The simplest thing that you can preform, create a user profile by going to settings > user profiles > new profile then update or customize the settings > options for your liking, Example like - CRS Select most prefeed CRS for projects and layers from the drop down and select CRS for projects as use default CRS CRS for layers as Use default CRS ...


1

It's not clear what you are asking. If I understand correctly, you have a raster of Extreme Climate Events, and a vector polygon map of animal habitat ranges. And your goal is to extract statistics from the ECE raster for each polygon in the ranges vector. If this is correct, then you probably want to look at the v.rast.stats module. The manual page is here. ...


1

You actually don't need an analogous of r.mask for vectors for your task. r.stats is a command for rasters (that's what the "r." means), so it will only work within the mask, if you created one. If you want to clip the vector then you could use g.region -> v.in.region and then use the created vector to clip the one of interest.


1

I hate to be the bearer of bad news but FRAGSTATS is functionally dead. Kevin has retired and it is no longer being maintained. Neither version tends to work under Windows 10 (but you may get lucky). Kim WIth's lab has taken it over and moved functionality into the landscapemetrics R package. Among many, one distinct advantage of using R is that there are ...


1

I am the developer of the FactoQGIS tool. FactoQGIS is not suited to address your issue. I recommend you instead to use the SDE plugin: https://plugins.qgis.org/plugins/SDEllipse/


1

Working with the data you provided, you can create the centerline using the following expression with Geometry generator or Geometry by expression. You already have a field angle in your data that can be used to create the line. It needs to be rotated by 90 degrees depending on the value of the angle field from you attributes: intersection ( $geometry, ...


1

I inspected your data, the solution is based on that. First, create a new field longest that evaluates which side of your rectangle is the longest, width or height. Use this expression in the field calculator: if ( "width" > "height" , 'width', 'height'). Than you can create the centerline using this expression with Geometry generator ...


Only top voted, non community-wiki answers of a minimum length are eligible