Do queries on Buffer

376 views
Skip to first unread message

BISMARCK

unread,
Jan 11, 2010, 5:23:02 AM1/11/10
to MapInfo-L
Hi all,

I am trying to do queries on buffers but the results are always coming
no records found.

I have a TAB with a set of plotted nodes. I run a buffer on these
nodes so that each node has a circular buffer of 1km in diameter
around it. Hence there are some circles (buffers) that overlap each
other. All buffers are on a separate record in the same TAB file.

I have another layer with points under the buffer layer, these are
basically customer locations. I am trying to run a query that gets me
only the customers that are located in the common area that falls in
the middle of two overlapping buffers. However i am not getting any
records back.

Any ideas how i can resolve this? Should it be a nested query?

thanks and regards

Eric Gagnon

unread,
Jan 11, 2010, 8:25:29 AM1/11/10
to mapi...@googlegroups.com
Use the sql select query.

select you 2 tables (buffer and points)

where condition:
buffer.Obj Contains points.Obj

you can try it with "within"

you can then save your new result a new table.

Eric

Eric Gagnon,
Spécialiste en SIG / GIS Specialist
Agent d’aménagement / Development Officer
La Commission du district d'aménagement de la Vallée /
La Vallée District Planning Commission
65 boul. Broadway Blvd / Unit 300
Grand-Sault, NB E3Z 2J6
tel: (506) 475-2511
fax: (506) 475-2516

email: cdav...@nb.ainb.com

> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4755 (20100108) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>

BISMARCK

unread,
Jan 11, 2010, 8:44:39 AM1/11/10
to MapInfo-L
thanks for the reply.

the way you suggested will only get me the accounts in one buffer not
the common area between 2 buffers.

daniel


On Jan 11, 2:25 pm, Eric Gagnon <cdave...@nb.aibn.com> wrote:
> Use the sql select query.
>
> select you 2 tables (buffer and points)
>
> where condition:
> buffer.Obj Contains points.Obj
>
> you can try it with "within"
>
> you can then save your new result a new table.
>
> Eric
>
> Eric Gagnon,
> Spécialiste en SIG / GIS Specialist
> Agent d’aménagement / Development Officer
> La Commission du district d'aménagement de la Vallée /
> La Vallée District Planning Commission
> 65 boul. Broadway Blvd / Unit 300
> Grand-Sault, NB  E3Z 2J6
> tel:  (506) 475-2511
> fax:  (506) 475-2516
>

> email: cdave...@nb.ainb.com

Eric Gagnon

unread,
Jan 11, 2010, 8:47:45 AM1/11/10
to mapi...@googlegroups.com
oh you want the common areas..

So if I get it right..

you want to know where your points lands in the buffers that intersect?
Eric Gagnon, 
Spécialiste en SIG / GIS Specialist
Agent d’aménagement / Development Officer
La Commission du district d'aménagement de la Vallée /
La Vallée District Planning Commission
65 boul. Broadway Blvd / Unit 300
Grand-Sault, NB  E3Z 2J6
tel:  (506) 475-2511
fax:  (506) 475-2516
 

email: cdav...@nb.ainb.com


BISMARCK wrote:


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4760 (20100111) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

  

BISMARCK

unread,
Jan 11, 2010, 8:55:25 AM1/11/10
to MapInfo-L
hi Eric,

yes i want to know the points that are in the intersection area of two
overlapping circular buffers. When two circle partially overlap they
create a common area in between - I want a query that can select only
those records that fall in that area.

daniel

On Jan 11, 2:47 pm, Eric Gagnon <cdave...@nb.aibn.com> wrote:
> oh you want the common areas..
>
> So if I get it right..
>
> you want to know where your points lands in the buffers that intersect?
>
> Eric Gagnon,
> Spécialiste en SIG / GIS Specialist
> Agent d’aménagement / Development Officer
> La Commission du district d'aménagement de la Vallée /
> La Vallée District Planning Commission
> 65 boul. Broadway Blvd / Unit 300
> Grand-Sault, NB  E3Z 2J6
> tel:  (506) 475-2511
> fax:  (506) 475-2516
>

> email: cdave...@nb.ainb.com

Eric Gagnon

unread,
Jan 11, 2010, 9:47:06 AM1/11/10
to mapi...@googlegroups.com
ok.. well make a querry on your buffer table using "intersects" in the conditions.

save it as a new table.. then make a query with your new buffer table and your points table.


Eric Gagnon, 
Spécialiste en SIG / GIS Specialist
Agent d’aménagement / Development Officer
La Commission du district d'aménagement de la Vallée /
La Vallée District Planning Commission
65 boul. Broadway Blvd / Unit 300
Grand-Sault, NB  E3Z 2J6
tel:  (506) 475-2511
fax:  (506) 475-2516

BISMARCK

unread,
Jan 11, 2010, 10:27:28 AM1/11/10
to MapInfo-L
hi Eric

it didn't work either. I have been stuck on this problem for ages. I
have also made 2 seperate queries for each buffer zone and then used
the resulting queries to do within and not in statements however it is
telling me "You can only perform dynamic joins on base tables"

regards

daniel

On Jan 11, 3:47 pm, Eric Gagnon <cdave...@nb.aibn.com> wrote:
> ok.. well make a querry on your buffer table using "intersects" in the
> conditions.
>
> save it as a new table.. then make a query with your new buffer table
> and your points table.
>
> Eric Gagnon,
> Spécialiste en SIG / GIS Specialist
> Agent d’aménagement / Development Officer
> La Commission du district d'aménagement de la Vallée /
> La Vallée District Planning Commission
> 65 boul. Broadway Blvd / Unit 300
> Grand-Sault, NB  E3Z 2J6
> tel:  (506) 475-2511
> fax:  (506) 475-2516
>

> email: cdave...@nb.ainb.com

Eric Gagnon

unread,
Jan 11, 2010, 10:48:34 AM1/11/10
to mapi...@googlegroups.com
Well how much buffer do you have.. because I found something.

using set target.. the the split function.. or the erase outside..

will give this result.. after that you can just quesy your points. on that new table
Eric Gagnon, 
Spécialiste en SIG / GIS Specialist
Agent d’aménagement / Development Officer
La Commission du district d'aménagement de la Vallée /
La Vallée District Planning Commission
65 boul. Broadway Blvd / Unit 300
Grand-Sault, NB  E3Z 2J6
tel:  (506) 475-2511
fax:  (506) 475-2516
 

email: cdav...@nb.ainb.com


BISMARCK wrote:


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4761 (20100111) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

  
buffer_1.JPG
buffer_2.JPG

Driver, Greg 9434

unread,
Jan 11, 2010, 10:50:01 AM1/11/10
to mapi...@googlegroups.com
Daniel,

I'd take the approach of creating the overlaps in a separate table and then using this in your SQL select rather than using the buffer table. Have a look at this thread for info on how to create a table to show the overlaps in your buffer layer:

http://tinyurl.com/yketcdd


Once you have a layer of overlaps you can use this in an SQL select to find those points within the overlaps:

Select * From points, overlaps where points.obj within overlaps.obj

HTH

Greg Driver

NOT PROTECTIVELY MARKED


hi Eric

regards

daniel

Information about this E-mail
This email and any files or attachments with it are intended solely for the use of the individual(s) or organisation(s) to whom it is addressed.
It may contain information that is confidential or subject to legal and/or professional privilege.
If you have received this email in error please notify the sender and delete it including any files or attachments from your e-mail account or computer.
Any opinions expressed in this email are those of the individual and not necessarily those of Surrey Police.
Surrey Police monitor incoming and outgoing e-mail.

Williams, Bill (DPS)

unread,
Jan 11, 2010, 4:57:05 PM1/11/10
to mapi...@googlegroups.com
Daniel
Try this feature from the MIF knowledge base
http://testdrive.mapinfo.com/TechSupp/MIProd.nsf/01638a2b8f60af7585257125006ae5e1/c724ce21b9626bb385256a5b0058b902?OpenDocument&Highlight=2,football
I've used it in the past and it works OK.
Bill Williams
Senior Researcher, Statistics & Mapping Section
Parliamentary Library
Department of Parliamentary Services
Parliament House
PO Box 6000
CANBERRA ACT 2600
Telephone : 02 62772513
Email: bill.w...@aph.gov.au

-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of BISMARCK
Sent: Tuesday, 12 January 2010 2:27 AM
To: MapInfo-L
Subject: [MI-L] Re: Do queries on Buffer

BISMARCK

unread,
Jan 12, 2010, 5:52:36 AM1/12/10
to MapInfo-L
Hi all,

I managed to make it work with various suggestions you posted...
thanks a lot :-)

i have now noticed that i can do an interesting query and take the
above a step further.

Same tables, Points, buffer and Locality.

The Locality (town) has the buffer zones in it and the points too.
however, not all points fall within the buffer zones. I want to do a
query that selects all the points that fall outside the buffer zones
but are within the locality.

somethig like this :

select *
from points, buffer, locality,
where points.obj not in buffer.obj and locality.name = "xyz"

thanks,

daniel

On Jan 11, 10:57 pm, "Williams, Bill (DPS)" <Bill.Willi...@aph.gov.au>
wrote:
> Daniel
> Try this feature from the MIF knowledge basehttp://testdrive.mapinfo.com/TechSupp/MIProd.nsf/01638a2b8f60af758525...


> I've used it in the past and it works OK.
> Bill Williams
> Senior Researcher, Statistics & Mapping Section
> Parliamentary Library
> Department of Parliamentary Services
> Parliament House
> PO Box 6000
> CANBERRA ACT 2600
> Telephone :  02 62772513

> Email:   bill.willi...@aph.gov.au

BISMARCK

unread,
Jan 13, 2010, 9:00:19 AM1/13/10
to MapInfo-L
hi,

any idea on this .. i tried various queries but i am getting no
records found answers :/

dan

Gamiz Ribelles, Sergi (Regsa)

unread,
Jan 13, 2010, 12:56:40 PM1/13/10
to mapi...@googlegroups.com
Hi Dan,
Try this tree lines into mapbasic window (example with 10 km buffer)

select * from points where points.obj intersects (select buffer(axisbuffer.obj, 5, 10, "km") from axisbuffer where axisbuffer.ID="my_axis") into qry_near
select * from points where NOT points.obj intersects (select buffer(axisbuffer.obj, 5, 10, "km") from axisbuffer where axisbuffer.ID="my_axis") into qry_far
select * from qry_far where qry_far.ID_locality = any(select qry_near.ID_locality from qry_near)

This works with my tables. It is possible aswell with a third table (Localities, for example)

HTH

Sergi Gàmiz Ribelles (627481954)
REGS DE CATALUNYA S.A. ( www.regsa.cat <http://www.regsa.cat> )
Unitat de Promoció de Regadius i Concentració Parcel·lària
c/General Brito, 6, 5è
25007 Lleida
tel. 973222838 fax 973222627
sga...@regsa.cat <mailto:sga...@regsa.cat>


-----Mensaje original-----
De: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] En nombre de BISMARCK
Enviado el: miércoles, 13 de enero de 2010 15:00
Para: MapInfo-L
Asunto: [MI-L] Re: Do queries on Buffer

Reply all
Reply to author
Forward
0 new messages