Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

Given the clarification that this concerns lines, here is one possible solution based on the Field calculator and Show statistical summary-tools, which finds the average length of the selected lines without having to save them as a separate layer. Before doing your selection, open the attribute table of the line layer. Toggle editing mode on the left hand ...


0

There wouldn't be a specific tool, but a work flow you could follow to do this. I have done something similar in ArcMap, and can describe the concept. Firstly decide what the fixed elevation is of your dam. Then you can convert your rectangular polygon to a raster file (matching parameters such as cell size with your DEM). There should be a tool for this. ...


1

Duplicating a layer is not the same as making a copy of the source data. Duplicating a layer When you duplicate a layer, QGIS creates a second link to the same source file. Any edits you make to the duplicate layer are made to the source file. Any layers that link to that same source file will also have those changes. To duplicate a layer, right click on ...


1

This sort of situation lends itself to a raster solution, then you can convert back to polygon. Conceptually, you are really buffering and then assigning the buffered area the nearest polygon value. So, breaking it down into steps: 1) perform a 100m buffer of all your polygons which will be used as a mask layer. 2) assign a numerical value to your polygon ...


2

"Data defined override" is more of a caption than anything else. You either have to choose a field you want to derive your symbology size from or enter an expression.


0

A way to approach this issue is the following: Use QGIS'Create Grid tool (Vector ->Research tools) to create a vector file representing the grid of your coarse resolution DEM (in Grid type select rectangular and in Grid extend select the DEM). Use the zonal statistics tool to calculate the mean elevation for each polygon of your grid (use as raster input ...


0

You can try a grayscale morphological dilation. To see how it works, you can check the corresponding wikipedia page which includes a nice example. If you want to try this image processing operation, you can use python and in particular scipy's grey_dilation function.


0

Your question is not quite clear. If you want to mask out values of a DEM that are above or below the minimum and maximum of a vector, using GRASS here's what you can do: Assuming you have a vector of points "point_elevations" with column "elev", and your DEM raster is called "dem". You can find the minimum and maximum with: v.univar point_elevations ...


1

A super simple solution: buffer your points by your desired distance, with a dissolve. Then, inward buffer by that same distance (use a negative distance value). Since the initial buffers were dissolved, the area between points will not be removed by inward buffering and will create those polygons for you.


0

If the orange area is stored in a layer you can use the union tool to generate an output with the coverage area of both the green and the orange layers. See http://wiki.gis.com/wiki/index.php/Union for a full explanation of the tool.


0

Here is a solution but only if you have the original LAS file, so it works for me. But I'll be happy to know if there is other way to proceed if you have the multipoint shape. https://groups.google.com/forum/#!topic/lastools/JBHef3TANI4


0

Write your code in a proper Python IDE like WingIDE, Komodo, or even IDLE. These applications have a rich set of settings and color-coded text to help you keep track of code as well as warning you of indentation errors while typing. Then cut and paste into the QGIS Python window for execution.


0

If you need to add a new column in your layer from Postgis, use this: layer = iface.activeLayer() name_column = "new_column" layer.dataProvider().addAttributes([QgsField(name_column, QVariant.String, "VARCHAR")]) layer.updateFields()


1

Further testing: The pixelation is replicable - it is caused when there is a non-zero rotation applied to the SVG label background, or to the label as a whole via Placement. However, on export to PDF the background symbol is sharp. The resizing behaviour is not replicable. I made a new label from scratch using the same settings and SVG, and it works as ...


4

Here's one way to find a similar CRS to the one used for an existing map. Since your map has lat/long lines, you can make a GIS project with the same lines into different CRS's until you find one where the lines are curved and angled the same as in the image. Create lat/long lines: Use the grid tool to make a lat/long grid for this area (longitudes 23 E ...


1

I'm not sure what's going wrong with your SVG symbol, but it's pretty simple to re-create a similar symbol using simple marker symbol levels. With simple markers, you can control the symbol size and stroke width using millimeters, points, pixels, meters at scale, map units, or inches. Add three symbol levels: Simple marker - line, 45 degree rotation. Shown ...


0

In QGIS 3.2.3, it's possible, without using GDAL. When generating the contours, just check the "Produce 3D Vector" in the "Advanced Parameters". After that, just export the layer with "Save As". The option "Include Z dimension" will be checked already.


1

You can use pandas and geopandas libraries. Install these in your existing qgis python environment or install conda (and then conda install geopandas). import geopandas as gpd import pandas as pd from shapely.geometry import Point import os csvfile = '/home/bera/Downloads/Gridded_AgroMet_Data_Europe_ver2_0_sample2.csv' out_shapefile_folder = '/home/bera/...


2

I don't believe qgis is able to process Google Earth cache file. I advice you not to wast your time. Instead use SAS Planet alternative. It stores tiles locally as file:///F:/Tiles/Topo/{z}/{x}/{y}.png Then you may use TileLayer or MBTiles plugin. I hope that helps.


0

Tested on QGIS 2.18 and QGIS 3.4 Additionally, I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... Let's assume we have the following layer "some_points" with its attribute table, see image below. With the following query, it is possible to create a "new" shapefile with requested attributes, i.e. "X" and "Y" ...


1

You open the .csv file ("add delimited text layer" - CRS : WGS 84 - X and Y being the longitude and latitude attributes). You can save it as a shape file or any format if necessary. In the Processing Toolbox you choose "split vector layer", as "unique ID Field" you choose "DAY" and the toolbox generates the awaited files ... You're done ... Being a ...


0

The procedure below assumes that each line has some unique attribute that corresponds to a certain building. Convert lines to points using Extract vertices Convert Points to Polygons using Veroni Polygons Dissolve Polygons


6

An XYZ tile service provides tiles based on a URL template with values substituted in for Zoom Level and X and Y counts of the tile. They are (usually) limited to a fixed projection (usually EPSG:3857). A WMS provides an image of the map using a set of key value pairs (KVP) to specify which layers, styles, projection and size to use. It is possible to ...


1

GDAL, when compiled with SpatiaLite, can use all the SpatiaLite functions http://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html including ST_SquareGrid ST_SquareGrid return a grid of square cells (having the edge length of size) precisely covering the input Geometry. The returned Geometry will usually be of the MultiPolygon type (a collection ...


-1

TMS - images generated ones time stored in directories with Z-level WMS - images generated "on the fly" from data base in vector format.


0

This code: for i in it: i.geometry().buffer(250,5) computes the buffer and then does nothing with it. To store that you need to create a new polygon layer and save the buffer polygon to it as a new feature. Find a tutorial on adding new features to layers in QGIS Python and that should get you going.


0

For this purpose, you should try choropleth heat-map. You can do this easily. Just go to style from properties of your layer and change the single symbol to graduated and then you can pick your weighted column and create your heat-map. You can try different methods like natural breaks for your classification method. Click apply and Done!


0

If you have not upgraded to QGIS 3.8, you can use the NNJoin Plugin (https://plugins.qgis.org/plugins/NNJoin/ http://arken.nmbu.no/~havatv/gis/qgisplugins/NNJoin/). It is available through the official QGIS plugin repo.


1

If these are all line features, then: Merge with the doors. Dissolve all lines. Convert lines to polygons. Dissolve all polygons. If there are any lines not actually touching, thus the won't create a closed polygon, you can first buffer all the line features by said tolerance, a few mm, and then: Convert buffer result to line, Steps 1-4 above. Negative ...


3

Yes, with the plugin Change datasource, it's the easiest way to change the path of a layer in QGIS. Copy the layer file (or multiples files in the case of a shapefile) into the new directory and then open your project and change the source with the plugin.


2

The reason why your selections are being overwritten on each iteration is because you passed QgsVectorLayer.SetSelection for the SelectBehaviour parameter. This sets a new selection each time, removing any existing selection. Changing your SelectBehaviour argument to QgsVectorLayer.AddToSelection should do the trick.


1

From the command line, execute this command inside the directory of GeoTIFF rasters you wish to stack (like a sandwich) together: gdal_merge.py -o your_depth_stack.tif -ps x y -separate *.tif This will stack all images inside the directory. If you only wish to stack a certain subset replace *.tif with the desired images: image1.tif image2.tif image3.tif ...


3

If you only have one building, the fastest and most accurate method is to manually draw a polygon, using snapping. The outline of that building will only have about 21 vertices, so it really won't take very long to digitize. Turn on snapping to vertices on the snapping toolbar. Set a fairly small snapping radius, such as 5 pixels. Create a new polygon layer,...


0

QGIS can't edit a CSV, so your first step is to export your data to an editable format, such as geopackage or shapefile. Right click on the name of the layer in the Layer Panel > Export > Save Features As... Next, use the snap geometries to layer tool. This tool can be found in the Processing Toolbox. For the reference layer, use whichever layer you think ...


0

As a workaround, create a separate grid for each scale range in your atlas. Make the visibility of each grid dependent on the scale level of the main map. Make a new map item with no map content (turn off all the map layers, refresh the map item so that it's blank, and lock the layers for this map). We'll call this map item the grid map. Give the grid map ...


3

A workaround below : Duplicate the "world" layer. Layer Menu > Duplicate layer (or right-click on the layer) Go to the duplicated layer properties. Layer Menu > Layer properties (or right-click on the layer, and by default, double-click on the layer) In the symbology tab, as symbol type, choose Geometry generator (doc link) Leave the Polygon / Multi-polygon ...


1

I think it is because you use WMS layer which can be served like a tiled image - not "real" DTM. Why not to use SRTM or EU-DEM? SRTM http://dwtkns.com/srtm30m/ EU-DEM https://www.eea.europa.eu/data-and-maps/data/copernicus-land-monitoring-service-eu-dem This is an example of using EU-DEM data. I cropped some part using a polygon layer in SAGA-GIS and then ...


3

You may use some of the processing toolbox tool to add the coordinate (try SAGA>Vector point>tools>Add coordinate to point or Vector geometry>Add geometry attributes) or manually add a Latitude and Longitude field to the attribute table and calculate the value (use $x and $y as formula). This will give you shapefile with an attribute table including the Lat ...


1

I believe the reason you cannot access the values from this DTM is because it is being served as a WMS, which QGIS is unable to obtain data from. Sometimes some WMS work as WFS if this one does, the second answer here might be of help.


7

The easiest way to add attributes containing the coordinates is using the add geometric properties-tool (vector -> geometry-tools). This adds the coordinates of the geometry using the CRS of the layer - but only if you have a point layer. For polygons the tool adds circumfence and area, for lines only the length. You also may use the field calculator in ...


1

In QGIS3 a Network analysis toolbox was added: You can create isochrones based on your network offline by choosing "Fastest" path type to calculate: There are a little less settings than in QNEAT3, but no plugin is needed.


3

The plugin QNEAT3 offers a great tool for this creating isochrones or service areas offline based on your own network. You can run Iso-Areas as polygons or another algorithm: To get isochrones, choose "Fastest path" instead of "shortest":


1

Null values are simply 'absent'. Meaning you can't find the average of 2 + 2 + absent value. It won't be counted as 0 even though we might want it to. There might be more elegant workarounds, but you can bring everything into excel via CSV to do your calculations (in the case you have many NULL values) or you can select only the features with a null value ...


-1

I think you can try this soft: https://extensions.sketchup.com/pl/content/point-cloud-importers


1

One approach is to resample your second raster (elevation correction) to fit the size of your DEM. Of course, as you are going from a bigger pixel size to a smaller one, you will have repeated values for each original pixel (see picture below). Image taken from Chris Garrard's Geoprocessing with Python On ArcGIS, you can use the Resample tool and use your ...


1

The problem, as you observed, is that the Rasterize program sets the values outside of the polygons to NODATA (or dummy), and the raster calculator outputs a dummy wherever either raster has a dummy. In QGIS 3.6.3 I've solved this problem by specifying the output carefully in the Rasterize program to give everything outside of the polygons a value of zero. ...


2

There's an issue with the Geometry Generator for polyline items in the print composer. If you try to place a point on a polyline print composer item using a geometry generator (geometry type: point) and the function line_interpolate_point($geometry,distance), it's not clear what units the distance value is. I tried it with a very wide range of values, from 0....


0

If you created the grid using the Grid tool from the processing toolbox, it has the X and Y values of the grid stored as attributes: left top right bottom Use these attributes to create the corner coordinates. Use the corner coordinates in a Geometry Generated style to create triangular geometries. Each grid square has corner coordinates like this: Use ...


0

How to identify points that fall on the the same line: Add a unique ID to the line layer. Use the Field Calculator to add a new numerical field, with the expression @row_number. Do a spatial join between the point layer and the line layer. Now all the points that fall on line share an attribute. Use the shared attribute to identify which points are ...


1

QGIS (as of version 3.8.0) has no support for binary/bytea fields from Postgres sources. As of version 3.8, they are only supported for disk-based vector layers and in-memory scratch layers.


Top 50 recent answers are included