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" ...
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
qgis_prefix_path = 'C:\\OSGeo4W64\\apps\\qgis'
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.
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 ...
Assuming your data structure is like below
id, start_x, start_y, end_x, end_y
This is straighforward in QGIS if you have data in a projected CRS. You can add your text file as a vector layer, and add a virtual field in the Field Calculator with the extression such as below.
distance(make_point( "start_x" , "start_y" ), make_point( "end_x" , "end_y" ))
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 ...
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 = ...
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
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....
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:
When "Nest" is true then 'triangle'
When "Nest" is ...
(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:
wedge_buffer( $geometry, 45, 90, "NE"),
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 ...
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 ...
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 ...
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.
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).
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)
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).
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 +...
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.
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.
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.
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
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 !
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 ...
When you are at the following line of your script:
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, ...
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 ...
Try this (I've deducted some data provenance), and I've assigned as CRS the WGS84, EPSG: 4326 (I let you correct this if wrong) :
junctions.priority AS type,
FROM (SELECT "from" AS nodeID,
ST_SetSRID(ST_MakePoint(st_x(st_pointn(geom,1)), st_y(st_pointn(geom,1))), 4326) AS geom
Syntax error is not an arcpy error, it is a pure python error. ArcGIS Pro uses Python 3, and you need to add parentheses around the print function.
inputSRS = arcpy.SpatialReference(31467)
outputSRS = arcpy.SpatialReference(25832)
gt = 'DHDN_To_ETRS_1989_3'
pt = arcpy.Point()
pt.X = 3453122.083947168
pt.Y = 5427803.663703325
print ("Input ...