Polyline update column with length result

817 views
Skip to first unread message

soren.l...@hotmail.com

unread,
Nov 9, 2007, 4:34:38 AM11/9/07
to MapInfo-L
Hello,
Is there an easy way to calculate the length on selected polylines in
roadnet and update the column with the result?

I tried the "GeoMapVector.mbx" but I never got it to work on my data

Thanks
Soren

David Reid

unread,
Nov 9, 2007, 5:16:40 AM11/9/07
to mapi...@googlegroups.com
Very easily.

Perform an "Update Column"

*.Choose the table and column you wish to update (should be formatted
accordingly (i.e. decimal 6 x etc)

*.Set the value to ObjectLen(obj,"??") Replace ?? With your desired
units (ie. mi=miles, km=km, ft=feet, etc

This will update the length of each line to whatever point value you've
assigned (e.g. 2.456)


You can manipulate this witn the "rounding" function "round()"
If a line segment is 2.456 miles long and you only want the nearest
100th's...

Round(ObjectLen(obj,"mi"),0.01) would give you 2.460


Hope this helps,
David Reid
Colbert County 9-1-1
Colbert County, Alabama

soren.l...@hotmail.com

unread,
Nov 9, 2007, 6:40:37 AM11/9/07
to MapInfo-L
Super!!!
Exactly what I needed, Muchos Gracias David

Regards
Soren

On Nov 9, 11:16 am, "David Reid" <dwr...@hiwaay.net> wrote:
> Very easily.
>
> Perform an "Update Column"
>
> *.Choose the table and column you wish to update (should be formatted
> accordingly (i.e. decimal 6 x etc)
>
> *.Set the value to ObjectLen(obj,"??") Replace ?? With your desired
> units (ie. mi=miles, km=km, ft=feet, etc
>
> This will update the length of each line to whatever point value you've
> assigned (e.g. 2.456)
>
> You can manipulate this witn the "rounding" function "round()"
> If a line segment is 2.456 miles long and you only want the nearest
> 100th's...
>
> Round(ObjectLen(obj,"mi"),0.01) would give you 2.460
>
> Hope this helps,
> David Reid
> Colbert County 9-1-1
> Colbert County, Alabama
>
> -----Original Message-----
> From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On
>

> Behalf Of soren.lindqv...@hotmail.com

Reply all
Reply to author
Forward
0 new messages