Assigning Angles or Bearings to lines in Mapinfo

2,703 views
Skip to first unread message

Bolithio

unread,
Mar 21, 2008, 5:47:23 PM3/21/08
to MapInfo-L
Currently I do this by holding a protractor on the screen. lol

Is there a better way to do this?

Thanks

Gentreau

unread,
Mar 21, 2008, 6:18:03 PM3/21/08
to mapi...@googlegroups.com

There definitely is, for one thing your method assumes that straight up is
zero degrees, which it rarely is.

The other consideration is the length of the line.
For short distances, say up to 100km, and if you don't need to be accurate
to fractions of a degree, you can use standard trigonometry. You remember
those sine, cosine and tangent things they told us about at school?
For longer distance you need to use Great Circle calculations to take into
account the curvature of the earth.
There's all the formulae here: http://williams.best.vwh.net/avform.htm

I suppose it really is time that someone wrote a small application to do
this.......

Gentreau.

Richard Greenwood

unread,
Mar 21, 2008, 6:45:06 PM3/21/08
to mapi...@googlegroups.com
I have a simple, free MBX called "cogo" at:
http://www.greenwoodmap.com/software
That you may find useful. It works only with projected coordinate
systems. I wrote it for entering bearing and distances as they appear
in deeds, so it may or may not be useful for your application.

Rich

--
Richard Greenwood
richard....@gmail.com
www.greenwoodmap.com

David R Sherrod

unread,
Mar 21, 2008, 7:02:52 PM3/21/08
to mapi...@googlegroups.com, MapInfo-L
Bolithio,
I use a klugey solution because I rarely need the info and have never
bothered to find a more efficient method. But mine is only about 1
micrometer above yours in its appearance of sophistication.
Essentially I run Greenwood's COGO in reverse, drawing a line along the
azimuth of the line of interest. I miss by a bit, of course, but
successive tries with angles increased or decreased by some trifle usually
gets me to within 0.5 degrees after 2 or 3 strikes.

I want North to be zero, and I want angles to increase clockwise, so I
diddle with the settings. I've never cared enough about the accuracy to
test the method for projections using degrees or those using
eastings-northings. (The latter will depart from north across the grid.)

Hmm . . . perhaps I should buy a protractor.


(Embedded image moved to file: pic58187.jpg)
--------------------------------------------
David R. Sherrod, Cascades Volcano Observatory
U.S. Geological Survey,
1300 SE Cardinal Court, Bldg. 10
Vancouver, WA 98683
voice 360-993-8915
fax 360-993-8980
dshe...@usgs.gov
-----------------------------------------



Bolithio
<swissforestryrob
in...@yahoo.com> To
Sent by:
mapinfo-l@googleg MapInfo-L
roups.com <mapi...@googlegroups.com>
cc

03/21/2008 02:47
PM


Please respond to Subject
mapinfo-l@googleg [MI-L] Assigning Angles or Bearings
roups.com to lines in Mapinfo

pic58187.jpg

Gentreau

unread,
Mar 21, 2008, 7:13:53 PM3/21/08
to mapi...@googlegroups.com

In fact here is one I made earlier, as they say....

Use the toolbutton to drag a line between 2 points, the distance and bearing
will be displayed in the message window.
I have rounded the values to 1 degree and 1 metre as you cannot rely on them
for absolute accuracy.
This tool is good for shorter distances, don't try to use it to get the
bearing from London to New York though.

Hope that helps

distance_azimuth.zip

Glen

unread,
Mar 22, 2008, 8:58:17 AM3/22/08
to MapInfo-L
I have an MBX that is great Circle you input 2 points and it gives you
the bearing

Trey Pattillo

unread,
Mar 22, 2008, 10:14:26 AM3/22/08
to mapi...@googlegroups.com
You can get SurLine from my website
short for Surveyor Line
Use survey type call N 23' 25' 45' E 200ft
or just direct 32.123456 200ft
bearing and distance and take most math
common would be simple to add/subtract 90/180 to reverse or
tangent the next line
also do may types of cutting/buffering

NOTE: this is done in the cosmetic layer only as it
creates many temp entries that would mess up your layer
so it is *just art work* to transfer to your layer

For doing many things to street segments use FixLine program

http://www.wap3.com/download/index.shtml

along with many other MapBasic applications.

Bolithio

unread,
Mar 24, 2008, 12:18:10 PM3/24/08
to MapInfo-L
Thanks all. I found the cogo and distance azimuth very useful. Luckily
I am not dealing in distances over a mile usually. So these appear to
work great.

Soren Lindqvist

unread,
Mar 24, 2008, 3:50:07 PM3/24/08
to mapi...@googlegroups.com
Hello,

Is there an easy way to select point that are closer then for example 10
meters? I have about 6500 points and need to find the points that are within
10 meters of each other. Is there an easy way to do this with SQL?

Soren


Peter Horsbøll Møller

unread,
Mar 25, 2008, 4:09:41 AM3/25/08
to mapi...@googlegroups.com
Søren,
 
You can use this method. It is however not a single SQL.
 
1. Create buffer around your points in a new layer
2. Combine these buffers to a single object
3. Split this single object into individual objeckts again
 
Now the buffers are connected where the distance between them is shorter than 2 x the buffer distance.
 
In your case you would use a buffer distance of 5 meters.
 
Now count the number of points within each polygon and use the polygons with more than 2 points to select the points closer than 10 meters to another point.
 
Does this make sense ?
 
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
5260 Odense S.
Denmark
 
Dir   +45 6311 4908


From: mapi...@googlegroups.com on behalf of Soren Lindqvist
Sent: Mon 24-Mar-08 20:50
To: mapi...@googlegroups.com
Subject: [MI-L] Need to select points within certain distances

Soren Lindqvist

unread,
Mar 25, 2008, 2:25:05 PM3/25/08
to mapi...@googlegroups.com
Peter,

Yes make sense, but count the numbers within each polygon?
How would the SQL look like for selecting points that are inside the buffer from two tables one with the points another with the buffer table. Some of the points can be on top of each other...  

Thanks
Soren



On 3/25/08 9:09 AM, "Peter Horsbøll Møller" <P...@cowi.dk> wrote:

Søren,
 
You can use this method. It is however not a single SQL.
 
1. Create buffer around your points in a new layer
2. Combine these buffers to a single object
3. Split this single object into individual objeckts again
 
Now the buffers are connected where the distance between them is shorter than 2 x the buffer distance.
 
In your case you would use a buffer distance of 5 meters.
 
Now count the number of points within each polygon and use the polygons with more than 2 points to select the points closer than 10 meters to another point.
 
Does this make sense ?
 
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
5260 Odense S.
Denmark
 
Tel   + 45 6311 4900
Dir   +45 6311 4908
Mob +45 5156 1045
Fax  + 45 6311 4949
E-mail p...@cowi.dk

Peter Horsbøll Møller

unread,
Mar 25, 2008, 2:56:48 PM3/25/08
to mapi...@googlegroups.com
Søren,
 
I would add a column to the buffers and then use Update column to count the number of points within each using the table with points.
 
Update table with buffers
Update column with number of points
Get values from table with points
    where the objects from the buffer table contain the objects from the point table
Update with Count

Peter Horsbøll Møller
GIS Developer, MTM GeoInformatics

Geographical Information & IT
 
COWI A/S
Odensevej 95

DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  p...@cowi.dk
http://www.cowi.dk/gis

 


From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Soren Lindqvist
Sent: Tuesday, March 25, 2008 7:25 PM
To: mapi...@googlegroups.com
Subject: [MI-L] Re: Need to select points within certain distances

Darren Chan

unread,
Mar 25, 2008, 5:03:16 PM3/25/08
to mapi...@googlegroups.com
Hi Soren

Tried the Spider Graph or Distance Calculator tools?  Result table can than be filtered for the distance you select. 
You may end up with a large result table in your case with 6500 points

BR,

Darren

Doyle, Peter W

unread,
Mar 31, 2008, 10:22:01 PM3/31/08
to swissfores...@yahoo.com, mapi...@googlegroups.com
Bolithio / Others who may be interested,

In response to Bolithio's message below I use a technique that I find benificial and thought it may be of interest to others.

It displays a watermark (raster image) of a Protractor behind your map data

It requires a little bit of initial setup the first time.

How to achieve this
-------------------
- Download and install "Glass2K" from http://chime.tv/products/glass2k.shtml
- Extract and store "Protractor.png" image from the attached zip file
- Open a new (clean) session of Mapinfo
- Open the Protractor.png file from above and Display it. (File > Open > Files of Type = Raster Image)
- Maximise the mapper window
- Minimise this Mapinfo session
- Open a second session of Mapinfo and load your map data
- Again maximize the mapper window
- Minimise this Mapinfo session
- From the task bar select the first Mapinfo sesion containing the Protractor image
- From the task bar select the second Mapinfo session comtaining your data
- Press Ctrl + Shift + 5 (Glass2k command for turning on transparency)

You should now see the Image of the protractor showing through behind your data
(see sample screenshot in attached zip file)

Move your map data around on top of the protractor to suite your needs

Notes:
------
- For best results both Mapinfo sessions and the mapper windows in each session should be maximized.

- The second Mapinfo session window must be directly on top of the first Mapinfo session window
(eg. from the task bar select the Mapinfo sesion containing the Protractor image, then select the Mapinfo session comtaining your data)

- Press Ctrl + Shift + (1 - 9) to conrol the amount of transparency
- Press Ctrl + Shift + 0 to turn transparency off

- You may wish to use your own Protractor image (search for Protractor using Google Images)

Hope this is not to confusing. If you need help with the above method please ask

Regards
Peter Doyle


-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Bolithio
Sent: Saturday, 22 March 2008 7:47 AM
To: MapInfo-L
Subject: [MI-L] Assigning Angles or Bearings to lines in Mapinfo

Protractor.zip

Soren Lindqvist

unread,
Mar 5, 2009, 6:38:06 AM3/5/09
to mapi...@googlegroups.com
Hello!

Need an sql that can activate bufferzone that has more than 1 point inside.

I have made two tables one with bufferzones (buffer.tab) and one with points (points.tab).

I need an sql that can activate the bufferzones that has more then 1 points inside.

Not sure how the sql question should be like, have tried a few but its not working, any help is grateful.

Thanks
Soren

Driver, Greg 9434

unread,
Mar 5, 2009, 7:34:58 AM3/5/09
to mapi...@googlegroups.com
Soren,
 
I don't think you can do this in with one SQL operation.  One way to do it though would be to add a temporary column to the buffer table containing the number of points within each buffer.  You can use Table -> Update Column to do this:
 
Table to Update: Buffer
Column to Update: Add new temporary column
Get value from table: Points - Join - where object from table points is within object from table buffer
Calculate: Count
 
You can then use the temporary column to filter the buffers where the count > 1:
 
Select * from buffer, points where buffer.Obj Contains points.Obj and buffer.CountOfPoints > 1 into Selection
 
HTH

Greg Driver

System Administrator
Applications Support
ICT
Surrey Police
NOT PROTECTIVELY MARKED

*Internet communications are not secure and therefore Surrey Police does not accept legal responsibility for the contents of this message. This email and any attachments may be confidential. They may contain privileged information and are intended for the named addressee (s) only. They must not be distributed without our consent. If you are not the intended recipient, please notify us immediately and delete the message and any attachments from your computer, do not disclose, distribute, or retain this email or any part of it. Unless expressly stated, opinions in this email are those of the individual sender, and not of Surrey Police. We believe but do not warrant that this e-mail and any attachments are virus free. You must therefore take full responsibility for virus checking. Surrey Police reserves the right to monitor all email communications through their networks.*

Soren Lindqvist

unread,
Mar 5, 2009, 8:47:40 AM3/5/09
to mapi...@googlegroups.com
Greg!

Can’t get it to work, I only have “0” in the column I want updated, All of the buffers has a minimum of 1 point so there should be at least “1”, does both the tables need to have a column with unique ID for it to work?
If so (mine has no unique ID) how do you create such column? I can create a new column but then how to apply the unique numbers?

Both tables has only one column (ID) and there is only “0” as values. I put a new column in the buffer.tab (“NumPoints”) but I can not get anything else than value “0” (did try in many ways to update the column)

Thanks
Soren

Driver, Greg 9434

unread,
Mar 5, 2009, 9:24:15 AM3/5/09
to mapi...@googlegroups.com
Soren,
 
if you've added a new column to the buffers table ('NumPoints'), you can update this with the number of points by using the Update Column dialog under the Tables menu.  Basically, the dialog will look like this:
 
 
Don't forget to specify a 'Join' between the 2 table.  Once the NumPoints column has been updated, you can then use this in the SQL Select statement:
 
Select * from buffer, points where buffer.Obj Contains points.Obj and buffer.NumPoints > 1 into Selection
HTH

Greg Driver

System Administrator
Applications Support
ICT
Surrey Police
NOT PROTECTIVELY MARKED

-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Soren Lindqvist
Sent: 05 March 2009 13:48
To: mapi...@googlegroups.com

Soren Lindqvist

unread,
Mar 5, 2009, 11:58:05 AM3/5/09
to mapi...@googlegroups.com
Greg

Thanks I did exactly that, but it did not work, I did find the way to make a unique ID by using rowID in the “Value” from the Update Column and after this it works for me, I use the “Tabel > buffer instead of Object > buffer as well.

Thanks again for your time
Regards
Soren
Reply all
Reply to author
Forward
0 new messages