RE: [MI-L] Combining Intersecting regions in mapbasic

2006-07-17 Thread Peter Horsbøll Møller
Title: RE: [MI-L] Combining Intersecting regions in mapbasic






Boyd,


Could the problem be that you forget to delete the selected records ?

When you find more than one record that intersects with your new polygon, you need to delete all these but one, which is the one, that will hold the new object that is the combination of the other objects.

Something in this way:


'**Select records intersecting into INTERSECTING__RECORDS


Fetch First >From INTERSECTING__RECORDS

Do Until EOT(INTERSECTING__RECORDS)

 nRowID = INTERSECTING__RECORDS.ROWID

 oIntersect = INTERSECTING__RECORDS.OBJ


 oCombined = Combine(oCombined, oIntersect)


 If nFirstRowID = 0 Then

 nFirstRowID = nRowID

 Else

 Delete From INTERSECTING__RECORDS Where ROWID = nRowID

 End If


 Fetch Next From INTERSECTING__RECORDS

Loop


Update INTERSECTING__RECORDS

 Set OBJ = oCombined

 Where ROWID = nFirstRowID


I think that should do it and it should also work only a single record intersects the newly drawn polygon


Peter Horsbøll Møller

GIS Developer, MTM

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 [EMAIL PROTECTED]

http://www.cowi.dk/gis


For enden af regnbuen... - hvordan kommer man dertil og er det overhovedet muligt? 

Læs mere om årets MapInfo konference på www.cowi.dk/mapinfokonference


-Original Message-

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Boyd Townsend

Sent: Sunday, July 16, 2006 2:13 PM

To: mapinfo-l@lists.directionsmag.com

Subject: [MI-L] Combining Intersecting regions in mapbasic






I have a problem which is bugging me to death. I can get this about 80% of the way but it is just not quite right. Having had two previous great pieces of help from this forum, I am sure someone will point me in the right direction. - Please



I attempting, in map basic, to automaticaly have a newly drawn Region combine with an existing region without intervention on the part of the user when the two intersect. I am having no trouble with this using a combine statement along with intersect when the newly drawn region crosses over only one existing region, although I have problems when it crosses two or more existing regions. (Both existing regions comine with the newly drawn one, but the existing regions combined with the new one stay separate). I want all the intersecting regions to automatically combine.



In other words, we have a region which shows some burnt land, we then add an additonaly region of burnt land and the two combine together automatically. If there is two existing separate regions of burnt land and the user draws a new area which intersects both I want them to all to become one, this is where I have a problem.



Any sugestions on overcoming this



Cheers,



Boyd Townsend

CSO

NSW Rural Fire Service



This email message is intended only for the addressee(s) and contains information which may be confidential.

If you are not the intended recipient, please notify the sender and delete this email and any copies or links to this email completely and immediately from your system. Views expressed in this message are those of the individual sender, and are not necessarily the views of the NSW Rural Fire Service.

___

MapInfo-L mailing list

MapInfo-L@lists.directionsmag.com

http://www.directionsmag.com/mailman/listinfo/mapinfo-l





___
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l


Re: [MI-L] Combining Intersecting regions in mapbasic

2006-07-16 Thread Uffe Kousgaard

From: Boyd Townsend [EMAIL PROTECTED]


I am having no trouble with this using a combine statement along with
intersect when the newly drawn region crosses over only one existing
region, although I have problems when it crosses two or more existing
regions. (Both existing regions comine with the newly drawn one, but the
existing regions combined with the new one stay separate). I want all the
intersecting regions to automatically combine.


Try the create object as union . command instead of combining.

Kind regards

Uffe Kousgaard
www.routeware.dk

___
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l