Regional Concept

M

morc

Hi, i was wondering if anybody had any idea how to go about writing
code that would take someones adress and determine the names an
adresses of their neighjbours?

Is this possible??

thanks
-morc
 
O

Oliver Wong

morc said:
Hi, i was wondering if anybody had any idea how to go about writing
code that would take someones adress and determine the names an
adresses of their neighjbours?

Is this possible??

For starters, to do this, you would need access to a database of
everyone's name and address. If you can't get access to this, might as well
scrap the project right now. =P

- Oliver
 
C

Charles Hottel

morc said:
Hi, i was wondering if anybody had any idea how to go about writing
code that would take someones adress and determine the names an
adresses of their neighjbours?

Is this possible??

thanks
-morc

goggle find neighbors
 
F

Furious George

Oliver said:
For starters, to do this, you would need access to a database of
everyone's name and address. If you can't get access to this, might as well
scrap the project right now. =P

It's much easier than you are suggesting. Assuming access to an
appropriately set up database, the proper query would be:

SELECT p.name , p.address FROM people AS p , people AS q WHERE
p.neighborhood=q.neighborhood AND p.address<>q.address AND q.address=?
 
O

Oliver Wong

Furious George said:
It's much easier than you are suggesting. Assuming access to an
appropriately set up database, the proper query would be:

SELECT p.name , p.address FROM people AS p , people AS q WHERE
p.neighborhood=q.neighborhood AND p.address<>q.address AND q.address=?

The hard part isn't constructing the SQL query. The hard part is getting
the database. Where are you going to get a database containing the names and
addresses of everybody?

- Oliver
 
C

Chris Uppal

Oliver said:
The hard part isn't constructing the SQL query. The hard part is
getting the database. Where are you going to get a database containing
the names and addresses of everybody?

Well, given a name and address like

A Person
28, Garden Villas
Entbury-on-the-Wash

it isn't too difficult to come up with addresses of neighbours: 26 Garden
Villas and 30 Garden Villas -- not to mention the people across the road. Of
course, that isn't totally reliable (I know streets where the opposite side of
the road has a different name, let alone just following a different numbering
convention), but it'll usually work. Another problem is that it won't give the
the name of the person living at that number. There are database you can buy
which will provide that information (depending on where you -- or your
victims -- are), but I can't think of a single valid use for the names of the
neighbours so I wouldn't mention them here even if I did happen to know where
they could be bought.

-- chris
 
O

Oliver Wong

Chris Uppal said:
Well, given a name and address like

A Person
28, Garden Villas
Entbury-on-the-Wash

it isn't too difficult to come up with addresses of neighbours: 26 Garden
Villas and 30 Garden Villas -- not to mention the people across the road.
Of
course, that isn't totally reliable (I know streets where the opposite
side of
the road has a different name, let alone just following a different
numbering
convention), but it'll usually work.

There are also corner cases... literally:

|
A | | B
| Foo St. |
C | | 28 Bar St. D
-----| |----------------
Bar St.
-----| |-------
| |
E | | F


What are the address of A, B, C, D, E and F?
Another problem is that it won't give the
the name of the person living at that number. There are database you can
buy
which will provide that information (depending on where you -- or your
victims -- are), but I can't think of a single valid use for the names of
the
neighbours so I wouldn't mention them here even if I did happen to know
where
they could be bought.

Right, for the DB, it was primarily the name-address association I was
concerned about. I realize though that I had mis-read the original problem
statement. I had assumed that the input was a name, not an address.

- Oliver
 
F

Furious George

You are correct. The OP posed a poorly defined problem. What is a
"neighbor"? What is an "address"? etc. etc. I ducked all those
problems by assuming a properly setup database.

Since the OP did not define what s/he thinks is a neighbor, your
examples may or may not be right. Maybe 26 Garden Villa and 30 Garden
Villa are not right and the neighbors are the people who live on the
same floor of the same building as A Person.

Tricky. But since the OP did not define "neighbor" how do you know he
wants them included.
There are also corner cases... literally:

|
A | | B
| Foo St. |
C | | 28 Bar St. D
-----| |----------------
Bar St.
-----| |-------
| |
E | | F


What are the address of A, B, C, D, E and F?

Tricky. But since the OP did not define "neighbor" how do you know he
wants them included.
 
E

Eric Sosman

Chris said:
Oliver Wong wrote:




Well, given a name and address like

A Person
28, Garden Villas
Entbury-on-the-Wash

it isn't too difficult to come up with addresses of neighbours: 26 Garden
Villas and 30 Garden Villas -- not to mention the people across the road. Of

Sir Henry Baskerville
Baskerville Hall
 
C

Chris Uppal

Furious said:
Since the OP did not define what s/he thinks is a neighbor, your
examples may or may not be right. Maybe 26 Garden Villa and 30 Garden
Villa are not right and the neighbors are the people who live on the
same floor of the same building as A Person.

Yes, if you take vertical relationships into account then that does add
another, um, dimension to the problem ;-)

Tricky. But since the OP did not define "neighbor" how do you know he
wants them included.

I saw it the other way around. This problem doesn't have a precise solution.
Not even given a good quality GIS database. E.g. two people who live close to
each other but are separated by a river, a motorway, or even just a busy
street, might not count as neighbours. OTOH, a farmer in a remote area might
consider the farm on the opposite side of the valley to be his "next-door"
neighbour even though a river ran down the valley. So, the approach is to
assume a workable approximation; one which is simple to implement (albeit
unreliable).

And if the customer finds that unacceptable, then it's up to /them/ to define
what they mean more precisely -- which, with near 100% certainty, they won't be
able to do. Not unless they are specialists in the domain, but then they'd be
able to answer all of the OP's question; and indeed the answer would be part of
the functional spec, not something the designer or programmer was allowed or
expected to invent.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,268
Messages
2,571,095
Members
48,773
Latest member
Kaybee

Latest Threads

Top