Tuesday, 17 April 2018

qgis - How to write an equivalent to MapBasic's CreateLine in pyQGIS?


I know this kind of question has been asked, in part, before - specifically: Seeing QGIS Python Commands and: How is object created as line using createline stored in .tab file? but this is a specific plea for help!



I've lost my (ancient) version of MapInfo, and so am attempting to recreate some analysis in QGIS. I relied heavily on the following MapBasic Command:


set coordsys table "yourtable"
update "yourtable" set obj = createline(x1, y1, x2, y2)

It joined every single point to every single point in the table and retained attribute data, thus giving me the ability to subsequently analyse the file. I loved this command for its' sheer simplicity.


I'm currently attempting to teach myself some Python, but from a very low knowledge base - so, I was wondering if anyone had seen something similar scripted in Python?!?


UPDATE: Thanks to Nathan and gene, comments really helpful!Household Income movers >$104,000 per year




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...