Re: PostGIS: Approximating a house number from street address range

Поиск
Список
Период
Сортировка
От Andy Colson
Тема Re: PostGIS: Approximating a house number from street address range
Дата
Msg-id 4E9622D2.8000902@squeakycode.net
обсуждение исходный текст
Ответ на PostGIS: Approximating a house number from street address range  (René Fournier <m5@renefournier.com>)
Ответы Re: PostGIS: Approximating a house number from street address range
Re: PostGIS: Approximating a house number from street address range
Список pgsql-general
On 10/12/2011 01:01 PM, René Fournier wrote:
> Hi,
>
> I'm developing a reverse-geocoder for Canada. So far, given a lat/lng, I can find the nearest street (line segment),
whichincludes line segment direction and address ranges for both sides of the street. I'm now trying to figure out the
bestway to programmatically approximate the nearest house number to the given lat/lng point. 
>
> Here's an example of a row containing the street data:
>
>      -[ RECORD 1 ]-
>      [...]
>      l_adddirfg | Same Direction
>      l_hnumf    | 3219
>      l_hnuml    | 3235
>      l_stname_c | Breen Road North-west
>      r_adddirfg | Same Direction
>      r_hnumf    | 3224
>      r_hnuml    | 3236
>      r_stname_c | Breen Road North-west
>      the_geom   |
0105000020E610000001000000010200000002000000B0F6990E78885CC088DF2B5F3C8C49400875B39A89885CC0A0BCA6AC4B8C4940
>
>
> So, given a lat/lng coordinate that lies near the "the_geom" line segment, a person could tell visually which side of
thestreet the point is on (left or right side), and how far along the segment it is -- thereby approximating a house
number.For example, if the point lies on the right side, three-quarters down the street, I would use the fields r_hnumf
(rightside, first number) and r_hnuml (right side, last number)...  The street address is probably close to: 
>
>      3232 Breen Road North-west
>
> What I'm looking for is a best practice in either computing/approximating this in PostGIS (which I'm new to), or in
theapplication layer once the row is fetched. 
>
> Any ideas? Thanks!
>
> ...Rene
>
>
>
Is this the only format you have the data in?  If you had two rectangles (one for each side of the street), and each
recthad an address, this would be a lot simpler.  Is that geom a line?  rectangle?  Do you have a layer that has lots
orparcels? 

-Andy



В списке pgsql-general по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: how to key/value iterate in stored function
Следующее
От: Andy Colson
Дата:
Сообщение: Re: PostGIS: Approximating a house number from street address range