New answers tagged

2

On the layer that is on top, add a new symbol layer of type Geometry generator (see documentation) / Point. Use this expression to generate the point from the other layer that is closest to the current feature: overlay_nearest('other_layer', $geometry)[0] Set the same settings for size. To avoid the larger points from this symbol layer to cover your initial ...


0

This is a hack, but instead of symbolizing them you could label them with symbology. I believe, labels give you the option of draw order across layers.


3

Enable Snapping (1), use Select features (2) to select the features of the grid you want to move, Toggle editing (3), click Move Feature(s) (4) and shift the upper left point of the grid until it snaps to the point (5).


7

You probably use shapefiles to store your layer. To solve your issue, save the layer to a Geopackage. Shapefiles do not support Datetime field types. See the QGIS documentation about Shapefiles: Only Decimal number, Whole number, Text data and Date attributes are supported. See also this explanation.


1

Do yourself a favour and install the fantastic spreadsheet layers plugin (more infos here: https://github.com/camptocamp/QGIS-SpreadSheetLayers) After installation you can easily import excel-spreadsheets: Dont forget to set the appropriate Geometry columns for lat and lon: you are done!


2

The first step was to make sure that the .csv file is formatted in a way QGIS recognizes the numbers as numbers and not as a text. The comma (,) decimal separator was not recognized by QGIS. I had to make sure that the .csv file used a dot (.) as a decimal separator. In my case I just used a text editor to replace all commas by dots. The .csv file then ...


1

@Sangster answered to his own question: The following has recovered the project so has been noted to help others, but it does not identify or repair the original problem so I am not marking it as the answer. Note that simply duplicating the affected layer resulted in duplicating the problem too. To recover from this problem: Right click the affected layer ...


2

There's another way to do that and you can use the year attribute from the CSV for setting the color. Create the line by adding an additional symbol layer of type Geometry generator and create the line with this expression: make_line ( geometry (get_feature_by_id (@layer, $id)), geometry (get_feature_by_id (@layer, $id+1))) You can then set year as ...


1

On the centroid layer, you can use the following expression with Field calculator to caclulate the distance from the centroids of the hexagon to the closest point of the nearest feature on the layer park: length ( make_line ( centroid ($geometry), closest_point ( overlay_nearest ( 'park', $...


4

Another option to style each segment in a different style is to set symbol layer type to Geometry generator with this expression: segments_to_lines ($geometry). Then you can use data driven override for styling (color, stroke width etc.) with the variable @geometry_part_num. See how and where to make the inputs:


6

You can set the style of the line to Symbol layer type of Interpolated Line and apply a color ramp. Then the line from the start to the end is styled in a smoothly changing color ramp:


1

Meanwhile (since QGIS 3.16), there is the new overlay_nearest function you can use for that with QGIS expressions. For each point, 1) get the nearest line with overlay_nearest, 2) get the closest point on this line to the point using closest_point. The expression to be used with Geoemtry generator or Geomtry by expresssion (see here for details) look like: ...


0

As pointed out by @mikewatt, it seems like I cannot add a point geometry directly. The best I can do is use the GetPoint or GetPoint_2D methods and pass the Point geometry's coordinates to the LineString geometry, as shown below: from osgeo import ogr coords_p1 = [1214242.4174581182, 617041.9717021306] coords_p2 = [1234593.1427447330, 629529.9167643716] ...


0

https://docs.microsoft.com/en-us/dotnet/api/system.device.location?view=netframework-4.8 It's not as feature-packed as GeographicLib, but for simple distance calculation, it's more than enough.


2

Use Karney's GeographicLib see https://geographiclib.sourceforge.io/


4

The point that is created has no SRID, i.e. 0, which is different than 4326. That being said, st_distance uses the unit of the CRS, so degrees in this case. One solution is to use geography instead of geometry, as the unit is meters, and to use st_dwithin() instead of st_distance as it makes use of spatial index. Eventually, you will want to add an index on ...


2

Use the following expression either with Geometry generator (for visualization purpose only) or Geometry by expression (to creare actual geometries) (see here for the difference) to create a polygon with areas more than 5 km away from all points: difference ( buffer ( bounds (collect($geometry)), 5000), buffer (collect (buffer ($geometry, 5000)), 0) )...


0

If you save the Excel file as CSV UTF-8 (Comma delimited) @KevinReid’s answer does not work, whereas if you save as CSV (Comma delimited) it does. That solved the problem for me.


Top 50 recent answers are included