span8

span4

span8

span4

- Home /
- *FME Desktop /

Hi,

Im trying to create a best fit line from a list of coordinates on a runway and dont really know how to approach it in FME. Im familiar how to do a linear regression via the R caller but cant figure out how to create a line from the values. Im not even sure that a linear regression is the proper method to do collinearity. Anyone have an idea?

Thanks

Comment

@hrinze we created several RCaller examples on FME Hub and also the __tutorial on RCaller__ includes a couple of simple examples. It seems a little intimidating to get started with R, but with a few examples and so many online resources you should be able to get success

To add a bit of detail - the lm function from the stats package could work for this. There are a few specific points about using linear regression for spatial data. See this discussion on StackExchange for details. It has a python solution using arcpy that could work as well. The key points are:

- Using linear regression will bias your results towards x or y slightly; an average squared perpendicular distance method is technically more accurate. Linear regression should be good enough in most cases - though if planes are landing based on the results, you might need to be precise!
- The results of a linear regression model are not points, but values a (intercept) and b (slope), so of course your results are actually an infinite line. You can use the min and max values of x and y (BoundingBoxAccumulator in FME, min() and max() functions in R) to restrict the length of the line. You can then generate the values for the points using the linear regression formula y = ax + b. You can do that from the results of an lm model by accessing the coefficients (see e.g. here). Use the RCaller to generate the points of the line, then use a VertexCreator and LineBuilder in FME to build the line.

That just sketches out the basic solution. Good luck!

© 2020 Safe Software Inc | Legal

- Anonymous
- Sign in
- Create
- New Question
- New Article
- New Idea
- Spaces
- 3D (and BIM)
- Attribute Handling
- Automations (FME Server)
- CAD
- Cloud
- Coordinate Systems
- Custom Transformers
- Database
- Dynamic Workspaces
- FME Cloud API
- FME Cloud Administration
- FME Cloud Getting Started
- FME Desktop 3rd Party Integrations
- FME Desktop Administration
- FME Desktop Administration & Configuration
- FME Desktop Development
- FME Desktop Getting Started
- FME Desktop Installation
- FME Desktop Licensing
- FME Desktop Plug-In SDK
- FME Desktop Workbench Scripting
- FME Server 3rd Party Integrations
- FME Server Administration
- FME Server Administration & Configuration
- FME Server Development
- FME Server Getting Started
- FME Server Installation
- FME Server Licensing
- Fanouts
- Ideas FME Cloud
- Ideas FME Desktop: Data Inspector
- Ideas FME Desktop: Formats & Systems
- Ideas FME Desktop: Transformers
- Ideas FME Desktop: Workbench
- Ideas FME Server
- Indoor Mapping
- KML
- Lists
- Performance Tuning
- Point Cloud
- Published Parameters
- Raster
- Real-Time
- Running Multiple Workspaces
- Tabular
- Troubleshooting Techniques
- Vector / GIS
- Web
- Workflow Design
- XML / GML
- Zip Files
- *FME Desktop
- *FME Server
- *FME Cloud
- *Other
- Explore
- Topics
- Questions
- Articles
- Ideas
- Users
- Badges