I didn't need a function, just a query I could run. Based on some of the answers here, I made the following:
WITH geom AS (
SELECT st_setsrid('polygon-string'::geometry, 4326) AS geometry
points AS (
SELECT generate_series(ST_XMIN(ST_Transform(geometry, 3857))::int, ST_XMAX(ST_Transform(geometry, 3857))::int, 1000) AS x,
Have you tried going to Properties --> Symbology --> Categories
There you can set the field that you want to use for the symbology and it will collect like items together in a list. From there you can change the symbols as you see fit.
This will work when each cluster has an attribute that defines it.
If there is no such attribute, you can achieve it by means of "DBSCAN clustering" geoalgorithm.
Clusters point features based on a 2D implementation of Density-based spatial clustering of applications with noise (DBSCAN) algorithm.
The algorithm requires two parameters, a minimum ...
I managed to do it, but I think it's unnecessarily complicated:
I used "snap points to points" (saga_cmd shapes_points 18) @Taras suggested, to snap one of my layers to the other one.
Then, since I am not aware of SAGA having a spatial join tool, I created small buffers around the points which stayed at their location with saga_cmd shapes_tools ...
OSM data is split into segments ("ways", in OSM parlance) whenever any property changes (name, surface, width, legality of herding yaks, ...). You have to decide what you mean by "the same road", assemble the bits that join up geometrically, and cut up the result according to your definition of "the same road".
This might be ...
OK, so the keywords here were "Geometry generator" and "make_line". Thanks Val P, for leading me to those :). I solved this by simply specifying "Geometry generator" as the "Symbol layer type" and an expression:
Following up on the comment of BERA, if you have access to the Network Analyst in Pro you could use the route analysis layer
Might be too extensive for this purpose though.
Or use Points to Line tool, a sort field can be used to specify the order if needed. E.g. your starting ...
You can use Zonal Histogram (Spatial Analyst). You can define zones either by an integer raster or a feature layer (your buffers of 250m).
Optionally it can create a graph automatically.
Make sure there are no overlapping features.
Consider also using "Geometry Generator" which contains a function make_circle($geometry, 100), see image below.
Creates a circular polygon.
[ ] marks optional components
center center point of the circle
radius radius of the circle
segment optional argument for polygon ...
Possible by means of the "Rectangles, Ovals, Diamonds" geoalgorithm from the QGIS's Toolbox, using 'Ovals', either fixed or variable.
Note: That both 'Width' and 'Height' parameters have to be equal.
Docs » QGIS User Guide » 18.104.22.168. Rectangles, ovals, diamonds (fixed)
Docs » QGIS User Guide » 22.214.171.124. Rectangles, ovals, ...
The plugin is now available for more recent versions of QGIS 3. I downloaded it today in QGIS v3.14.
or in QGIS go to 'plugins' > 'manage and install plugins' > search for 'multiple layer selections' plugin.
Extract vertices on route layer
Join attributes by location to join the extracted vertices to the point layer
Order by expression to order the output by the field vertex_index that was created in step 1
Delete the fields not needed
If your route is not perfectly snapped to your points you might need to add a buffer step between step 1 and 2.
According to the big bright yellow warning line, I would guess that the distances are expressed in degrees.
To get distances in meters, you must first reproject the lines/points to a suitable projection such as 27700
The answer provided here by mgri (which I think would work great in QGIS 2) unfortunately won't work in QGIS 3 as the QgsMapLayerRegistry is no longer recognized (please see Is QgsMapLayerRegistry removed in QGIS3?).
QGIS 3 now includes a point cluster renderer that will accomplish this same result out-of-the-box, without additional coding: https://north-...
You can create a new field in QGIS using the Field Calculator (via view attribute table) and state you want a text column
(limited to 50 characters here but that depends on your source.)
You can also calculate the new field with the existing numeric field.
There are two ways (at least) to solve this (and probably a third one as shown by @Taras) Both times the key point is to see things from the perspective of adresses (points), not parcels (polygons). Because while 1 polygon may have several addresses, addresses are only related to 1 specific polygon (parcel/plot/lot/piece of land).
Method 1 :
Use "Join ...
Using a Virtual layer, you can create a polygon of the desired dimension and move it to each location of the point layer. You can then save as the output if you want to persist the data.
Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Replace the layer name for yours.
WITH src AS (
In QGIS, use "Geometry by Expression" tool (in a projected CRS). It will also add points information/attributes to polygons.
Select "Polygon" as "Output geometry type" option.
Add the following expression as "Geometry expression" value:
make_square(make_point($x, $y), make_point($x+100, $y+100))
For each point (x,y) in a projected CRS generate a string like:
polygon((x y, x+100, y, x+100, y+100, x y+100, x y))
you can then process that into a Polygon using geom_from_wkt.
Then save the layer as a shapefile (or better still a GeoPackage).
Not a pure solution, just couple of ideas how this task can be tackled
Geocode each point, i.e. convert address into a x,y-tuple and it as a layer into QGIS. As you said that "points representing addresses (in Paris region)" apparently means for me, that each point has a street and a building number. IMHO each address will be geocoded and ...
Your data looks as following
After testing it with "Select by location" with disjoin-method, see image below. I may say that there is a micro distance exists between those points and line.
So, there are several suggestions that may lead you to the desired output
#1 using a small buffer around the line layer, like on the image below
#2 by means ...
A naive IDW implementation, from the top of my head:
UPDATE <points> AS itp
SET "Z" = (
SELECT smpl."Z" as z,
ST_Distance(itp.geom, smpl.geom)^<P-value> AS d
FROM <point> AS smpl
itp.geom <-> smpl.geom
So the big issue is what "algorithm" to use. I'm doing pretty much the same as @Fezter with an overlay and checking overlaps. I take anything with an overlaps=1 and keep it as a final result. I take one feature at random with the highest number of overlaps, and drop it from the translation.
If Overlaps = 1 then
I think I understand your question now, and I have a potential solution.
I have created a simple workspace which buffers some points by 100m and then passes the points and buffers into a PointOnAreaOverlayer. Then, I test for how many overlaps there are.
The workspace looks like this:
The points and buffers look like this:
This is a COMPLETE hack, but it worked for me:
I opened the .csv file in Excel (be sure to open it Data > From Text, as Text. It can also done in SQL directly, but it turned out to be more hassle than it's worth) and used a combination of "Find and Replace" and "Text to Column" to un-merge the original WKT column:
from: POINT (13....
I recently developped a small plugin for QGIS3 that adds a toolbar with a "multilayer" version of the QGIS selection tools. You can also optionaly replace the default tools with the custom ones.
Note: While I was developing it, the original plugin was ported to QGIS3. I encourage you to give both a try :)