Hot answers tagged

13

One possible tool is Geometry by expression in the Processing Toolbox > Vector geometry. A Geometry expression to create lines (length= 100 m) is as below: make_line(project($geometry, 50, radians("angle")), project($geometry, 50, radians("angle"+180))) project($geometry, 50, radians("angle")) part creates a new point by moving your points to "angle" ...


6

In QGIS 3, the NumericalDigitize tool no longer seems to be available but here is a further solution. As of QGIS 3 you can simply copy and past WKT directly into the canvas. This works for single or multiple features all in one go eg: point(543100 177100) point(543250 206850) point(561800 206850) or: polygon((123456 654321, 123456 765432, 234567 765432, ...


6

I put an example of solving the same task with a pyqgis (3.2) standalone application. Below the python code from qgis.core import QgsPointXY, QgsApplication, QgsVectorLayer, QgsFeature, QgsGeometry from PyQt5.QtWidgets import QApplication import sys import math def main(): print('Start program') qgis_prefix_path = 'C:\\OSGeo4W64\\apps\\qgis' ...


6

I think using HTML map tip is what you want, to activate it open the Layer Properties dialog for a layer and select the Display tab, there you could configure the map tip (use HTML and CSS) to show the information you want when you hoover above a point in your map. see this blog post from Nathan Woodrow for an exemple.


6

You can use a data-defined override for the 'Fill color' property of the point layer to achieve this. First you need to export your singleband raster as 3-band RGB image. Once you apply the colormap, right-click -> Export -> Save As.. In the export raster layer dialog, choose Output mode as 'Rendered Image'. Once exported and loaded, you can use the ...


5

Try Point displacement or Point cluster from symbology menu. (QGIS 3.x required for point cluster.) As point displacement they can look like this for example: And as point cluster like this for example: Play around with the settings to fit your needs. You can combine these with graduated, categorized or rule based renderer; Set up own styles and adjust ...


5

By using PyQGIS 2 (I supposed for your tag pyqgis) you can do that with 'closestSegmentWithContext' method from QgsGeometry and 'azimuth' method from QgsPoint. I used shapefile of following image: to test below code: from PyQt4.QtCore import QVariant registry = QgsMapLayerRegistry.instance() points = registry. mapLayersByName('points_grid') line = ...


5

You can do it in two steps: Create a negative buffer for the polygons. It the same old buffer algoritm, but with a negative distance. The buffer distance should be half of the desired minimum distance between points from different polygons. Run the Random Points Inside Polygons... on these new polygons


5

Tested on QGIS 2.18 and QGIS 3.4 I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... Let's assume we have five features in "rivers" (for simplification "id" is equal to "Zone") and five features in "some_points" layer accordingly, where points are located at the start of each "rivers"'s feature, see image below....


5

You can use rule based symbology or data defined override. Since your case is not too complex, I suggest rule based symbology because you will have a nice legend then. Set it up the following: In case you want to use data defined override you can do it like this for example: Use as expression: Case When "Nest" is true then 'triangle' When "Nest" is ...


5

(1) Prepared a dummy data of two storm center, with "NE", "SE", "SW", "NW" fields which stores the 64kt-wind observed distance (meters, in my project CRS). (2) Started Geometry by expression tool, which is in Processing Toolbox > Vector geometry. (3) Gave this expression: combine( combine( wedge_buffer( $geometry, 45, 90, "NE"), ...


5

my answer is based on: http://www.postgresqltutorial.com/creating-first-trigger-postgresql/ and https://stackoverflow.com/questions/39607334/postgres-trigger-creation-error-no-language-specified-sql-state-42p13 EDIT1: adjusting for ThingumaBob's comment first you need to create a function to be used by your trigger action : CREATE OR REPLACE FUNCTION ...


4

Try using QGIS 3.2.2 and SAGA (installed by default in QGIS): "Raster Values to Points" function will do everything for you: It takes a image file and converts it into a Point-vector shape taking the information from raster image.


4

You need to access the underlying QgsPoint object. Think of QgsGeometry as a "container" which holds a point, line, polygon, etc. To do this you call ".get()" on the QgsGeometry. I.e. geom.get().x() geom.get().z() geom.get().setZ(5) Etc


4

The tool "Snap geometries" in the processing toolbox can help you. Give two times your layer (input and reference layer), set the tolerance to 1 meter and select the best snapping behavior for your case (i.e. align nodes, don't add new).


4

Start the Field Calculator on your point layer's attribute table. Create a new field by an expression below: line_locate_point(geometry:=geometry(get_feature('NaMy_FSR', 'id', '1')), point:=$geometry) Assuming: Your line layer name is : NaMy_FSR The line has an attribute value 1 in the 'id' field. (You can use any field to distinguish the line). [EDIT] ...


4

If you want to use a UTM-like projection that isn't a standard UTM zone, you can just specify your own Transverse Mercator coordinate system. Here's the PROJ.4 page on Transverse Mercator projections. If your grid origin is known in geographic Longitude, Latitude coordinates, your projection will look like: +proj=tmerc +lat_0=ORIGIN_LAT +lon_0=ORIGIN_LON +...


4

Race condition. coords is an empty array when L.GeometryUtil.closest() runs. Be sure to wait until the remote GeoJSON file is loaded first.


4

You can use the Shape Digitizing Toolbar's "Add Circle by a Centre Point and Another Point" tool combined with the Advanced Digitizing tool's distance option. But to be honest I don't find buffering to be long winded at all and I usually go with that method.


4

Use the minimum bounding geometry tool in the Procesing Toolbox. Choose the geometry type: "Minimum enclosing circle" Note that some vector layer formats don't support circles. The circle layer will be converted to a nearly-circular polygon if you save it one of those formats.


3

Going by your last sentence, here is how I would identify "... three or more overlapping points": Start editing your point layer's attribute table and create a new text field, 50 characters long. Let's call this field text_x_y. This new field will contain the x,y coordinates (using the layer's coordinate reference system units of measure) for each point. ...


3

No plugin, CAD digitalized or field calculator was necessary for me. Just put the table in edit mode, add a vector point to the map, then use the Node Tool. You can drag the point with it, or by clicking your point you can edit the coordinates. Good luck !


3

I was having problems with the QGIS and SAGA GUI tools mentioned in this thread (Raster values to points was failing for some reason and throwing unhelpful errors and the GRASS v.sample created a whole new layer which was not helpful). After failing with the GUI tools for a while, I tried doing this in the Field Calculator. It worked quite well and I was ...


3

Solution below is essentially the one suggested by @Kirk Kuykendall to the same question of yours. INPUT: WORKFLOW: arcpy.AddGeometryAttributes_management("A", "POINT_X_Y_Z_M") arcpy.AddGeometryAttributes_management("B", "POINT_X_Y_Z_M") arcpy.Merge_management(inputs="A;B", "../A_Merge") arcpy.Dissolve_management("A_Merge", ".../A_Merge_Dissolve1", ...


3

You can click on the equation icon beside the label with to enter a complex label. Then, you can access the geometry coordinates using $x and $y. You can also concatenate text using || To display the X and Y, you could use an expression like: $x || ' - ' || $y


3

The tool will always return the same results unless you set the Random Generator environment value. Click the Environments... button at the bottom of the tool and select the Random Numbers section. See the help page for the Random Number Generator for details.


3

If you're input is a multilinestring, then you'll need to handle that by either iterating through all the parts or (blindly!) just taking the first part alone. For QGIS <= 3.4: To take the first part: multilinestring = feature.geometry().get() first_part = multilinestring.geometryN(0) # first_part will be a QgsLineString object To get the first/last ...


3

Sometimes I face similar issues, though I do need to get polygons from the images. My current solution is as follows: Use the info tool to get the specific RGB values of the areas of interest Use the raster calculator to change the value of all areas of interest to 1 while the rest of the image is 0 (e.g. image@1=255 AND image@2=167 - this gives all pixels ...


3

When you are at the following line of your script: print((row.geometry).within(buddies_buf.geometry)) then row.geometry is a single shapely Point (row is a Series representing a single row, so row.geometry is the single geometry from that row), while buddies_buf.geometry is a GeoSeries. So the within method you are calling is the shapely's Point.within, ...


3

in order to make Points to path tool works properly, you need to identify an order to the points so that the tool can follow the points based on the order you want: Here is an example: Add field with integer type Add numbers based on the order you want from the start until the end Use point to path tool and order the line based on the field you created in ...


Only top voted, non community-wiki answers of a minimum length are eligible