Hi @jknakes, the "Group By" attribute has to be common to both Anchor features (points) and Candidate features (lines). In this case, I think that you have to add a new common group identifier attribute to the features to make groups by the condition where "OwnerID = Owner1 OR OwnerID = Owner2" before snapping. A possible way I can think of is:
- Give a sequential number attribute (e.g. "_count") to every line with the Counter. This number can be used as the group identifier later.
Add a FeatureMerger to the workspace, send the points to the Requestor port, and send the lines to the Supplier port. Set "OwnerID" for Requestor (points) and "Owner1" for Supplier (lines) to the "Join On" parameter, and specify a list name (e.g. "_list") to the "List Name" parameter.- Add another FeatureMerger to the workspace parallel to the first one, and set parameters as the same, but set "Onwer2" for Supplier (lines) to the "Join On" parameter here.
Connect a ListExploder to Merged ports of the two FeatureMerger. Set the list name to the "List Attribute" parameter, and set "Use Incoming List" to the "Conflict Resolution" parameter. This duplicates the points by the number of lines that match the condition "OwnerID = Owner1 OR OwnerID = Owner2", and the points will have "_count" that indicates a corresponding line.
Then, add an AnchoredSnapper. Send the points from the ListExploder to the Anchor port, send the original lines to the Candidate port, and set the "_count" to the "Group By" parameter.
The workflow looks like this.
Hope this helps.
If you use both owner id's as group by then it will only snap if there is 1 owner and matching.
So either send it in twice, for each owner id.
Also you should be able to merge it with only one featuremerger, using conditional merge.
requestor:
Condition "OwnerID = Owner1 OR OwnerID = Owner2"= 1, value = 1 else 0.
Supplier: 1
Hi @jknakes, the "Group By" attribute has to be common to both Anchor features (points) and Candidate features (lines). In this case, I think that you have to add a new common group identifier attribute to the features to make groups by the condition where "OwnerID = Owner1 OR OwnerID = Owner2" before snapping. A possible way I can think of is:
- Give a sequential number attribute (e.g. "_count") to every line with the Counter. This number can be used as the group identifier later.
Add a FeatureMerger to the workspace, send the points to the Requestor port, and send the lines to the Supplier port. Set "OwnerID" for Requestor (points) and "Owner1" for Supplier (lines) to the "Join On" parameter, and specify a list name (e.g. "_list") to the "List Name" parameter.- Add another FeatureMerger to the workspace parallel to the first one, and set parameters as the same, but set "Onwer2" for Supplier (lines) to the "Join On" parameter here.
Connect a ListExploder to Merged ports of the two FeatureMerger. Set the list name to the "List Attribute" parameter, and set "Use Incoming List" to the "Conflict Resolution" parameter. This duplicates the points by the number of lines that match the condition "OwnerID = Owner1 OR OwnerID = Owner2", and the points will have "_count" that indicates a corresponding line.
Then, add an AnchoredSnapper. Send the points from the ListExploder to the Anchor port, send the original lines to the Candidate port, and set the "_count" to the "Group By" parameter.
The workflow looks like this.
Hope this helps.
@jknakes, alternatively the InlineQuerier can be used effectively in this case.
SQL statement example
select a.*, b._count
from Point as a inner join Line as b
on a.OwnerID = b.Owner1 or a.OwnerID = b.Owner2
@takashi Could you possibly elaborate on your model set up? I'v have not used any of these transformers before and am not really understanding the process of how this should work and the use of them. I have my two point features going into a counter and have the "Counter name" set to the OwnerID. on the two line features would i have two counters? link both into the first counter and have that set to owner1 and the second to owner2? this is what i've tried putting together from your descriptions.
@takashi Could you possibly elaborate on your model set up? I'v have not used any of these transformers before and am not really understanding the process of how this should work and the use of them. I have my two point features going into a counter and have the "Counter name" set to the OwnerID. on the two line features would i have two counters? link both into the first counter and have that set to owner1 and the second to owner2? this is what i've tried putting together from your descriptions.
@jknakes, sorry for the vagueness of my screenshot. The 'points' and 'lines' shown in the screenshot just represent the source feature types (Points and Lines). Please replace them with appropriate reader feature types (Points and Lines), rather than transformers.
My intention is to use a Counter to create a temporary ID attribute unique for each line, which can be used as the 'Group By' parameter in the AnchoredSnapper.
Firstly add the ID to the Line features, and then merge the ID to the Point features based on the condition where [Point]OwenrID = [Line]Owner1 OR [Point]OwnerID = [Line]Onwer2
@jknakes, sorry for the vagueness of my screenshot. The 'points' and 'lines' shown in the screenshot just represent the source feature types (Points and Lines). Please replace them with appropriate reader feature types (Points and Lines), rather than transformers.
My intention is to use a Counter to create a temporary ID attribute unique for each line, which can be used as the 'Group By' parameter in the AnchoredSnapper.
Firstly add the ID to the Line features, and then merge the ID to the Point features based on the condition where [Point]OwenrID = [Line]Owner1 OR [Point]OwnerID = [Line]Onwer2
in my own case I have points and lines, I want to snap the lines to the points, both edges, ends and sides. I tried using the snapper and also tried using the anchored snapper, but still don't get to snap some. I have used intersector, it does the major part of the snapping but creates new points at any intersection without a point. I really would love to do this snapping based on relationship (attribute)