I don't know about the tools you mention but you can try a query like this one :
select id, st_distance(poly.geometry, line.geometry) from poly, line
That should do the job ...
You input the query in QGIS DB Manager :
You choose Database / Database Manager / Database Manager then Virtual Layers / Qgis Layers.
Adapt the query to your ...
You're correct that this UoM is called decimal degrees, and partially correct that the value varies depending where you are on earth.
One degree of latitude is always about the same width. One degree of longitude varies depending on what latitude you're at. The accepted answer to this question explains it well: Calculating longitude length in miles?
Going to answer my question based on the reply found here. Apparently it is a bug, and the current workaround is to use:
Will update when a final solution is available.
Using your test data, this:
> gDistance(sp_poly, sp_pts)
returns the distance from the polygon to the nearest point, but if you add byid=TRUE:
> gDistance(sp_poly, sp_pts, byid=TRUE)
you get a matrix of distances - each row is one of your points. If you have more than one polygon ...
Create a scratch layer (line).
Apply a label with this expression:
'dy = ' || to_string( y(start_point( $geometry))-y(end_point( $geometry))) || ' , dx = ' || to_string( x(start_point( $geometry))-x(end_point( $geometry)))
It will look like: dy = -0.7004608294930876 , dx = -0.9370199692780339.
You can change the text as you want, eg if you want it to ...
Here is an example code which subclasses QgsMapToolEmitPoint to create a custom map tool which should do what you want. It also implements the QgsRubberBand class to draw a temporary line on the map canvas to track your start and endpoints. You can paste this script into a new editor in the python console and click 'Run script'. You will see the cursor is ...
The distance-distortion in the map projection will be independent of the software (ignoring blunders); it is instead dependent on the projection used, and is also spatially variable.
Ordnance Survey National Grid is a Transverse Mercator projection chosen that the distances on the ground are identical to distances in the grid along two meridians: two lines ...
You can try Openrouteservice.org, where the results are downloadable in the GeoJSON file. Afterwards, you can easily manipulate them i.e. in the interactive map builder like GoogleMyMaps.
Apart from Openrouteservice.org in this article, you will find another useful tool. I would ...
If you raster's projection unit is meter, then the output unit of the proximity raster will be meters if you specify georeferenced units. In case your raster's projection unit is not meter (e.g. is degree because it is on WGS84), you'll want to reproject your raster to another coordinate system (such as UTM, for example).
ValueError: Expecting input points to be (N, 2), got (1, 63)
This is a problem with the 'shape' of your array. It suggests the code is expecting something like this.. a list of coordinates, where each coordinate is an array (or tuple) of length 2.
[[x1,y1],[x2,y2], ... ,[xN,yN]]
but somewhere, your code has 'flattened' the array, so it looks like this
The problem is that your pipeline diagram is a raster image rather than a vector. A human being can easily look at that image and see lines and points, but a computer can't. QGIS doesn't know where the lines and points are, so it doesn't know where you want to measure from and to.
In order to use QGIS to measure the lines, you'll need to convert them into a ...
You should be able to use the Shortest Path (Point to Point) located in the processing toolbox. Before running the tool, make sure your lines are separate segments between each intersection ( I used the split lines with lines tool for this part). The pinkish line shown below is the result received.
If i understand your question correctly and those lines are two separate objects in attribute table simple
expression in field calculator should do the trick.
Great answer by CSK below.
I've asked about blueprint format because i had same issues with sewer drawings few years before. Back then I came up with two partial sollutions.
1) Some ...
the <-> operator will use the index only if it is within the order by clause.
You can rewrite your query
select a.id,closest_pt.id, closest_pt.dist
from tablea a
CROSS JOIN LATERAL
a.geom <-> b.geom as dist
FROM tableb b
ORDER BY a.geom <-> b.geom
LIMIT 1) AS closest_pt;