Question

How do you close DXF (AutoCAD) lines that are separated by long distances?


Badge +1

The issue I am having is the DXF data I have has been split up into "Sheet" level data. This means (in this case rivers) lines have a long distance between them. The snapping setting does not work as I have to use a parameter that is too high and it messes with the data. Is there any way to "close" these openings on the rivers? The first picture is an overview of the "sheet" level data I am talking about with several openings and the second is a zoomed look at one of the large river "openings". The third image shows the line I am attempting to create in order to close these spots off and in turn convert to a polygon. In the end I will be converting the data to shapefile.

 

 

 

 


11 replies

Badge +22

Could you intersect your problematic lines against a line corresponding to the sheet limits? (if not available, the accumulated bounding box of the data might work). Then just keep the pieces of the sheet that are connected to data at both ends.

Badge +10

I usually use a CoordinateExtractor (with index 0 and -1) to get the first and last coordinates of the line. With a VertexCreator (replace with point) I create new points for these lines. Next I use a NeighborFinder to find the closest to points and use another VertexCreator (add vertex) to create the lines to close these openings.

Badge +1

I usually use a CoordinateExtractor (with index 0 and -1) to get the first and last coordinates of the line. With a VertexCreator (replace with point) I create new points for these lines. Next I use a NeighborFinder to find the closest to points and use another VertexCreator (add vertex) to create the lines to close these openings.

I have been messing around with this option. I am fairly new to FME. Can you give screen shots with parameters as it should look? Here are some of my parameters right now.

 

 

 

What should be the Candidate for the NeighborFinder?

Badge +1

Could you intersect your problematic lines against a line corresponding to the sheet limits? (if not available, the accumulated bounding box of the data might work). Then just keep the pieces of the sheet that are connected to data at both ends.

So i've used the accumulator to create the box but how do you "just keep the pieces of the sheet that are connected" . Fyi this is one of approximately 300 sheets worth of data. I'm in the testing phase right now to then apply across all data sheets.

Badge +22

So i've used the accumulator to create the box but how do you "just keep the pieces of the sheet that are connected" . Fyi this is one of approximately 300 sheets worth of data. I'm in the testing phase right now to then apply across all data sheets.

Add an attribute to your bounding box, so that you can separate it from the rest of your data.

 

Send both the problematic data and the bounding box through an intersector and then use a tester on the attribute.

 

 

Your bounding box should now be broken wherever your data intersected the edge.

 

 

You then have several different options, depending on the rest of the data.

 

 

If both edges of the river share a common ID, you could use a spatialRelator and find the lines that are related to two features that share the common id.

 

 

If there are no attributes you could make an assumption of the max length of the the connection, and test for bb segments that are less than that length.

 

 

You could use a neighbourfinder or spatial relator to find which of the bb segments for each data dangle is shorter.

 

 

You could assign a unique ID to each data dangle, use a neighbourFinder to identify the closest data dangle, and then a spatialRelator with the bounding box segment to find the lines that are related to both the dangle ID and it's nearest neighbour dangle ID.
Badge +1

I usually use a CoordinateExtractor (with index 0 and -1) to get the first and last coordinates of the line. With a VertexCreator (replace with point) I create new points for these lines. Next I use a NeighborFinder to find the closest to points and use another VertexCreator (add vertex) to create the lines to close these openings.

This should help clean up most of the Data if you could provide me with a bit more information on parameters.

Badge +1

Could you intersect your problematic lines against a line corresponding to the sheet limits? (if not available, the accumulated bounding box of the data might work). Then just keep the pieces of the sheet that are connected to data at both ends.

What would be the Tester clause i should use?

Badge +22

What would be the Tester clause i should use?

Whatever attribute/value you created on the boundingbox

Badge +1

Could you intersect your problematic lines against a line corresponding to the sheet limits? (if not available, the accumulated bounding box of the data might work). Then just keep the pieces of the sheet that are connected to data at both ends.

I'm going to attempt to find a source AOI for the sheet.

Badge +1

Could you intersect your problematic lines against a line corresponding to the sheet limits? (if not available, the accumulated bounding box of the data might work). Then just keep the pieces of the sheet that are connected to data at both ends.

So even with the Source AOI there are instances where the data is a tiny distance away from the AOI line. The new question would be, is there a way to "snap" these river lines that are close to the AOI feature and then continue with the other steps? If so how is this done

Badge +1

Could you intersect your problematic lines against a line corresponding to the sheet limits? (if not available, the accumulated bounding box of the data might work). Then just keep the pieces of the sheet that are connected to data at both ends.

Alright, I've used the anchored snapping and the "PointonLineOverlayer". This has given me the outputs I desire. Now the task is to eliminate all of the unwanted chopped up AOI/Bounding box lines not associated with the rivers.

Reply