[postgis-users] about postgis gecode and fuzzy search

Min Wang ser.basis at gmail.com
Mon Mar 5 13:38:43 PST 2012


HI
    I am new to postgis geocoding.

    I have installed postgis 2.0 with fuzzy search, and imported the 
tiger data for usa.

    Now for geocoding  non-exist  or some not accurate addresses

e.g:  38 blair mill rod, glenside, pa

its output:

    SELECT g.rating, ST_X(g.geomout) As lon, ST_Y(g.geomout) As lat,
(addy).address As stno, (addy).streetname As street,
(addy).streettypeabbrev As styp, (addy).location As city, 
(addy).stateabbrev As st,(addy).zip
FROM geocode('38 blair mill rod, glenside,pa') As g;
  rating |        lon        |       lat        | stno | street | styp 
|       city       | st |  zip
--------+-------------------+------------------+------+--------+------+------------------+----+-------
      20 | -80.1461480769354 | 39.8912098295989 |   38 | Blair  | Ct   | 
Waynesburg       | PA | 15370
      20 | -76.9528968230038 | 41.1701753366091 |   38 | Blair  | Dr   | 
Montgomery       | PA | 17752
      20 | -80.1461480769354 | 39.8912098295989 |   38 | Blair  | Ct   | 
West Waynesburg  | PA | 15370
      20 | -80.1461480769354 | 39.8912098295989 |   38 | Blair  | Ct   | 
Morrisville      | PA | 15370
      20 | -77.2937928401596 | 40.2205725968637 |   38 | Blair  | Ct   | 
Plainfield       | PA | 17015
      21 | -78.7498163920357 |  40.467390956601 |   38 | Blair  | Rd   | 
Ebensburg        | PA | 15931
      22 | -80.0234909653877 | 41.4774803539524 |   38 | Blair  | Ln   | 
French Creek     | PA | 16311
      24 | -78.9484013917784 | 41.0336884088542 |      | Blair  | Dr   | 
Reynoldsville    | PA | 15851
      25 |  -80.236503518171 | 40.5702521235743 |   38 | Blair  | Aly  | 
South Heights    | PA | 15081
      27 | -75.1757087347985 | 41.0177238645261 |   38 | Blair  | Ct   | 
East Stroudsburg | PA | 18301


none of them is in glenside, PA

what I would like the result is:  return some addresses or center in 
glenside, PA instead of other cities address?

Is it possible?  Is there anyway to specify the weight of the search?

like city: glenside has some weight during the geocode search?

the state : PA has more weight?





thanks


min



More information about the postgis-users mailing list