I'm going to chip in here! Colin and I exchanged a few emails because I couldn't understand his problem but it is repeatable.
I have a table with squares representing 10km grids and if I produce a negative buffer into the cosmetic layer using MI Pro commands it works fine. Select all from the layer, set cosmetic layer editable, leave the MapBasic window open, use the menu 'buffer' option and I get something that looks like this - Create Object As Buffer From Selection Width -0.001 Units "km" Type Spherical Resolution 12 Into Table Cosmetic1 If I then type dim objbuffer as object Create Object As Buffer From Selection Width -0.001 Units "km" Type Spherical Resolution 12 Into variable objbuffer - it fails. I've checked the source table - there are no null object values and the buffer generated is so small it can't be 'wiping out' any polygons. This does appear to be a genuine inconsistency. Colin and I sorted out a way round it - write the value to the cosmetic layer (as per his earlier posting) so this may be a redundant discussion but this bug (feature?) does close off what might be a neat coding solution for him. Not sure if this is IMHO or HTH so I'll say both! Paul Crisp Syntegra Direct: 0191 461 4522 Mobile: 0776 414 3762 Fax: (0191) 461 1959 Innovation Place Metro Riverside Park Delta Bank Road Gateshead Tyne & Wear NE11 9DJ -----Original Message----- From: Jacques Paris [mailto:[EMAIL PROTECTED]] Sent: 14 January 2002 14:09 To: Colin Henderson; [EMAIL PROTECTED] Subject: RE: MI-L SUM Problems creating buffer in MapBasic Well, I stand corrected. Indeed "Create object as buffer" will accept negative buffers. Having retraced my operations, I just found out that the incriminating message "Warning: Operation did not produce a result. No errors detected" that I obtained on my first test, means simply that the object was completely wiped out by the buffering because of the size of the width. Reducing sufficiently its size produced a result. It is interesting to know that directing the object to a variable works also very well. However the conditions for producing a result are different. If the buffer width is such as that some object is created (not ALL polygons are wiped out by buffering), then the into TABLE will work. Note: as the buffer object thus created is a single multiple-polygon region, and as there is one "polygon" for each original one, the buffer object will contain some "null" polygons (area=0) If the buffer width is such as that ONE of the table polygons is wiped out by buffering, then into VARIABLE will NOT work. These rules can be extended to a table containing multiple-polygon regions. If only a one of the polygons of a multi-polygon region is wiped out, into Variable will not work, while into Table will work! Jacques Paris e-mail [EMAIL PROTECTED] MapBasic-MapInfo support http://www.paris-pc-gis.com -----Original Message----- From: Colin Henderson [mailto:[EMAIL PROTECTED]] Sent: January 14, 2002 07:47 To: 'Jacques Paris'; '[EMAIL PROTECTED]' Subject: RE: MI-L SUM Problems creating buffer in MapBasic This was also my first suspicion! However the command ("Create Object As Buffer") works perfectly when the negative buffer is being created into a table. Yet, when you try and put it into a variable it does not work - surely if it can be created into a table then there is no real reason why it can't be created into a variable! Any further thoughts? Colin Henderson -----Original Message----- From: Jacques Paris [mailto:[EMAIL PROTECTED]] Sent: 14 January 2002 12:41 To: Colin Henderson; [EMAIL PROTECTED] Subject: RE: MI-L SUM Problems creating buffer in MapBasic A precision is necessary: you must specify that your comments refer to the "Create Object as Buffer" statement which does not support negative width (internal buffers) at the opposite of the buffer() function. Reading the Help file would confirm that: negative values can be specified in the buffer() function only. If sometimes, one must read the help file with circumspection and between lines, I have found that what is not said is very important, such as in this case. Jacques Paris e-mail [EMAIL PROTECTED] MapBasic-MapInfo support http://www.paris-pc-gis.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Colin Henderson Sent: January 14, 2002 04:09 To: '[EMAIL PROTECTED]' Subject: MI-L SUM Problems creating buffer in MapBasic Thanks to all who helped with this issue, though there was no definite answer to this problem I was offered a work around which whilst not entirely desirable, certainly does the trick. Here is a summary of the problem and its workaround: PROBLEM I needed to create an internal buffer of objects in a table, this could be achieved on my data using the buffer menu option, I did not however want the buffer created in my original table - nor did I want to create a specific buffer table! I also needed the buffer to be created using MapBasic code as part of a program. The problem occurs when trying to create a buffer into an object variable, when doing this MapInfo throws up the following warning message: "Warning: Operation did not produce a result. No errors detected" The object variable is properly initialised and the MB statement is correct. SOLUTION The simplest solution came from Paul Crisp: "You COULD just do something like this (because it works) Set the cosmetic layer editable Create the buffer into the cosmetic layer Fish the object out of the cosmetic layer Clear the cosmetic layer out and set it editable off." ISSUES There is no feasible reason why the code and data I am using will cause MapInfo to produce the error as the exact same data and statement will allow a buffer to be created in a separate table or the cosmetic layer. I feel this is something that requires further investigation! Kind Regards, Colin Henderson GI Developer Ordnance Survey Romsey Road Southampton SO16 4GU *************************************************************** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *************************************************************** _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body. *************************************************************** This email/attachment(s) has been virus checked upon receipt at the OS and is free of all known viruses. *************************************************************** *************************************************************** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *************************************************************** _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body. ******************************************************************** This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.syntegra.com ******************************************************************** _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body.
