Is there a function to select and show certain features only in print composer? - qgis

I have a feature layer with points. I have three pages in my print composer. On one of my pages, I only want to show points that fall within a certain value range. First, I tried locking the style on the pages where I want to display all my points.
Then, I went to the Query Builder of the layer I want to select points from, and I created an expression to display only points from a range:
The problem is that this selection modifies the points shown on all my pages in print composer, even the ones where I locked the layers and style for layers. The only alternative solution I can think of is to select the points I want to show, create a new feature layer with those selected points, and then show that feature layer on my page in print composer. However I'd like to know if there's another way to do this without creating a new feature layer each time I want to filter the points I show in print composer.

There's another way. The points change because when you define a query, basically you define what features will be loaded to the project. So if you use categorized symbology you can define that some feature will be not displayed, but they will stay loaded in the project.
Here you can find how to use this type of symbology: Classifying Nominal Data

Related

Calculate areas of new features in merged layer in QGIS

I have merged four different layers into one new one in QGIS, but I want this layer to have different information then the old layers. I want all the buffered 'islands' to have a different ID and a calculated area. However, now in the attribute table I just see four features, one for each layer that I merged. Is there a way to update the attribute table to consist of new features (one for each 'island')?
This is what the layer looks like:
And this is what the attribute table now looks like:
And this is what I want (the 5th and 6th column especially):
You must create a feature for each monopart geometry, you can achieve this using the 25.1.18.46. Multipart to singleparts tool, and then use the field calculator to get the area, you can find here how to calculate area Calculating polygon areas in shapefile using QGIS.

How can I filter over a bar graph data while showing the average of the entire data set?

I am making an interactive dashboard in Tableau that looks something like this:
https://public.tableau.com/app/profile/monica.ionescu/viz/ExploringHIVStatisticsinSouthAmerica/Dashboard1?publish=yes
(for your best viewing experience, please view the dashboard in the fullscreen view - button on bottom right corner of the board)
I need some help with the bar chart.
I currently have a reference line in place to mark the two averages so that they don’t move as I filter through data. When using the average line feature, the filters on the left change all the graphs on the dashboard in real-time (and thus the average with it). So, it seems like the average line is built from the data points currently on display rather than all the data points in our data set.
I want to show the averages on the bar graph as they are in the image (a constant for the whole data set) without having to manually set the average each time I add/update the data.
How do I make it so that when I change the filters, the bar graph changes but the average stays constant?
Thank you so much!
You can self-blend the data sources - duplicate the data source, but DON'T join any fields/set up relationships. The lack of join can make the secondary source act as a constant.
Alternatively create a FIXED calculation to calculate the average. This should also act as a constant - just make sure none of your filters are in context.

Is there an option to remove duplicate point labels within a distance in Mapbox Studio?

I'm using Mapbox Studio to label some point features (from a GeoJSON layer I uploaded) in a style, and there are some duplicate points located nearby each other:
Are there any options in Mapbox Studio to remove the duplicate labels automatically? For example, some other mapping programs have the option to remove duplicate labels within a specified distance (pixels or map units). Is this available in Mapbox Studio (or failing that, in Mapbox-GL-JS)?
Mapbox Studio does not provide a way to remove the duplicate labels automatically. You could work with a filter to manually filter out duplicates by writing a relatively complex expression, although this is not really the intended use case of expressions. You could also add a duplicate: true property to duplicated point features in your source data, but since this would require manipulating your source data, you might as well remove the duplicates from the source data instead of taking this approach.
That being said, you could consider clustering your data and styling the clusters so that a cluster looks the same as any individual point. This example shows how to create and style clusters using Mapbox GL JS. Here is a JSFiddle that heavily modifies this example to cluster closely-located points, and style the clusters in the same way that individual points are styled: https://jsfiddle.net/uo216fxz/ (you will need to add your own Mapbox access token in order to view the result). Text labels are added with the point count for each cluster containing more than one point, so that you can easily see that clusters and single points are identical aside from the labeling.
You will likely need to customize several properties (such as clusterRadius, clusterMaxZoom, etc) beyond what is provided in the linked JSFiddle, to be more specific to your source data.

Leaflet.js display of a non-geo map (gdal2tiles.py) – I need a concrete example

I'm displaying a map that's been tiled (-p raster) using gdal2tiles.py. The X-coordinate is about [0..-1160]. The Y-coordinate, for some reason, is [-700,0]. Zoom-levels 0-5.
I simply cannot get a plausible display to work. Sometimes, if I zoom-out to level-zero, I see the map way down at the bottom of the display ... not centered. Nothing at all appears at other levels.
I am also seeing the display "bounce back and forth" between about a 3-o'clock and a 6-o'clock position. (Only, once again, at zoom-level zero.)
I am at my wit's end. Please give guidance. Complete examples. Anything ...
Well, I found my answer:
If you're going to be using several layers in your Leaflet map, add them in the constructor-call, using the layers parameter.
If you try to do things with the layers before joining them all together, or with the map with no layers added, "strange and default things will happen." (For example, although I requested the Simple CRS when constructing things (separately...), the net-effect was to actually try to use a different one. Therefore, "do what the author expected." Specify all the layers at once, to the Map constructor. Then, customize them as you need to. Make very sure that they all know about each other from the very start of things.

Interactive bar chart.user changes y axis value at runtime by dragging it

For example 3 columns are there with y axis value as 100,200,300 in barcharts.
User select one column alone and drag it to 500 value in y-axis.
How to achieve this?
Is it available in library like androidplot or aChartPlugin?
If not which plugin support this requirement.Our project is for Android tablets
Please provide me sample code for this requirement.Thanks in advance.
To my knowledge no library exists for Android that provides 'out of the box' capabilities to drag and reorganize data. Having said that, any library that provides you with a way to correlate touch events to data elements and also supports dynamic updates should be suitable.
If you have specific requirements about how the "drag" is implemented then you may end up having to roll your own library or customize an existing one to your needs. If not, here's a basic workflow you could implement with Androidplot that represents the drag operation as a cursor:
1 - Detect selections using an OnTouchListener. Here's an example of a bar plot that allows bar selection via touch. Gives a full example of converting screen coords to model elements etc. Create and add an instance of XValueMarker denoting the current position of the selection. (An XValueMarker is basically a customizable vertical line marking an x-val.
2 - Detect "drag" events using an OnTouchListener. Here's an example that detects zooming and scrolling. It's not the same thing exactly but the scrolling logic is close enough to give you the general idea.
3 - As the user drags, update the position of the XValueMarker by XValueMarker.setValue(Number).
4 - Once the "drag" ends, remove the XValueMarker and modify the underlying XYSeries to reflect the change using basic data structure manipulation(s).
And of course remember to always call plot.redraw() after each operation that is expected to alter the appearance of the plot in some way.