2

I'm working on a point-layer where points represent the start and end point of lines (streets). Since some streets are joined to each other at the startpoints/endpoints (because they're next to each other) some points share the same XY-coordinates as they overlap each other.

I would like to find these points and add to a new/empty column the overlapping points' "name" (or "id") value.

Is this possible with an expression in the field calculator? I suppose I should use $x_at(0)/(-1) and $y_at(0)/(-1) but I can't find out that which expression helps finding overlapping features.

1

Its highly likely that a simple spatial join will miss point pairs where the XY is just minutely different. If you make a very small buffer around the points (within a distance you consider to be "the same place"), then spatial join the points to these, the points which join to more than one buffer ID will are thus the overlapping points. Add a column "count" to this spatial join table and set every row to 1, then sum by point ID, any points with a value greater than 1 for count will be the 'overlapping' points.

0

Rather than use an intersect in this situation I just calculate the distance. In the query below we select any point that falls within 1 foot of the target.

In this example we create a table from the valid pairs. In your calculation, you would create an update query or possibly two separate update queries and then you would transfer the identifier based off of the same from and where statements.

INSERT INTO NearbyNodeDefs
                     (MnGEOMX, MnGEOMY, VtxNODEX, VtxNODEY, Delta, MnUFID, Stream, VtxUFID, MnSrcTable, MnSrcID, MnSrcIDField, Shape, VtxSrcTable, VtxSrcID, VtxSrcIDField)
SELECT UpDownMainDefsV2.GEOMX, UpDownMainDefsV2.GEOMY, EndpointDefs.GEOMX AS NODEX, EndpointDefs.GEOMY AS NODEY, SQRT(Square(UpDownMainDefsV2.GEOMX - EndpointDefs.GEOMX) + Square(UpDownMainDefsV2.GEOMY - EndpointDefs.GEOMY)) AS Delta, UpDownMainDefsV2.UFID, UpDownMainDefsV2.Stream, EndpointDefs.UFID AS VtxUFID, UpDownMainDefsV2.SrcTable, UpDownMainDefsV2.SrcID, UpDownMainDefsV2.SrcIDField, UpDownMainDefsV2.Shape, EndpointDefs.SrcTable AS VtxSrcTable, EndpointDefs.SrcID AS VtxSrcID, EndpointDefs.SrcIDField AS VtxSrcIDField 
FROM UpDownMainDefsV2 CROSS JOIN EndpointDefs 
WHERE (UpDownMainDefsV2.StatusRM = 'Searching') AND 
(SQRT(Square(UpDownMainDefsV2.GEOMX - EndpointDefs.GEOMX) + Square(UpDownMainDefsV2.GEOMY - EndpointDefs.GEOMY)) <= 1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.