Solved

Finding Adjacent Spatial Feature for polyline features

  • 29 July 2021
  • 3 replies
  • 13 views

Hello,

I am trying to do some cleanup work of some Polyline Features where densified curves have been created due to loading the data into a Shapefile at some point in the past. I want the densified or stroked curves to be turned into true curves.

I know there is the Curve Fitter transformer but I want to limit the amount of linework that the Curve fitter is run on to help eliminate unnecessary manipulation of the data. I have some approximate curve selection parameters in a Python Caller Transformer to help select the appropriate lines to select the lines I want the Curve Fitter to run on. The issue is I need to know which lines are connected together in sequence to allow the Curve lien selection algorithm to work. The lines have OID fields that are randomly generated based on the copy and past functionality of ArcGIS Pro.

So far I have tried the Attribute Manager Adjacent Features but that appears to work off of table rows which is OID based(I think) not spatially based so that doesn't work. I am trying the topology builder at the moment but it is very slow and is likely going to give me back to much information.

As an absolute fallback approach I think I might be able to brute force check every vertex and find the OID of the touching line in Python in ArcGIS Pro but I would prefer to keep this all in FME since I want to run al my selected line through the Curve Fitter once I have all the likely curves selected.

I have attached an example the top curve is a true curve the bottom "curve" is a densified curve that I want to turn into a true curve.

Any thoughts or ideas are welcome!

Thank You!

icon

Best answer by virtualcitymatt 2 August 2021, 10:00

View original

3 replies

Userlevel 4
Badge +26

I'm not sure if this will work for you or is even what you want however you should be able to use a LineCombiner to join them up, this should work regardless of their order. You can use the option to preserve the segments which will result in a MultiLine. You can then use a GeometryPartExtractor to extract the Line Segments (GeoemtryType=IFMELine).

If you need to keep all the attributes you can first use a GeoemtryPropertySetter to set the id as a trait on each segment and then merge back the rest of the attributes after the geometry property extractor.

This should give you ordered segments. (see attached with fake data as an example)

 

I'm not sure if this will work for you or is even what you want however you should be able to use a LineCombiner to join them up, this should work regardless of their order. You can use the option to preserve the segments which will result in a MultiLine. You can then use a GeometryPartExtractor to extract the Line Segments (GeoemtryType=IFMELine).

If you need to keep all the attributes you can first use a GeoemtryPropertySetter to set the id as a trait on each segment and then merge back the rest of the attributes after the geometry property extractor.

This should give you ordered segments. (see attached with fake data as an example)

 

Thanks Matt!

This does what I need it to do! I just need to integrate into my much larger model that does a whole bunch of other things but this is a super interesting way to go about it. Much appreciated!😀

@virtualcitymatt​ Turns out after about after an hour of playing with this(I had other broken things in my model) you need one more counter in between the geometry part extractor and the geometry property extractor. This actually adds a sequential ID that can be used later. This is for anyone else that may stumble across this. You gave me 95% of the answer though so very much appreciated Matt. Modified_modelThe original workspace the lines were created with a counter that made them sequential so the model looked it was working.

Reply