Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

1

Use the Buffer tool to make a 5 m buffer around layer B. Use the Difference tool to subtract the buffer layer from layer A.


0

eventually this worked for me: dataset = rasterio.open(input_file_path, 'r') bands = [1, 2, 3] data = dataset.read(bands) transform = rasterio.transform.from_bounds(west, south, east, north, data.shape[1], data.shape[2]) crs = {'init': 'epsg:3006'} with rasterio.open(output_file_path, 'w', driver='GTiff', width=data.shape[1], height=data....


0

There's not really a good way of copying labels from a PDF of a map into QGIS. Here's how the process will work if you try it: Add the PDF to QGIS. Use the georeferencer tool to georeference it. Here's a tutorial. Create a new point vector layer. Add a new text field to the attribute table. Make sure the new field is long enough to hold the longest possible ...


0

you can do it with virtual layer and sql. Assuming that your layer has an id called "id". you can do following query select a.* from your_layer as a, your_layer as b where st_intersects(a.geometry, b.geometry) and a.id <> b.id or you can just use 'topology checker'. If you do not see it, just activate it in the plugins


0

I think self-intersections here only refers to intersections within features (with "edge overlappings" if i may say so ...) not between features ... There's a nice tool in SAGA toolbox called Polygon self intersections (... that should be its right name ...) which is doing exactly what u seem to be expecting ....


0

I had this same problem. I solved my problem by writing a utility in C. It expects a KML with all your path segments in proper order and only segments to be merged. It will flip segments as required for a best fit, producing a KML with the combined path. It can be found on Github at the URL below. https://github.com/mgemeny/KMLpathMerge I hope this helps,...


0

You need to set the attributes in one go. Can you try: for some_ft in some_fts: attrs = some_ft.attributes() new_feature = QgsFeature(fields) new_feature.setAttributes(attrs) attrs.append('some text') new_feature.setAttributes(attrs)


0

Check out gdalwarp that is part of the GDAL library. There are Python bindings available through the osgeo package. This is untested, but it should get you close to what you need: from osgeo import gdal gdal.Warp( dstDS, srcDS, format='GTiff', dstSRS='EPSG:3006', outputBounds=[minX, minY, maxX, maxY] ) You'll need to define the source and ...


1

The first issue is you have turned conflict resolution off so that GeoServer thinks that it is fine to allow the labels to be stacked on top of each other. So I would remove <se:VendorOption name="conflictResolution">false</se:VendorOption> from the SLD file. In general it is best to allow the labelling engine control conflicts as it works hard ...


2

I do not know the plugin or its code, but this part of the command attracts attention: --minz=0.0 --maxz=0.0 It is probably not the expected behavior, but the algorithm seems to be filtering the input points to interpolate only among those that have a height equal to zero. Try to establish specific values, within the range of heights of your ...


5

It's now part of the buffer tool. You can now enter a buffer value in the distance text box or you could click on the button on the right of the distance text box to set a variable distance buffer( by selecting a numerical field or with an expression)


5

Using QGIS 3.6 (but probably any version since 2), the easiest way is to use the Graduated renderer with your "Y(color)" field then using the "X(size)" field on the data defined properties for line width. The only problem with this is that the legend wont show the size variation (legend cant reflect defined properties) so you will have to create the legend ...


1

Use the split with lines tool to split the transects lines wherever they cross each other. Use the transects layer as input for the input layer and the split layer. The output will be a temporary layer called "Split." Use the select by location tool to select all features in the Split layer that intersect the original line. Save the selected features ...


1

Steps 1 through 5 of that guide are about creating a time-stamped route. You already have time-stamped data, so those steps are not appropriate for your situation. Add your CSV into QGIS as a delimited text layer. Proceed from Step 6: Fix Symbology.


1

This is the classic "new to GIS" problem. It happens to everyone, and it may or may not be because of something you did. Sometimes GIS data just doesn't come with the correct projection data encoded in it. You're doing well so far. Don't panic. Good job using a base map to figure out which layers are correctly located. You've narrowed the problem down ...


0

For the point layer that was crashing in QField, in the QGIS desktop project I had checked "Show Feature Count" in the layer menu. When I unchecked that box in QGIS desktop (to stop showing the feature count), that fixed the issue in QField (after saving and repackaging it, of course). To go further, I also had rule-based symbology based on a feature's ...


0

CRS/projection issues can be tricky working with QGIS. Important: check: 1.) which CRS does the QGIS project have? 2.) which CRS do raster file and point layer have? do they match? Check for their EPSG codes. It could be that one of your layer is in a projected CRS (like your Monte Mario Italy) and another layer is in WGS84 for example.


0

You could do this in a different way by sorting the layer before using the composer. So: Sort your layer with MMQGIS (plugin) by "ORDER" --> ascending. Show this new table in composer and remove the field. Here so screen shots: Here is the data: Sort: Check the differences: Plot the sorted table without that field:


1

Use an attribute field or expression to define your stroke width: As your numbers are likely going to be too large to be used as a width, under the Expression submenu, select Edit to create a new expression. You can use the field that has your count value and multiply it by say 0.1, for example, to bring it down to a more realistic number that can be used ...


2

They all have short explanations when you click on them in the Expression String Builder. For IN:


0

I understand it this way: Overlap - Tests whether a geometry overlaps another. Returns 1 (true) if the geometries share space, are of the same dimension, but are not completely contained by each other. Only circle 2 is selected. Share space in this case is meant for polygon. Overlapping polygons share some spce/area so it is used for extracting/...


2

You can achieve this using a virtual layer. It would identify the 1st and last point for each category, then intersects these points with the polygons. It further ensure the polygons have the desired set of property (red, blue in your question) and at last that the 2 polygons do not have the same property. This last step is important should you have more ...


0

I will suggest first save that raster file with checked "as rendered" options, (at top of export window) . And clip that saved tiff.


4

It sounds like you still have it identified. Choose the identify tool and click somewhere else, the red outline should disappear. Edit based on comments: With the picture now, it looks like an unfinished polygon. So when you are editing, and start creating a polygon and never right click to finish it. It is saved until you return to editing that layer. ...


8

You can use the tbl_metadata file as coverage layer in Atlas. Then use rule-based symbology with @layer_name = @atlas_pagename. I assume that your data looks like this (the attribute table is tbl_metadata table): Set the tbl_metadata as Coverage layer and select the field with dataset name as Page name. If you want to hide the coverage layer geometry, ...


7

I suggest to use a virtual layer. If the SQL in virtual layers would give the same result than SQL that is fired directly against databases then the following should work select a.field_1,a.field_2,a.field_3 from (select field_1,field_2,field_3,"ORDER" ORDER BY "ORDER") as a; The result seems to work correctly in the print composer with QGIS 3.8.3. I ...


2

Yes, you can do object-based pattern recognition with the Orfeo Toolbox (OTB) plugin in QGIS. It's not a native plugin to QGIS, so you will have to download it (here) and then follow the installation instructions. Besides segmentation, there are a lot of other powerful tools within OTB that you can use, such as their machine learning algorithms for image ...


0

When saving rasters, I've never paid attention to the Rendered image option in Output mode, so I can't speak to it. However, here's my go-to workflow for saving rasters where I want to preserve symbology: In the source raster, set the symbology to your liking. Then double-click the raster in the Table of Contents, which opens the Layer Properties window. ...


0

You lost your symbology because qgis save it as RGB values where they are set accordingly to your symbology in the Layer. And no other way is possible. You can save as RAW data, and you will have values that you want, but need some software to style it, or save it as rendered image, where is its only image with color depends on your symbology.


2

At v3.8 anyway, this seems like a bug. Both in the attribute dialog and the attribute table itself, attempting to enter a negative integer yields a NULL value when focus is moved off the value. Using the field calculator allows the entry of negative integers.


2

The filter query allows you to specify an SQL where clause. If you enter id=1 it will translate it to select * from mylayer where id=1. From there, you can add a sub-query in this where clause to identify the IDs (or else) of interest: field_a IN (SELECT MAX(field_a) FROM myLayer GROUP BY field_b)


0

If this is for visualization purpose, I suggest Rule-based symbology. "field_a" = maximum("field_a", group_by:= "field_b" ) [EDIT] To actually reduce the features by the expression, try Extract by expression tool (in Processing toolbox > Vector selection). The expression is the same as the above.


3

Compute contour lines from your elevation raster Intersect your road layer with the contour lines using the line intersection tool.


2

There are two points here: 1. File format The original files are space-separated text files (i.e. similar to csv, but with a space instead of a comma acting as a separator). The example you mention (391821.292854,5821122.049075) is a plain CSV instead. 2. Projection These files seem to be UTM, and since proper metadata are missing, I would infer the ...


1

You can achieve this by setting up an data-defined visibility depending on the is_selected function. The end user will click on a non-profit point using the Select Features tool. All of the symbology that you set up will appear for that feature. Say you have a second layer with "zone of impact" polygons. This layer should have a shared attribute with the ...


2

You have different possibilities to achieve this. Two of them are: Using expressions: Create a new field with field calculator and use sum() function with group_by statement like this: sum("Laenge_m", group_by:="Rohr_1") Using virtual layers: Create a virtual layer with a query like this: select sum("Laenge_m") from yourlayername where Rohr_1 is '...


1

Dissolve your layer with the attribute Rohr_1. You will get a new layer where each Rohr_1 entry is summarized. In your case all features where Rohr_1 is SNRVe 7x12x2 are comined in one row. Make sure you use a metric coordinate reference system like UTM. This is important for the computation of the length. Create a new field and compute the length using ...


2

It sounds like you have Scale Dependent Visibility set on your raster layer. Have a look under the Rendering tab of the Layer Properties dialog of your raster layer and make sure that the check box for Scale Dependent Visibility is unchecked.


1

The WMTS server is providing you with a picture of your data, most likely as a png or jpeg file. So, it is unlikely that there are 3 bands or that the values are stored as unsigned ints. There is no point in looking at the pixel values as they will have been modified by the rendering and compression process. If you want to examine the values of remote ...


2

You might want to look into layer-properties --> actions, create default to see what options there is.


0

You need to assign band designations based on the information provided by the sensor manufacturer. For example, if you are using landsat data, you can find them here: https://www.usgs.gov/faqs/what-are-band-designations-landsat-satellites?qt-news_science_products=0#qt-news_science_products. Set your bands as A, B, C, D, etc.., taking note of which is ...


0

Try to use the second variation of Minimum Spanning Tree plugin on Qgis if you have edges as shapefile NOT: you should read the description of the update


0

The ISOK layer links has changed since 15th October: Istotne zmiany w danych i usługach związanych z Numerycznym Modelem Terenu For GetCapabilities request you can try this link: http://mapy.geoportal.gov.pl/wss/service/PZGIK/NMT/GRID1/WMTS/ShadedRelief?SERVICE=WMTS&REQUEST=GetCapabilities I don't use QGIS, I've tested this link only in a web browser ...


0

With the help of the answers in this post I wrote a Qgis python plugin to accomplish my needs. I use it for processing CCTV data from sanitary sewer work. The plugin accepts the following CSV file Pipe ID,Location,Start Manhole,End Manhole,total_pipe_length,Surveyed Length,Pipe Diameter,Pipe Material,Direction,Distance,Code,Description,Clock,Lateral Size,...


1

You can do it but not with just one tool. You can create a model with the following process: Merge vector layers. Use the plugin: 'Dissolve with stats' and make sum. This will join all the value and, in this case, if you have a value of 2 means that the species is within both polygons. Notice that this 'Dissolve with stats' tool can't make sum with null ...


2

It's quite simple. In the modeler there must be a vector input, a Fields Mapper and a refactor field at least. The refactor field will receive both files. Set the Fields Mapper on Fields mapping box. When you run, you can set the output file columns as you like, similar to MrXsquared's response, but the fields are not fixed, they can be redefined on each ...


3

Not a QGIS solution, but very quick using ogr2ogr with the commandline: ogr2ogr -f "ESRI Shapefile" output_folder input.gpkg


2

QGIS native:multiparttosingleparts works as a charm to break it down. Then the rest is part of a tailor made pipeline to one's needs. (credit to @Erik comment)


1

The Split selected features with selected line from another layer has been removed since the 1.4.0 Version of the digitizing tools plugin (github page of the plugin) They suggest to use the processing's in-place editing Split with lines instead.


3

Hi sorry I can't comment, but the method "bridge.customLayerOrder()" doesn't exist in QGis 3.x I've found maybe a substitute command: bridge = iface.layerTreeCanvasBridge() bridge.rootGroup().customLayerOrder() From https://qgis.org/api/classQgsLayerTree.html#aab7a55f2e61f0ff1dbea6ceb89e8b366: The order in which layers will be rendered on the canvas. ...


Top 50 recent answers are included