New answers tagged

0

A quick & dirty workaround would be to run the buffer tool with a very small distance parameter (i.e. 0.000001). For me this works fine for most purposes.


0

Introduction. I'm not alone, I have an auto-translator named "Deepl" working with me, who will distort the translation a little bit, and as a result, do not hesitate and clarify unclear points. The main part of the answer. So, my test source data is a file called "poly_town", almost the same as in your picture, i.e. approximately a grid. ...


1

Option 1: Create a text field with the following content: 1:[%round(map_get(item_variables('Karte'),'map_scale'))%] item_variables('Karte') points at the item you want to work with. You need to replace Karte with the name you gave your map item. map_get([...],'map_scale') grabs the scale of the item you're pointing at. In this case you're returned a number. ...


0

Unfortunately I am not good enough with Windows batch files or Power shell scripts but I can show where the OSGeo4W installer is storing that info. It can be found from the temp directory that is used for caching the downloaded packages before installation. The location is by default something like C:\Users\SOME_USER\AppData\Local\Temp\http%3a%2f%2fdownload....


0

Picking up the comments, and referring to your edit: In order to workaround the apparent bug with a proxy View you will make it hold a string column rather than the original array, or the same issues will arise! Use CREATE OR REPLACE VIEW elem_p_v AS SELECT gid, ARRAY_TO_STRING(liste, ',') AS liste, geom FROM elem_p ; ...


-1

There is already a function st_envelope(geometry)


0

I finally managed to filter my legend I'm sharing my code with you. co : layer 1 co_temp : layer 2 co.selectByExpression("SECTION=1") co_temp = processing.run("native:saveselectedfeatures", {'INPUT': co, 'OUTPUT': 'memory:'})['OUTPUT'] co.removeSelection() renderer = co....


0

I figured a way out to do it. The extent of the layer vLayer.extent(). was bigger then the QSize of 10000px by 10000px ratio that was specified, I think that's why it scaled itself to fit in this extent. Putting in a extent = iface.mapCanvas().extent() And further settings.setExtent(extent) Instead of the vLayer.extent() works. Just make sure your mapCanvas ...


0

The warning message said you have invalid geometry. These errors often become part of your data after running geoprocessing, digitizing, editing or data conversion. You have to fix this before running other algorithms. you can make this manually. So you have to detect/locate errors (Vector -> Geometry tools -> check validity) OR you can try to make ...


0

You might want custom CRS that matches your room or a generic room. A custom Oblique Mercator projection, https://proj.org/operations/projections/omerc.html, centered on your origin point and rotated to match your room axes might be what you need. The Oblique Mercator is accurate within 15 degrees (1600km) of your centerline. If you want to geolocate your ...


0

Here is a very simple way of doing this with QGIS 3.14 Vector|Geoprocessing Tools|Union | and select the two layers and and output filename, then OK to calculate. Confirm 'yes' to add the new layer to the TOC. Vector | Geometry Tools | Add Geometry Attributes | and select the unioin layer created in 1st step. Open Attribute layer and see the area column. ...


2

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 -sql "select 'a', ST_ConcaveHull(st_collect(geometry),0.9) from points_layer" A few remarks: You are using a point layer, so if you call st_concave_hull ...


2

Here's some insight: https://issues.qgis.org/issues/21451 But in short, items with the same value need to be assigned the same rank, meaning sometimes you'll get differing numbers in each quantile. Think about it this way. If you have 2 first-place teams there won't be any second-place team. For my own use, I created a processing algorithm for this that adds ...


2

it looks like the behavior you saw should be reproduced every time. I believe the code you found (and linked) is general and used for every type of classification which QGIS makes available in the symbology tab. It is reliant on the calculateBreaks() method which is defined separately for each type of classification. Here is the link to the equal count (...


0

You can do it using the tip that Oulala gave, but in order to have a single minimum convex polygon covering only the outermost points, you just need to let the 'Field' option (in the Minimum Bounding Geometry) empty. I was able to get this result with my points data. I have several species, and if I specify on the 'Field' option that I want a polygon to each ...


5

You can solve it quite simple: Just add a double quotation " to fields having a whitespace in its title: Plot Order --> "Plot Order". Then it recognizes the field correctly and sorts your attribute table correctly.


1

To save a QGIS layer in a format suitable for reading into R, right-click on the polygon layer and choose "Export..." "Save Features as...", or with the Layer selected in the Layers dialog, choose "Layer" "Save As..." from the menu. Change the format to GeoPackage, choose a file name and a layer name (a single ...


1

Landsat has a unique combination of spatial resolution and revisiting for thermal band, so you don't have much other choice during the scan line issue period. With the other Landsat bands, you can fill the gaps by combining successive looks of the satellite, but I would not do it with thermal bands because t could change a lot. Spatial interpolation could be ...


0

I figured it out! The trick is not to use the Points to Path plugin but simply "Add Delimited Text Layer" and then turn on the Labels from the Layers Style menu. This posting proves the first part: QGIS How to draw lines from two points in a CSV?


0

Try this instead convert your sample points to .txt file, that is tab delimited text file. Its a excel sheet where your sample points are in decimal degree. add your txt file as layer and raster file into qgis Rater analysis->sample raster values-> run the analysis by seected input and output layer.


0

An update and an explicit example to complete @jef's answer : uri = QgsDataSourceUri() uri.setConnection("localhost", "5432", "myDatabase", "myUser", "myPassword") uri.setDataSource("mySchema", "myTable", "myGeomField", aKeyColumn="myUniqueIdField") vlayer = iface....


7

The symbology is not saved at the time of export, it is saved as a default symbology afterwards. To do this go to the Layer Properties of the newly created geopackage layer, set the symbology the way you want it, and at the bottom left click Style > Save as Default > Datasource Database. Then the next time you add this geopackage layer to QGIS it will ...


1

Yes, QNEAT3 calculates isochrones based on the underlying input street network. The isochrones are based on shortest paths from the source point to all vertices (nodes) of the graph that can be reached in the defined size value of the iso area (either defined as distance or time (seconds) value). You can lock streets for the routing by applying a definition ...


1

Now with QGIS 3.16.0 version you can create GeospatialPDFs on Mac as stated on QGIS changelog. Related bug report.


0

I would use the topology checker plugin. https://docs.qgis.org/latest/en/docs/user_manual/plugins/core_plugins/plugins_topology_checker.html


0

QGIS (3.16 Hannover) using WCS v1.0.0 Using the mapserver demo (with time) url https://demo.mapserver.org/cgi-bin/wcs?SERVICE=wcs&VERSION=1.0.0&REQUEST=GetCapabilities Time is selectable only via the Data Source Manager ID is 0 to 3 in the list with Name and Title.


4

You can use Move Feature tool that is located at the advanced Digitizing Toolbar. You need to select the points that you want to offset, and then use the Move Feature tool to move all the selected points at once. The following illustration will show you how to do that:


0

I could get the value from a raster using the Field Calculator, and the raster_value function. The description below takes the value from raster 'topo', band 1, at the centroid of the polygon. Open Field Calculator Create a new field with a suitable type (or update an existing field) Use the expression: raster_value('topo', 1, centroid($geometry))


8

If you know the exact offset, you can use "Affine Transform" or "Translate" from processing toolbox:


0

Assuming you only want to use QGIS you could create a virtual field for both layers and use it for the join. Simply select the table -> Open Field Calculator -> Create a new virtual field of unlimited text. You can combine the fields you want to use into this "join_field" with a simple: "District"+'_'+"village" Performing ...


5

Extending on @Kazuhito preparation step, you can achieve such sort directly. Open the attribute table, right click on a field column name, choose sort Then enter the following code, replacing the column name by your own. Change the 10 with the max number of digits / letters. Basically, this code extracts the number, adds 0s before so every number is exactly ...


2

The NDMI was designed to be used with wavelengths 820nm (NIR) and 1600nm (SWIR). Band 8 has a central Wavelength of 832.9nm and band 8A has 864.0nm (https://sentinel.esa.int/web/sentinel/missions/sentinel-2/instrument-payload/resolution-and-swath). Therefore, band number 8 looks like the most adequate. The Index DataBase supports this choice as well: https://...


3

Using the "select by expression" tool with the following expression regexp_match("Category",'ature') > 0 will select all features where the string "ature" is found in the column "Category". I omitted the n because I actually don't know whether regexp is case-sensitive. Replace "Category" with the actual ...


2

You can use first the processing tools "join attributes by location" and next "Dissolve" to remove duplicates. Yours polygons need to have a unique id attribute.


4

Temporal controller is available from version 3.14 onwards, 3.10 does not have it. Please use TimeManager Plugin instead: https://plugins.qgis.org/plugins/timemanager/


2

The QGIS raster import for netcdf uses the GDAL drivers which assume the data follows the CF conventions, and the multidimensional arrays within the data in (...Y,X) order per this: Dimension The NetCDF driver assume that data follows the CF-1 convention from UNIDATA The dimensions inside the NetCDF file use the following rules: (Z,Y,X). If there are more ...


3

Using the new virtual layer with the SQL script in the form window add 2 layers and run the SQL script: SELECT DISTINCT (a.geometry) geom FROM buffer a JOIN tree_pts b ON ST_Intersects(a.geometry, b.geometry) WHERE b.tree_type='pear' OR b.tree_type='apple' OR b.tree_type='orange' Save the result as a new file using <Export>-<Save objects as... >


7

you could try creating a new decimal column in field calculator with a precision of 2 and use the following if statement in the expression window: if (upper("yourTextField")= lower("yourTextField"),"yourTextField", regexp_substr("yourTextField",'(\\d+)')+(strpos( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', upper(right("...


6

I recommend Sort and Number plugin, which can take multiple fields as sorting criteria. (1) Preparation To allow the plugin to recognize the number part and the character part of your textcolumn, create two separate columns by expressions in the Field Calculator. num_part (integer): regexp_substr("textcolumn", '(\\d+)') char_part (text): ...


1

Hi CVbuzon this seems to work using the python window on QGIS 3.10: layer = iface.activeLayer() fields = layer.fields() idx = fields.indexFromName('yourfield') layer.setFieldConstraint(idx, QgsFieldConstraints.ConstraintNotNull) Hope it helps!


0

In QGIS 3.14, you can use the Layer/Properties/Temporal to set the temporal extents of your data, Project/Properties/Temporal to control the temporal extent of your project, and use the Temporal Controller (View/Panels/Temporal Controller temporally control the visibility of the layers:


1

Also look into the QGIS Temporal Controller, a built-in version of the Time manager plugin. If you have time-aware layers you can make the symbology and layers represent it. (This example is points, not polygons, from a file repeating common IDs but different timestamps. It is possible to have a virtual layer that joins spatial and temporally varying data, ...


0

Using the command gdal_translate –of ENVI –ot UInt16 –scale –outsize 1025 1025 ca_heightmap.tif heightmap.raw I was able to get the correct format for Unity


0

Eventually I found what works. Just no need to convert a value to string, and Output field type should be Decimal number (real): from qgis.core import * from qgis.gui import * @qgsfunction(args='auto', group='Custom') def fd_sci(value1, feature, parent): a = "{:.2e}".format(value1) return a


2

You can use html for the name of the QGIS column. <span style="color:red"> column </span> Result within qgis2web leaflet: EDIT: Only for leaflet I have success with this method. Maybe you can use leaflet for your project. I like leaflet.


1

The "Cannot do natural order without a primary key, please add it or specify a manual sort over existing attributes" exception may arise for a layer made of an SQL view. In this case, it can be fixed by going to the "edit the SQL view" page and checking one (or several ?) of the rows of the table as "Identifier". Note that the ...


6

The Multiply blend mode can only darken a layer, not brighten it, so you could only use it for adding shadows from a hillshade layer to a base map, but not the highlights. I would use the "Overlay" blend mode for this, rather than "Multiply". With Overlay, areas where the top layer is brighter than the bottom layer are brightened, and ...


0

One dirty workaround would be to: Try to delete the file If it doesn't work, add it to a list of files to delete later try: os.remove(filename_to_delete) except PermissionError as e: with open('files_to_delete.txt', 'a') as list_file: # Append to the list list_file.write(filename_to_delete + '\n') At the next opportunity (click of ...


4

You might have some luck playing with the feature rendering order, ordering by is_selected() (though it is not always straightforward...) Alternatively, since the selection is only a color - and not a full style - is to change the size of the selected feature. It works well if all features have the same width. Click the epsilon icon beside the width, select ...


-1

Is there a way to somehow recreate the exact same hexes as H3 in QGIS? I have data from an external source that gives the coordinates for the H3 and the associated data, but I can't really bring it into QGIS. I can bring in the centerpoints and join them to a hex grid, but I also can't really figure out the exact grid sizes or projection


Top 50 recent answers are included