Hi Duncan,
Indeed you can do this with the update table function. One thing to consider prior to doing this however is that it is likely that your road objects extend beyond the boundaries of your grid. This complicates it slightly, and the best way of getting around this is to split your road objects using the grid (remember to make a copy of the road table when doing this; you might not want to split the original and it is good practice when bulk editing tables).
- Select all your roads and make the road layer editable
- Click Objects > Set Target
- Select all of your grid
- Click Objects > Split
- Leave Data Disaggregation as Value and click Ok
Your roads will now be split where they cross a grid boundary. Now you can update a column in your grid table with the length of road within each grid cell.
Table > Update Column
Update: GridTable
Column: RoadLen
Get Value From: RoadTable
Join… > Where object from table GridTable CONTAINS object from RoadTable
OR (depending on the order mapinfo puts the tables in…)
Join… > Where object from table RoadTable WITHIN object from GridTable
Calculate: Sum
Of: ObjectLen(obj, “m”) <- You can replace “m” with other units; if you need this in miles for instance “mi”
So, the above updates the column RoadLen in the table GridTable with the length of any road objects within each grid cell.
Hope that was clear and makes sense!
Regards,
From:
mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Duncan
Sent: 02 July 2012 17:17
To: mapi...@googlegroups.com
Subject: [MI-L] Mapinfo distances
in gridsquare,
Hi, thanks for reading, any help would be much appreciated.
I am doing a project which involves studying the impact of certain variables (such as the presence of diamond mines) on conflict in Sierra Leone. The study uses grid squares. Basically I will be measuring whether these variables are located in the same gridsquares as conflcit outbreak.
One of the variables I will be using is roadlength in km. I have a drawn the road map onto a map info table but would like to know how to calculate the length of road within each gridsquare for my data set.
I understand that this is most probably done through the "table/update table" function - but finding the right 'join' and right 'expression' is proving very difficult for me.
Again, thanks for any help,
Duncan
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en