[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Tiger geocoder - error instead of null when	unlocatable
From:       Matthew Syphus <MSyphus () lhtac ! org>
Date:       2016-02-08 19:10:11
Message-ID: 9A88082E9F46DF469E9FBDE7788104470125ECCC () lhtacexch
[Download RAW message or body]

Bug has been created, #3451<https://trac.osgeo.org/postgis/ticket/3451>.

Thanks again.

From: postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] On Behalf Of \
                Regina Obe
Sent: Monday, February 08, 2016 11:18 AM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] Tiger geocoder - error instead of null when unlocatable

Matthew,

Now that you mention it I have run into the same issue myself especially since county \
is such a common table name.

Go ahead and enter a ticket to request schema qualifying.  It has been something I've \
been thinking of doing anyway.

Thanks,
Regina

From: postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] On Behalf Of \
                Matthew Syphus
Sent: Monday, February 08, 2016 1:09 PM
To: PostGIS Users Discussion \
                <postgis-users@lists.osgeo.org<mailto:postgis-users@lists.osgeo.org>>
Subject: Re: [postgis-users] Tiger geocoder - error instead of null when unlocatable

Regina,
Thank you for looking into this.  Before entering a bug I did some other checks and \
believe I've found the cause.

The function in question creates a query without schema-qualified table names.
ERROR:  column co.statefp does not exist
LINE 2: ...cefp = p.placefp)  LEFT JOIN county co ON ('25' = co.statefp...
                                                             ^
CONTEXT:  PL/pgSQL function geocode_address(norm_addy,integer,geometry) line 383 at \
FOR over EXECUTE statement PL/pgSQL function geocode(norm_addy,integer,geometry) line \
14 at FOR over SELECT rows PL/pgSQL function geocode(character \
varying,integer,geometry) line 26 at RETURN QUERY

I have a county table in another schema (also in the search path).  After renaming \
that other table it appeared to work.  In fact, it returned locations (not just null) \
where it errored out before, meaning it isn't just unlocatable addresses; it is \
affecting all output. Also, it looks like the table names in the tiger and tiger_data \
schemas are not obscure (a good thing) and therefore may be in use somewhere else in \
a database (a bad thing).

Can the extension be updated so the generated scripts and all functions always use \
schema-qualified table names?  I realize that might be a tall order, but it seems \
very easy for table names to collide within the search path.  Should I still enter \
this as a bug?

Thanks for the excellent work on geocoding (and PostGIS); the address standardizing, \
data import, and geocode results are impressive.

Matthew

From: postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] On Behalf Of \
                Regina Obe
Sent: Sunday, February 07, 2016 8:45 AM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] Tiger geocoder - error instead of null when unlocatable

Matthew,

Can you ticket this one in our ticket tracker - http://postgis.net/support/

Unfortunately I don't have Idaho data loaded in my instance and can't trigger the \
problem with the data I have just by replacing the state.

It does sound like a bug though if other addresses work.  I'll try to take a look at \
it next week while I'm looking at other tiger issues.

Thanks,
Regina
http://www.postgis.us
http://postgis.net





From: postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] On Behalf Of \
                Matthew Syphus
Sent: Sunday, February 07, 2016 12:43 AM
To: PostGIS Users Discussion \
                <postgis-users@lists.osgeo.org<mailto:postgis-users@lists.osgeo.org>>
Subject: Re: [postgis-users] Tiger geocoder - error instead of null when unlocatable

Apologies for not including version details originally.

"postgis_full_version"
"POSTGIS="2.2.1 r14555" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.8.0, 6 March 2012" \
GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.7.6" LIBJSON="0.11" TOPOLOGY \
RASTER"

PostgreSQL 9.5.0
CentOS 6.5

mst

From: postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] On Behalf Of \
                Matthew Syphus
Sent: Saturday, February 06, 2016 9:06 PM
To: postgis-users@lists.osgeo.org<mailto:postgis-users@lists.osgeo.org>
Subject: [postgis-users] Tiger geocoder - error instead of null when unlocatable

After following the instructions (several times) and apparently successfully \
installing tiger geocoder and the tiger data for Idaho, I keep getting an error when \
the geocoder can't find an address.

With a locatable address it works just fine.
SELECT * FROM geocode('3300 state st, boise, id 83703')

When an address is not locatable, I assume it should return null (and move on to the \
next in the batch). Instead, it returns an error:

SELECT * FROM geocode('3300 state st, neverland, id 9876543210')

---------------------------------------

ERROR:  column co.statefp does not exist
LINE 2: ...cefp = p.placefp)  LEFT JOIN county co ON ('16' = co.statefp...
                                                             ^
QUERY:  SELECT DISTINCT ON (sub.predirabrv,sub.fename,COALESCE(sub.suftypabrv, \
sub.pretypabrv) ,sub.sufdirabrv,coalesce(p.name,zip.city,cs.name,co.name),s.stusps,sub.zip) \
sub.predirabrv   as fedirp,    sub.fename,    COALESCE(sub.suftypabrv, \
sub.pretypabrv)   as fetype,    sub.sufdirabrv   as fedirs,    \
coalesce(p.name,zip.city,cs.name,co.name)::varchar as place,    s.stusps as state,    \
sub.zip as zip,    interpolate_from_address($1, sub.fromhn,    ...


It doesn't seem to matter which address element causes the problem, the error is the \
same and it kills the query.  Is there some error handling that is getting missed? \
The examples I've seen look like it just returns null.  Thank you for any help.

mst






________________________________

This email has been scanned for spam and viruses by Proofpoint Essentials cloud email \
security - click here<https://us1.proofpointessentials.com/index01.php?mod_id=11&mod_option=logitem&mail_id=Z07c%2BrvT0fHg&rid=6780640&report=1> \
to report this email as spam.





________________________________

This email has been scanned for spam and viruses by Proofpoint Essentials cloud email \
security - click here<https://us1.proofpointessentials.com/index01.php?mod_id=11&mod_option=logitem&mail_id=fwStnh5A4b6W&rid=6780640&report=1> \
to report this email as spam.





________________________________

This email has been scanned for spam and viruses by Proofpoint Essentials cloud email \
security - click here<https://us1.proofpointessentials.com/index01.php?mod_id=11&mod_option=logitem&mail_id=jhne-RR8qQM1&rid=6780640&report=1> \
to report this email as spam.


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
span.EmailStyle20
	{mso-style-type:personal;
	font-family:"Arial","sans-serif";
	color:windowtext;}
span.EmailStyle21
	{mso-style-type:personal;
	font-family:"Arial","sans-serif";
	color:#1F497D;}
span.EmailStyle22
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.EmailStyle23
	{mso-style-type:personal;
	font-family:"Arial","sans-serif";
	color:#1F497D;}
span.EmailStyle24
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.EmailStyle25
	{mso-style-type:personal-reply;
	font-family:"Arial","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Bug \
has been created, <a \
href="https://trac.osgeo.org/postgis/ticket/3451">#3451</a>.<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks \
again.<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
postgis-users [mailto:postgis-users-bounces@lists.osgeo.org] <b>On Behalf Of \
</b>Regina Obe<br> <b>Sent:</b> Monday, February 08, 2016 11:18 AM<br>
<b>To:</b> 'PostGIS Users Discussion'<br>
<b>Subject:</b> Re: [postgis-users] Tiger geocoder - error instead of null when \
unlocatable<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Matthew,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Now that you mention it I have run \
into the same issue myself especially since county is such a common table \
name.<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span \
style="color:#1F497D">Go ahead and enter a ticket to request schema qualifying.&nbsp; \
It has been something I've been thinking of doing anyway.<o:p></o:p></span></p> <p \
class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p> <p \
class="MsoNormal"><span style="color:#1F497D">Regina<o:p></o:p></span></p> <p \
class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b>From:</b> postgis-users [<a \
href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>]
 <b>On Behalf Of </b>Matthew Syphus<br>
<b>Sent:</b> Monday, February 08, 2016 1:09 PM<br>
<b>To:</b> PostGIS Users Discussion &lt;<a \
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>&gt;<br> \
<b>Subject:</b> Re: [postgis-users] Tiger geocoder - error instead of null when \
unlocatable<o:p></o:p></p> </div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Regina,<o:p></o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Thank \
you for looking into this.&nbsp; Before entering a bug I did some other checks and \
believe I&#8217;ve found the cause.<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">The \
function in question creates a query without schema-qualified table names.&nbsp; \
<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;;color:#1F497D">ERROR:&nbsp; column co.statefp does not \
exist<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#1F497D">LINE 2: \
...cefp = p.placefp)&nbsp; LEFT JOIN county co ON ('25' = \
co.statefp...<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
^<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;;color:#1F497D">CONTEXT:&nbsp; PL/pgSQL function \
geocode_address(norm_addy,integer,geometry) line 383 at FOR over EXECUTE \
statement<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#1F497D">PL/pgSQL \
function geocode(norm_addy,integer,geometry) line 14 at FOR over SELECT \
rows<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#1F497D">PL/pgSQL \
function geocode(character varying,integer,geometry) line 26 at RETURN \
QUERY<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">I \
have a </span><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;;color:#1F497D">county</span><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"> \
table in another schema (also in the search path).&nbsp; After renaming that other \
table it  appeared to work.&nbsp; In fact, it returned locations (not just null) \
where it errored out before, meaning it isn&#8217;t just unlocatable addresses; it is \
affecting all output. Also, it looks like the table names in the </span><span \
style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;;color:#1F497D">tiger</span><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"> \
and </span><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;;color:#1F497D">tiger_data</span><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"> \
schemas are not obscure (a good thing) and therefore may be in use somewhere else in  \
a database (a bad thing).<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Can \
the extension be updated so the generated scripts and all functions always use \
schema-qualified table names?&nbsp; I realize that might  be a tall order, but it \
seems very easy for table names to collide within the search path.&nbsp; Should I \
still enter this as a bug?&nbsp; <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks \
for the excellent work on geocoding (and PostGIS); the address standardizing, data \
import, and geocode results are impressive.<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Matthew<o:p></o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
postgis-users [<a href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>]
 <b>On Behalf Of </b>Regina Obe<br>
<b>Sent:</b> Sunday, February 07, 2016 8:45 AM<br>
<b>To:</b> 'PostGIS Users Discussion'<br>
<b>Subject:</b> Re: [postgis-users] Tiger geocoder - error instead of null when \
unlocatable<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><span \
style="color:#1F497D">Matthew,<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span style="color:#1F497D">Can you ticket \
this one in our ticket tracker - <a \
href="http://postgis.net/support/">http://postgis.net/support/</a><o:p></o:p></span></p>
 <p class="MsoNormal" style="margin-left:.5in"><span \
style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="color:#1F497D">Unfortunately I don't have Idaho \
data loaded in my instance and can't trigger the problem with the data I have just by \
replacing the state.<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span style="color:#1F497D">It does sound \
like a bug though if other addresses work. &nbsp;I'll try to take a look at it next \
week while I'm looking at other tiger issues.<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span \
style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span \
style="color:#1F497D">Regina<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="color:#1F497D"><a \
href="http://www.postgis.us">http://www.postgis.us</a><o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span style="color:#1F497D"><a \
href="http://postgis.net">http://postgis.net</a><o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span \
style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span \
style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal" style="margin-left:.5in"><span \
style="color:#1F497D"><o:p>&nbsp;</o:p></span></p> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:1.0in"><b>From:</b> postgis-users [<a \
href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>]
 <b>On Behalf Of </b>Matthew Syphus<br>
<b>Sent:</b> Sunday, February 07, 2016 12:43 AM<br>
<b>To:</b> PostGIS Users Discussion &lt;<a \
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>&gt;<br> \
<b>Subject:</b> Re: [postgis-users] Tiger geocoder - error instead of null when \
unlocatable<o:p></o:p></p> </div>
</div>
<p class="MsoNormal" style="margin-left:1.0in"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Apologies \
for not including version details originally.<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">&quot;postgis_full_version&quot;<o:p></o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">&quot;POSTGIS=&quot;2.2.1 \
r14555&quot; GEOS=&quot;3.5.0-CAPI-1.9.0 r4084&quot; PROJ=&quot;Rel. 4.8.0, 6 March \
2012&quot; GDAL=&quot;GDAL 1.10.1, released 2013/08/26&quot; LIBXML=&quot;2.7.6&quot; \
LIBJSON=&quot;0.11&quot; TOPOLOGY RASTER&quot;<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">PostgreSQL \
9.5.0<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">CentOS \
6.5<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">mst<o:p></o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:1.0in"><b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
postgis-users [<a href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>]
 <b>On Behalf Of </b>Matthew Syphus<br>
<b>Sent:</b> Saturday, February 06, 2016 9:06 PM<br>
<b>To:</b> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
 <b>Subject:</b> [postgis-users] Tiger geocoder - error instead of null when \
unlocatable<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal" style="margin-left:1.0in"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">After \
following the instructions (several times) and apparently successfully installing \
tiger geocoder and the tiger data for Idaho, I keep getting  an error when the \
geocoder can&#8217;t find an address.<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">With a \
locatable address it works just fine.<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;">SELECT * FROM geocode('3300 state st, boise, id \
83703')<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">When an \
address is not locatable, I assume it should return null (and move on to the next in \
the batch).<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Instead, \
it returns an error:<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;">SELECT * FROM geocode(&#8216;3300 state st, neverland, id \
9876543210&#8217;)<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;">---------------------------------------<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;">ERROR:&nbsp; column co.statefp does not exist<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;">LINE 2: ...cefp = \
p.placefp)&nbsp; LEFT JOIN county co ON ('16' = co.statefp...<o:p></o:p></span></p> \
<p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;">QUERY:&nbsp; SELECT DISTINCT ON \
(sub.predirabrv,sub.fename,COALESCE(sub.suftypabrv, sub.pretypabrv) \
,sub.sufdirabrv,coalesce(p.name,zip.city,cs.name,co.name),s.stusps,sub.zip)&nbsp;&nbsp;&nbsp;
  sub.predirabrv&nbsp;&nbsp; as fedirp,&nbsp;&nbsp;&nbsp; \
sub.fename,&nbsp;&nbsp;&nbsp; COALESCE(sub.suftypabrv, sub.pretypabrv)&nbsp;&nbsp; as \
fetype,&nbsp;&nbsp;&nbsp; sub.sufdirabrv&nbsp;&nbsp; as fedirs,&nbsp;&nbsp;&nbsp; \
coalesce(p.name,zip.city,cs.name,co.name)::varchar as place,&nbsp;&nbsp;&nbsp; \
s.stusps as state,&nbsp;&nbsp;&nbsp; sub.zip as zip,&nbsp;&nbsp;&nbsp; \
interpolate_from_address($1,  sub.fromhn,&nbsp;&nbsp;&nbsp; \
&#8230;<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">It \
doesn&#8217;t seem to matter which address element causes the problem, the error is \
the same and it kills the query.&nbsp; Is there some error handling that  is getting \
missed? The examples I&#8217;ve seen look like it just returns null.&nbsp; Thank you \
for any help.<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">mst<o:p></o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:12.0pt;font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> <p \
style="margin-left:1.0in">&nbsp;<o:p></o:p></p> <div style="margin-left:.5in">
<div style="margin-left:.5in">
<div class="MsoNormal" align="center" style="text-align:center"><span \
style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"> \
<hr size="2" width="100%" align="center"> </span></div>
</div>
</div>
<p style="margin-left:1.0in">This email has been scanned for spam and viruses by \
Proofpoint Essentials cloud email security - click <a \
href="https://us1.proofpointessentials.com/index01.php?mod_id=11&amp;mod_option=logitem&amp;mail_id=Z07c%2BrvT0fHg&amp;rid=6780640&amp;report=1">
 here</a> to report this email as spam.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:1.0in"><span \
style="font-size:12.0pt;font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal" \
style="margin-left:.5in"><span style="font-size:12.0pt;font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> <p \
style="margin-left:.5in">&nbsp;<o:p></o:p></p> <div style="margin-left:.5in">
<div class="MsoNormal" align="center" style="text-align:center"><span \
style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"> \
<hr size="2" width="100%" align="center"> </span></div>
</div>
<p style="margin-left:.5in">This email has been scanned for spam and viruses by \
Proofpoint Essentials cloud email security - click <a \
href="https://us1.proofpointessentials.com/index01.php?mod_id=11&amp;mod_option=logitem&amp;mail_id=fwStnh5A4b6W&amp;rid=6780640&amp;report=1">
 here</a> to report this email as spam.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><span \
style="font-size:12.0pt;font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> <p>&nbsp;<o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center"><span \
style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"> \
<hr size="2" width="100%" align="center"> </span></div>
<p>This email has been scanned for spam and viruses by Proofpoint Essentials cloud \
email security - click <a \
href="https://us1.proofpointessentials.com/index01.php?mod_id=11&amp;mod_option=logitem&amp;mail_id=jhne-RR8qQM1&amp;rid=6780640&amp;report=1">
 here</a> to report this email as spam.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> </div>
</body>
</html>


[Attachment #4 (unknown)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic