Title: Meddelelse
Hi Hayden,
 
I think you should also start by checking that the line object is not partly within a region object from tblMapRef table. You can issue the "Partly within" command similarly to your command below for intersect.
 

Best regards

Jacob K. Jørgensen
Engineer, M.SC. in GeoInformatics
__________________________________________

Watertech
Soendergade 53
DK-8000 Aarhus C

Phone: +45 8732 2020
Direct phone: +45 8732 2078
Fax: +45 8732 2021


[EMAIL PROTECTED]
www.watertech.dk

-----Oprindelig meddelelse-----
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Hayden Fisher
Sendt: 12. oktober 2006 04:07
Til: [email protected]
Emne: [MI-L] Find closest region using buffer

Hi All,

 

A little help in this area would be greatly appreciated. I am trying to find the closest region to a line or point, the line or point may lie within or outside the region. I have used the buffer function to search out from the line or point. Have done this code for lines, however doesn’t seem to pick anything up.

 

 

Run Command("Select * From tblWaterLinesTemp Where Asset_ID = " + Chr$(34) + tblWaterLinesTemp.Asset_ID + Chr$(34) + " Into tblTemp")

                                                                                                                                   

'Find map reference

str_Map_Reference = ""

For y = 1 to 50000 Step 1

            o_buff = Buffer(tblTemp.obj,20,y,"m")

            Select * from tblMapRef Where tblTemp.Obj intersects o_buff into tblMapRefTemp

                                                                                                                                                           

            If (TableInfo(tblMapRefTemp, TAB_INFO_NROWS) > 0) Then

                        'This will be the closest Map Reference Grid object closest to the geometry

                        str_Map_Reference = tblMapRefTemp.LCC_Map_Ref

                        Exit For

            End If

            Close Table tblMapRefTemp

Next

 

Regards,

Hayden Fisher

[EMAIL PROTECTED]

 

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to