# Graduated values in symbology based on specific attribute in QGIS

I'm trying to solve the problem I've raised in Copying graduated scale from polygon to point layer in QGIS?

I've rearranged the attribute table that looks like this:

Important to notice is that the field "gruppo" is composed by 2 unique attributes: "campione" and "controllo".

What'd like to do now is to create a graduated symbology based on an attribute (say "pcb_101") and use the quantile classification.

BUT I need that each class of the quantile classification is based only of the "campione" rows of the "gruppo" field.

I tried to use the rule renderer but I noticed that, even if I add the rule"gruppo" = 'campione'and add intervals to this rule, the calculation of the quantiles is made using the whole "pcb_101" field.

Try

1. setting "gruppo" = 'campione' in General | Query.
2. Then do the classification.
3. Then remove the query again.

Hacky, but might work.

## Proportional symbols

Proportional symbology is used to show relative differences in quantities among features. Proportional symbology is similar to graduated symbols symbology in that both draw symbols sized relative to the magnitude of a feature attribute. But where graduated symbols distribute features into distinct classes, proportional symbols represent quantitative values as a series of unclassed symbols, sized according to each specific value.

Proportional symbols can be defined for point, line, or polygon feature layers. When applied to point or line symbols, the feature's size is modified directly. When applied to polygon features, a proportionally sized point symbol draws at the center of the polygon. For reference, you can specify a uniform background symbol for the polygons that draw below the points.

This animated map uses proportional symbols to show the fluctuation of precipitation in Mexico.

Proportional symbols can be based on an attribute field in the dataset, or you can write an Arcade expression on which to generate numeric values to symbolize.

##### Caution:

When proportional symbology is based on a single field, the symbols are drawn in a sorted order, where the larger features draw first and the smaller features draw above. When the symbology is based on an expression, this sorting does not occur, and some smaller symbols might be obscured by larger ones.

You will have to add your own settings in the "Settings section" inside the function. For the defined product attribute name, this function will take the first corresponding term set for the current product (as an attribute can have many terms in a product) and will display all similar products just before "Upsells products" and "Related products".

Code goes in function.php file of your active child theme (or active theme). Tested and works.

## Joining Datasets Together

Double click on the original county map layer, or right click and select “Properties”, to bring up the Layer Properties dialog.

Click the “Joins” menu from the left. We want to add a new join (you can have many joins we’re just going to do one). Click the green + icon in the lower left to start the process of creating a new join.

We want to join our original county map to the population data we just loaded. You’ll see the “Join Layer” field is already pre-filled with your co-est2018-alldata layer (because it’s the most recent one we’ve loaded). As we’ve already investigated, we want to link the two datasets by county name. Select the Join field as CTYNAME , which is the name of the column containing column names in our CSV file for the Target field, select the corresponding column in the county layer table, which is NAMELSAD .

The last step in joining data

Click “OK” to close the Add Join dialog, then click “OK” to close the Joins dialog.

If you look at your map now, you might be dismayed to see that it looks exactly the same. But why should we expect it to be any different? We’ve created a link between two fields, but haven’t told QGIS what it should do with the new data (the county census data) that we’ve linked to the original county shapefile layer. Creating the join between datasets and telling QGIS what to do with the population data are two distinct steps.

Before we try to visualize the county population data, we should double check that our join has worked. Bring up the attribute table for our original layer ( tl_2018_us_county ), scroll to the right, and notice that all of the data from the CSV file has been added to our original attribute table. You can also see how QGIS names the columns to indicate where the data comes from—the CENSUS2010POP field is now labeled as co-est2018-alldata_CENSUS2010POP (the CSV filename prepended to the original field name). Close the attribute table.

## Video - Best Practices, Tips and Altering Defaults in QGIS

Today we’ll introduce some tips and best practices for using QGIS, covering topics such as file management, optimizing workflows and accessing, running and troubleshooting common issues with processing tools. We’ll also briefly discuss changing program defaults, enabling some customization of the interface and treatment of data according to individual needs. These best practices and tips will help avoid frustration and facilitate processing, analyzing and sharing spatial data products and visualizations with others.

So the first tips concern file and directory management. Like many programs QGIS uses absolute file paths by default to link layers to project files. Therefore, if a directory or file is moved or renamed, the new path must be provided when reopening the project otherwise the affected layers are discarded. So select layer and click Browse – navigating to the new directory or filename, and for a shapefile - select the .shp component of the layer.

So as noted, all spatial data should be in a common directory – here the Geospatial Data folder - using additional subdirectories and distinctive file-names for further organization. It is still best practice to avoid spaces and special characters in filenames or directories – as this can complicate saving or loading files. So substitute spaces with underscores or dashes as required. Finally, using GIS it’s easy to rapidly create multiple files – so ensure to manage your directories judiciously.

The optimal file format for a dataset depends on the intended use. Shapefiles help quickly share layers with others for analysis, visualization and editing – while geodatabase and geopackage files enable layers of different geometry types to be stored in a single file with the original layers locked from editing unlike Shapefiles – there are no limits on field name lengths. The Package Layers tool can be used to create a geopackage, where we could then combine the points from the Grain Elevators layer, lines from the road segments and polygons from the projected Manitoba census subdivisions. After saving to a permanent file, we could then load the layers like a file geodatabase. And there are a variety of other formats – such as KML for loading and displaying a vector layer in Google Earth. In general, use the Format drop-down in the Save Vector Layer As box to change to the desired file format. There are many sources detailing the applications, advantages and disadvantages of major formats, which can be consulted in determining the best format for your data.

And to improve rendering times for large vector datasets we can use the Create a Spatial Index tool from either the toolbox or the Source Tab of the Layer Properties Box. The raster equivalent is Build Overviews - creating coarser resolution versions of the input for rapid rendering at broader extents.

The next tips relate to GIS workflows. Ultimately, there are many ways to complete the same task in GIS. So the shortest workflow, in number of steps, intermediary outputs or processing times, which achieves the same result is the best workflow. Comparing these expressions – which produce the same selection - the second expression is better – as it avoids repeating the field name and operator for each attribute of interest. So apply these principles to your own workflows – whether it is the specific tools applied, the order in which they’re implemented or, as just shown, the way that an expression or code is written.

So QGIS tools can be accessed from the menu-bar drop-downs or from the Processing Toolbox. Note there is some mutual exclusion in the available tools – such as the Check Geometries Core Plugin in the Vector drop-down or the additional GDAL, SAGA and GRASS tool set, as well as user-created models and processing scripts in the Toolbox. I find that the Toolbox is the fastest and easiest way to isolate available tools using the Search bar, as this will also return additional or alternative tools that may be relevant for your workflow. If needed, use the descriptions on the right-side of a tool to help parametrize it. Note that the parameters can vary depending upon the specific source of the tool. For example, the QGIS Slope tool has just two parameters, for the Digital Elevation Model and Z factor, while the GDAL Slope tool contains additional parameters such as expressing slope in percentages vs degrees. The appearance of tools can also vary according to the location that they’re accessed from. So, for example, opening the Select by Expression tool from the Toolbox is markedly different in it’s appearance from that on the Attribute Toolbar – lacking the central drop-downs to help us construct our expressions.

The next item is on spatial properties. As noted, when using multiple layers in QGIS, the projection, datum and coordinate reference system should be uniform. Although QGIS re-projects layers on-the-fly for visualization to the Project Coordinate Reference System – established by the first loaded layer - it does not resolve these differing properties for processing and analysis. For spatial analysis, use a Projected Coordinate Reference System – tailoring the selected system to the required precision for your analytical needs.

Conversely, due to the potential effects on cell alignments and values, rasters should not be re-projected unless necessary such as for spatial analysis or integrating multiple rasters from different sources. In these cases, the alignment and resolution of cells should also match - which can be accomplished using the Align Rasters tool. Select the input layers, output file name and resampling method. The coarser resolution raster should be used as the Reference layer. And as we can see, the position of pixels compared against the original raster have been slightly shifted, but toggling on the aligned DEM we can see that their cells are aligned which we could then process and analyze further as required. Similarly, when sampling raster layers ensure that the minimum distance between points is greater than the resolution of cells to avoid violating assumptions of statistical independence.

The next tips concern running processing tools. Most tools can be run on single layers or Run as a Batch Process for multiple inputs. However, when run as a Batch Process – temporary layers and Selected Features Only are not available. The Multiple Selection box can help rapidly select layers of interest, and where possible we can copy and paste parameters to reduce manual inputs. To store intermediary layers we can create a temporary directory which we can be deleted after processing – as I did to re-project layers to WGS UTM Zone 14, with the Scratch folder. Provided the layers are named with the desired filename we can just add a prefix and use the Autofill Settings, Fill with Parameter Values to automate the output filenames.

Alternatively, for vector processing we can enable the Edit in Place function in the Toolbox. This enables input layers to be modified without creating new layers. So we could re-project layers, or here take the AOI layer and Rotate Features by 180 degrees. We can use the Undo function to revert to the original inputs as needed. Another option is to create a process model, defining inputs and algorithms for repeated tasks, such as this one here which reprojects and clips a layer to a common coordinate reference system and extent. We could then double left-click it in the Toolbox to run it individually or as a batch process in standardizing the spatial properties and the extent of analysis. We’ll cover the Process Modeler in a later demo.

So most QGIS tools are run in the Background – meaning that other tasks can be completed while processing tools are running. This is not necessarily applied to GRASS or SAGA tools. So be patient – even when the program appears frozen - often tools are still running and will complete given the required processing time. However, there is no auto-save in QGIS – so ensure to save edits to layers, visualizations and project files frequently, especially prior to running processing-intensive tools. And if QGIS crashes while using a processing tool, the Toolbox Icon may disappear from the Attribute Toolbar when the program is reopened. Since it’s a core plugin, it can be reloaded from the Manage and Install Plugins box, opened from the Plugins drop-down. We can then check the Processing box off and on again to have the icon reappear.

The Plugins are another key component of QGIS, integrating user-created functions. And they can be installed and updated directly from this window when connected to the internet or loaded from a compressed folder if downloaded from the Online Repository. Note that non-core plugins may rely on additional dependencies and can also become deprecated between QGIS versions – in which case they are listed in red.

Now let’s quickly discuss editing defaults within QGIS. To do so, expand the Settings drop-down and select Options. Note that any changes made here apply to all project files, and require restarting the program to take effect.

Within the General Tab, we can alter the interface language - specifying the language and locale – here having selected Canadian French. As we can see this translates most aspects of the interface, including tools and outputs accordingly. Back in the General Tab, below are additional defaults on system prompts and project parameters. In the Coordinate Reference System tab we can change the default Coordinate Reference System. We’ll leave it as WGS84, as this is the most widely used Geographic Coordinate Reference System. We can also alter how the coordinate reference system is established when loading layers – using either the Default, Prompting for each Layer or using the Project Coordinate Reference System.

In the Data Sources tab we can alter the behaviour and formatting of the attribute table. We can specify which features are shown, the default view as either form or table, and the defaults for copying the table. So, the default here includes Well Known Text which are the coordinates for the geometries of each feature. And this enables tables to be processed and analyzed externally, and reloaded in a spatial file format. However, if no further analysis in GIS was required or the data could be rejoined via another means such as unique identifiers - we could switch to plain text, no geometry to reduce times in exporting the table.

Rendering provides information on the defaults for visualizing vector and raster layers, such as geometry simplification for vectors and default rendering styles for rasters. The next four tabs enable edits the selection and colours for other map interaction tools, pre-defined colours and scales, and parameters for feature delineations.

Within the Processing tab, we can select the default file formats for raster and vector layers, how to address invalid geometries in a vector – here leaving it in its default - as well as the displayed information when running tools and the default output folder. In the Menus drop-down, we can customize the tools listed in the menu-bar drop-downs and on the toolbars. So to add it to the menu-bar, copy the Menu Path syntax from a tool already added and paste it to a tool of interest. Then to add it to a toolbar simply provide an icon and check the “Add button in toolbar” box. So here I created a custom toolbar with Geoprocessing tools, including Extract by Location – using the Snipping tool to extract icons from the toolbox. The toolbar can then be accessed once QGIS is restarted – here being shown in the French interface.

The Project Properties box contains similar parameters - but are specific to the active project file. It can be opened by clicking on the Project Coordinate Reference System button in the bottom right corner of the interface. Within the General tab, we can switch the Save Paths from Absolute to Relative for saving layers, which will reduce complications when sharing project files and directories with others. We can also specify default visualizations for different geometry types. And within the Relation tab we can establish layer relations, with the Referencing layer containing ‘many’ entries - such as the Census Subdivision layer - and the referenced layer containing one matching entry – here using the Census Division layer - and linking them by the census division identifier field.

Finally, let’s discuss some common problems and resolutions for processing layers. Most resolutions link back to the best practices we’ve discussed. The first thing to do is to consult the Log tab for targeting your trouble-shooting initiatives. For example, if it returns Invalid Geometries – run the layers through a cleaning tool such as Fix Geometries - and then rerun through the tool of interest with the fixed output. If errors persist tools such as Check Validity and Topology Checker can help identify errors, which can then be resolved with more advanced cleaning tools such as v.clean and Check Geometries. There are also case-specific tools such as Delete Holes and Remove Null Geometries, which can be applied as required. Less favourable is altering the default settings for Invalid Filtering to Ignore - since it does not address underlying issues and may yield inconsistencies in the outputs and analysis.

If the Log tab indicates a layer or folder cannot be found, ensure once again there are no spaces or special characters in the directories, subdirectories or filenames.

Inconsistencies in projections of input layers can also produce failures. And the differences will be shown by the differing EPSG codes after the layer names – in which case simply re-project the layers to the same system. If a geoprocessing error is returned, this may indicate that layers may differ in their type – specifically as single or multi-part, which relates to the number of features and corresponding entries in the attribute table. In this case, simply use the Multipart to Single Part or Promote to Multi-part tools to ensure conformity between the layers.

Finally, similar issues can occur with tools that require conformity or have constraints on accepted field types or file formats of input layers.

If related to differing field types we can use the Refactor Fields tool to ensure that the field types are the same. Otherwise, differences in common fields between layers can cause Join Attributes by Field Values, Merge and other tools to fail. Within the tool we can specify the field types, and length and precision parameters. In addition to linking layers together, it can also be used to correctly attribute a field type based on its content – such as changing a string field type with numeric variables to integer or double for use in the field calculator, interpolation tools or applying a graduated symbology.

If pertaining to the accepted geometry types: there’s a variety of geometry conversion tools to switch to the desired type. Some relevant tools include Buffer to generate polygons from lines or points, Polygons to Lines or Points to Path for Lines, and Centroids and Extract Vertices to extract points. Some layers may require additional formatting to convert successfully. And broadly, Polygonise and Rasterize tools can be used for converting between raster and vector formats.

If pertaining to the vector format: Use the Export – Save As box to change to the desired file format, such as enabling file geodatabase layers to be edited and processed.

Otherwise, use a comparable tool within the Processing Toolbox. And if substitutes also fail, this indicates that the issue likely lies with the input datasets. However, we can also troubleshoot online, exploring GIS forums and other online documentation. Seldom will you be the first to encounter an issue, and these particular resources are fantastic means to identify any issues or known bugs being reported, and ultimately resolve any issues you may encounter.

And finally we can explore and install plugins as substitutes to perform a task of interest.

So using these best practices will facilitate navigating, loading, editing and visualizing multiple geospatial datasets in QGIS. Apply these practices to minimize potential errors, frustrations or repeating processes when using QGIS. As with any program save edits to layers, symbology styles and the project file frequently to avoid information loss should the program close unexpectedly.

## Mdhntd

Our group keeps dying during the Lost Mine of Phandelver campaign. What are we doing wrong?

12V lead acid charger with LM317 not charging

How to continue a line in Latex in math mode?

Can you use the Help action to give a 2019 UA Artillerist artificer's turret advantage?

Are children a reason to be rejected for a job?

Is there such thing as a "3-dimensional surface?"

Does this put me at risk for identity theft?

Did WWII Japanese soldiers engage in cannibalism of their enemies?

Why ReLU function is not differentiable at 0?

Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?

How to approach protecting my code as a research assistant? Should I be worried in the first place?

How to halve redstone signal strength?

Did silent film actors actually say their lines or did they simply improvise “dialogue” while being filmed?

Based on what criteria do you add/not add icons to labels within a toolbar?

Print only the last three columns from file

How can I refer to something in a book?

Cobb-Douglas production function with expenditures rather than units

Is there a drawback to Flail Snail's Shell defense?

What is an air conditioner compressor hard start kit and how does it work?

How do I get the =LEFT function in excel, to also take the number zero as the first number?

Identifying duplicate attributes in field using QGIS?

Filling column with consecutive numbers in QGIS?How to group and count attribute data?How to select features with same values?Check whether values are unique in a column or notHow to save WMS getFeatureInfo points to a layer?Delete duplicate spatial point/points in mssql from a perticular locationGetting difference between two versions of Shapefile using QGIS?Determine the number of fields of a certain field type there are in an input feature classAuto populate a field in the attribute table with unique IDsHow can my PyQGIS script copy specified attributes from one layer to another?QGIS Naming in Legend Based on Multiple ColumnsDeleting duplicate points except those with different attributes in QGIS?Find duplicate point with same valuemany to one join in QGIS

## Web Map Layers and Ordering

A map is usually made up of more than one layer. Even the simplest maps that are looking at a single dataset might contain multiple layers, these additional layers are used to give content to the main dataset.

For example, if we are mapping counties by population. We might choose to also include the state boundaries to give the user geographic context, we might also add the major cities as points to help users visualize why particular counties are so populace.

We might also include a base map with satellite imagery or a street map in order to give the user a detailed context.

In particular, the use of base maps is far more common in web maps than in desktop GIS systems. This is partly a legacy of Google Maps setting the tone for user expectations when it comes to web maps and is also less common in a desktop GIS system as the preferred workflow to locate areas of interest is using a query, rather than visual cues.

So the legend for this map might look like this:

1. Cities marked as points with a label containing their name
2. States outline with a thick stroke and a transparent fill
3. Counties with a thin stroke and a graduated color fill based on population
4. A Bing streets basemap

In a GIS system we would be able to toggle each layer on and off in the legend. For web mapping this is often not the case due to performance constraints.

With a desktop GIS our data is stored locally and our GIS system can quickly get the geometry from the hard drive and render it on screen.

With a web map all the data needs to travel across the internet in order to render on the user&rsquos screen. That&rsquos fine if the dataset is small, say under 100KB, but sending the raw data isn&rsquot feasible when the size of the dataset is measured in megabytes or even gigabytes.

To get around this problem web mapping system use image tiles, these are a mosaic of square tiles that render the map onscreen.

This approach is used because it&rsquos much quicker for the map client in the browser to tell the server what it wants to view, and then have the server render tile images from the raw data and send that, than it is to send the raw data.

The data transfer for enough tiles to fill a screen is only one or two megabytes, regardless of whether the raw data on the server is 10MB in size or 1000MB, or the image tiles show the data for a single dataset or one hundred datasets stacked on top of each other.

This approach offers great benefits in speed and performance, but does present some limitations. The main one being the performance impact of being able to turn layers on and off in the legend, if multiple layers are contained in a single tile set (image), then the layers can&rsquot be turned on and off in the legend

So take our example above. We could send all four layers in a single tile set, which means they are all merged together in a single image, to fill a whole screen with tiles will only use 1 to 2 MB of data transfer.

If we wanted the layers to be turned on and off in the legend, then we would need to have one tileset for each layer and stack them on top of each other on the map.

I&rsquom sure you can already see the problem here. Now to fill a screen with tiles for all four layers we will need to transfer 4 to 8 MB of data transfer rather than 1 or 2 MB. With each tile set in the stack the amount of transfer grows and the performance overhead increases.

This means that you should carefully consider which layers you need to give the end user the ability to toggle on and off in the maps legend, as there is a performance cost for each one.

Breaking layers into separate layer groups means more control, but comes at a cost of more map tiles to download.

The zero reading is calibrated for main-wheel touchdown in a landing attitude. With the antenna forward of the main gear, it is, at that point, higher than it will be after the nosewheel is lowered to the runway.

So to put some rough numbers to that, in the landing attitude, mains on the ground, the antenna is roughly 8 feet above the runway, but it reads 0 -- a bias of -8 feet is applied to the display as compared to the measured value. With all wheels on the ground, the antenna is about 4 feet above the pavement (about that on the 737, a bit more on the A320 with its taller landing gear). Now, the bias of -8 gives the display value of -4 (i.e. 4' above pavement + -8' bias = -4' displayed).

Addressing issues mentioned in comments: Putting the antenna directly between the main gear would be difficult on a 737 because as the wheels retract inward, there isn't a lot of space between them. I'd suspect that as far as places go to mount an antenna, right there isn't a great one just because of all the dirt & hydraulic fluid & general grime in and around the wheel wells. Somewhat forward, where everything inside the aircraft (i.e. everything except the external structure of the antenna) is sealed off from all dirt & such is probably lots better for the longevity of sensitive electronics.

Also, even mounting an antenna directly in line with the gear wouldn't remove the need for a bias. it's still 4' or so off the ground when the wheels touch and you want a displayed "0". You'd just get rid of the effect that the displayed value goes slightly negative as the nose comes down.

## Values in message structure do not match RFC message structure

I'm trying to understand what is the structure of the messages in IOTA. I used scylla to download some messages and now I don't see that the structure from the message matchs with the current one explained in the RFC 0017.

I'm going to use the following message:

If you scroll down and export the mesage in Hex format we have the following:

Now I will try the identify the elements using the previous RFC:

NetworkID (8 bytes): b77f44715e0b3014 - OK

Parents' length (1 byte) : 04 - OK

Parents (32 bytes x number of parents): - OK

• Payload Length (Should be 5 bytes): Not sure, but if I get 5 bytes I have: 7300000002 . In my opinion this does not seem to be the payload length, especially considering that the 02 seems to be the payload type.
• Payload Type (Should 5 bytes): Here I know that the payload type is 2 because it it an Indexation payload but it does not match with the bytes from the message. If we get 5 bytes: 0000001100 , and I don't know what is this.
• Index (Should be 1 to 64 bytes long): 7777772e696f74612e777466205350414d - OK
• Unexpected value (Bytes size unknown): 58000000 . I don't know what is this.
• Data Fields (Any bytes, as we can see in the hex from the message, we have the index here too): 7777772e696f74612e777466205350414d0a436f756e743a203035333035310a54696d657374616d703a20323032312d30352d32385431363a30303a35382b30323a30300a54697073656c656374696f6e3a203338c2b573 - OK
• Nonce (8 bytes): 937a100000000000 - OK

As you can see, we have some elements that are not described or does not match with the specification in the RFC:

Please, has anyone any experience with this? Probably I'm doing something wrong, but I think my explanation is correct.

## Mdhntd

Why doesn't my simple mesh wall "difference boolean cut" the door away?

Does the first version of Linux developed by Linus Torvalds have a GUI?

Function to extract float from different price patterns

How hard would it be to convert a glider into an powered electric aircraft?

Z80N multiply compared to MC68000

My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?

Did Darth Vader wear the same suit for 20+ years?

How bad would a partial hash leak be, realistically?

Can a user sell my software (MIT license) without modification?

What happens to foam insulation board after you pour concrete slab?

Traffic law UK, pedestrians

Is it possible for people to live in the eye of a permanent hypercane?

Aligning object in a commutative diagram

Implement Homestuck's Catenative Doomsday Dice Cascader

How to make a setting relevant?

Is it a problem that pull requests are approved without any comments

Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut

Does an ice chest packed full of frozen food need ice? 18 day Grand Canyon trip

Word for a small burst of laughter that can't be held back

Completing the square to find if quadratic form is positive definite.

Do manufacturers try make their components as close to ideal ones as possible?

What do we gain with higher order logics?

Transfering attributes from nearest feature using ArcGIS Desktop?

Joining attributes from nearest point in QGIS?Finding three closest points in layer to each polygon in another layer using ArcGIS Desktop?How can you join attributes from polygons to points which are within the polygon feature using PostgreSQL and PostGIS?Transfering attributes from polyline to polygon features using ArcGIS Desktop?Extracting the closest Point to a Line within a Polygon using ArcGIS for DesktopSelecting nearest 300 buildings (polygons/centroids) from list of points using ArcGIS for Desktop?Finding distance to nearest polygon of type A for every point type A using ArcGIS Desktop?Using Spatial Join tool in ArcGIS Desktop?Joining points with nearest polygon using QGISGrouping points with distance using ArcGIS Desktop?