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