[postgis-tickets] [PostGIS] #3968: postgis geocode bug - invalid input syntax for type numeric

PostGIS trac at osgeo.org
Tue Jan 2 06:11:33 PST 2018


#3968: postgis geocode bug - invalid input syntax for type numeric
----------------------------+---------------------------
 Reporter:  hammeryosi      |      Owner:  robe
     Type:  defect          |     Status:  new
 Priority:  medium          |  Milestone:  PostGIS 2.4.3
Component:  tiger geocoder  |    Version:  2.4.x
 Keywords:                  |
----------------------------+---------------------------
 I am using postgis with the tiger extension to geocode addresses in our
 database at Dataline. I have successfully used it for tens of millions of
 addresses before running into this issue with a specific address in North
 Carolina. The geocoder function fails when I specify max_results=1.

 Here’s what happens without specifying it:


 {{{
 select geocode(normalize_address('6922 SURREY RD, FAYETTEVILLE, NC
 28306'))
 }}}



 {{{
 '("(6709,,Surrey,Rd,,,Fayetteville,NC,28306,t,,)",0101000020AD10000027ACEC8778C053C09480511ED27F4140,5)'
 '("(198,,Sarah,Ln,,,Rockfish,NC,28306,t,,)",0101000020AD1000007EBC9E12A8C353C07DC16057347D4140,71)'
 }}}


 And with max_results=1


 {{{
 select geocode(normalize_address('6922 SURREY RD, FAYETTEVILLE, NC
 28306'), 1)
 }}}



 {{{
 ERROR:  invalid input syntax for type numeric: " "
 CONTEXT:  PL/pgSQL function geocode_address(norm_addy,integer,geometry)
 line 204 at assignment
 PL/pgSQL function geocode(norm_addy,integer,geometry) line 14 at FOR over
 SELECT rows
 SQL state: 22P02
 }}}



 This does not happen for other addresses, e.g.,


 {{{
 select geocode(normalize_address('6922 SIMS SCHOOL RD, SIMS, NC 27880'),
 1)
 }}}



 {{{
 '("(6922,,""Sims
 School"",Rd,,,Sims,NC,27880,t,,)",0101000020AD100000D0EB95D6808353C0364C7D2CFEDF4140,0)'
 }}}


 My system info:


 {{{
 'PostgreSQL 10.1, compiled by Visual C++ build 1800, 64-bit'
 'POSTGIS="2.4.1 r16012" PGSQL="100" GEOS="3.6.2-CAPI-1.10.2 4d2925d"
 PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.2, released 2017/09/15"
 LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER'
 }}}


 Any help would be appreciated.
 Thanks!
 Yosi Hammer,
 Data scientist at Dataline (http:\\www.datalinedata.com)

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3968>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list