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

List:       postgis-users
Subject:    Re: [postgis-users] Postgis 2.2.0 With TIGER data
From:       Greg Nawrocki <greg () asgdata ! com>
Date:       2013-11-20 22:13:43
Message-ID: CEB28C49.32860%greg () asgdata ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Yes! Thanks Regina,

You know, I kept looking at that function and convinced myself that it was
for loading the entire country as opposed to individual states.
I'm getting Lat / Long now.

-- Greg

From:  Paragon Corporation <lr@pcorp.us>
Reply-To:  PostGIS Users Discussion <postgis-users@lists.osgeo.org>
Date:  Wednesday, November 20, 2013 2:27 PM
To:  'PostGIS Users Discussion' <postgis-users@lists.osgeo.org>
Subject:  Re: [postgis-users] Postgis 2.2.0 With TIGER data

Greg,
Did you run the nation script routine?
http://postgis.net/docs/manual-dev/Loader_Generate_Nation_Script.html
 
That's the first step needed.  Should actually be done before you load the
other tables.
 
Hope that helps,
Regina
http://www.postgis.us
http://postgis.net
 


From: postgis-users-bounces@lists.osgeo.org
[mailto:postgis-users-bounces@lists.osgeo.org] On Behalf Of Greg Nawrocki
Sent: Wednesday, November 20, 2013 12:10 PM
To: postgis-users@lists.osgeo.org
Subject: [postgis-users] Postgis 2.2.0 With TIGER data


Sorry about the noob question, but I am stuck. I am trying to get to a point
where I can geocode (get latitude and longitude) from an address.

I build and install Postgres 9.3 and Postgis 2.2.0

I create a database named "geocode" and create the proper extensions,
grants, search paths:

/usr/local/pgsql/bin/psql -d geocode -c "CREATE EXTENSION postgis"
/usr/local/pgsql/bin/psql -d geocode -c "CREATE EXTENSION postgis_topology"
/usr/local/pgsql/bin/psql -d geocode -c "CREATE EXTENSION fuzzystrmatch;"
/usr/local/pgsql/bin/psql -d geocode -c "CREATE EXTENSION
postgis_tiger_geocoder;"
/usr/local/pgsql/bin/psql -d geocode -c "CREATE EXTENSION
address_standardizer;"
/usr/local/pgsql/bin/psql geocode -f
/usr/local/pgsql/share/contrib/postgis-2.2/legacy.sql

/usr/local/pgsql/bin/psql -d geocode -c "GRANT ALL ON geometry_columns TO
PUBLIC;"
/usr/local/pgsql/bin/psql -d geocode -c "GRANT ALL ON geography_columns TO
PUBLIC;"
/usr/local/pgsql/bin/psql -d geocode -c "GRANT ALL ON spatial_ref_sys TO
PUBLIC;"

/usr/local/pgsql/bin/psql -d geocode -c "ALTER DATABASE geocode SET
search_path=public, tiger;"

Here's some information on the resulting environment:

============================================================================
=============
"SELECT version();"
                                                   version
----------------------------------------------------------------------------
----------------------------------
 PostgreSQL 9.3.0 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.7.2
20120921 (Red Hat 4.7.2-2), 64-bit
(1 row)

"SELECT postgis_full_version();"
                   
postgis_full_version
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-
 POSTGIS="2.2.0dev r12128" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March
2012" GDAL="GDAL 1.9.1, released 2012/05/15" LIBXML="2.7.8" TOPOLOGY RASTER
(1 row)

"SELECT name, default_version,installed_version FROM pg_available_extensions
WHERE name LIKE 'postgis%';"
          name          | default_version | installed_version
------------------------+-----------------+-------------------
 postgis_tiger_geocoder | 2.2.0dev        | 2.2.0dev
 postgis                | 2.2.0dev        | 2.2.0dev
 postgis_topology       | 2.2.0dev        | 2.2.0dev
(3 rows)
============================================================================
==============

The pprint_addy() and normalize_address() functions work as expected in the
examples I've seen.

I generate, modify and run a tiger load script to retrieve TIGER data for my
state:
/usr/local/pgsql/bin/psql -d geocode -c "SELECT
loader_generate_script(ARRAY['IL'], 'sh');" -A -o ILdata.sh

Everything appears to load normally. The only anomaly I see is the following
message when installing the various featnames.dbf files:
XXXXXXX_featnames.dbf: shape (.shp) or index files (.shx) can not be opened,
will just import attribute data.
However, from what I can see those files contain no shape information so I
do not think this is an error.

I run the install_missing_indexes() function which appears to work.

However, when I attempt to geocode I get an immediate empty return.

/usr/local/pgsql/bin/psql -d geocode -c "SELECT g.rating, ST_X(g.geomout) As
lon, ST_Y(g.geomout) As lat FROM geocode('810 W Main St, West Dundee, IL
60118') As g;"
 rating | lon | lat
--------+-----+-----
(0 rows)

At this point, I'm lostŠ Any help greatly appreciated.

-- Greg









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


[Attachment #5 (text/html)]

<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; \
font-family: Calibri, sans-serif; "><div><br></div><div>Yes! Thanks \
Regina,</div><div><br></div><div>You know, I kept looking at that function and \
convinced myself that it was for loading the entire country as opposed to individual \
states.</div><div>I'm getting Lat / Long now.</div><div><br></div><div>-- \
Greg</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div \
style="font-family:Calibri; font-size:11pt; text-align:left; color:black; \
BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; \
PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: \
medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Paragon \
Corporation &lt;<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>&gt;<br><span \
style="font-weight:bold">Reply-To: </span> PostGIS Users Discussion &lt;<a \
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>&gt;<br><span \
style="font-weight:bold">Date: </span> Wednesday, November 20, 2013 2:27 PM<br><span \
style="font-weight:bold">To: </span> 'PostGIS Users Discussion' &lt;<a \
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>&gt;<br><span \
style="font-weight:bold">Subject: </span> Re: [postgis-users] Postgis 2.2.0 With \
TIGER data<br></div><div><br></div><div><meta content="text/html; charset=us-ascii" \
http-equiv="Content-Type"><meta name="GENERATOR" content="MSHTML \
11.00.9600.16428"><div style="WORD-WRAP: break-word; FONT-SIZE: 14px; FONT-FAMILY: \
Calibri, sans-serif; COLOR: rgb(0,0,0); -webkit-nbsp-mode: space; -webkit-line-break: \
after-white-space"><div dir="ltr" align="left"><span class="221482420-20112013"><font \
size="4">Greg,</font></span></div><div dir="ltr" align="left"><span \
class="221482420-20112013"><font size="4">Did you run the nation script \
routine?</font></span></div><div dir="ltr" align="left"><span \
class="221482420-20112013"><font size="4"><a \
href="http://postgis.net/docs/manual-dev/Loader_Generate_Nation_Script.html">http://po \
stgis.net/docs/manual-dev/Loader_Generate_Nation_Script.html</a></font></span></div><div \
dir="ltr" align="left"><span class="221482420-20112013"><font \
size="4"></font></span>&nbsp;</div><div dir="ltr" align="left"><span \
class="221482420-20112013"><font size="4">That's the first step needed.&nbsp; Should \
actually be done before you load the other  tables.</font></span></div><div dir="ltr" \
align="left"><span class="221482420-20112013"><font \
size="4"></font></span>&nbsp;</div><div dir="ltr" align="left"><span \
class="221482420-20112013"><font size="4">Hope that helps,</font></span></div><div \
dir="ltr" align="left"><span class="221482420-20112013"><font \
size="4">Regina</font></span></div><div dir="ltr" align="left"><span \
class="221482420-20112013"><font size="4"><a \
href="http://www.postgis.us">http://www.postgis.us</a></font></span></div><div \
dir="ltr" align="left"><span class="221482420-20112013"><font size="4"><a \
href="http://postgis.net">http://postgis.net</a></font></span></div><div dir="ltr" \
align="left"><span class="221482420-20112013"><font \
size="4"></font></span>&nbsp;</div><br><div lang="en-us" class="OutlookMessageHeader" \
dir="ltr" align="left"><hr tabindex="-1"><font size="2" face="Tahoma"><b>From:</b> <a \
href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a>
 [<a href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>] \
<b>On Behalf Of </b>Greg Nawrocki<br><b>Sent:</b> Wednesday, November 20, 2013 12:10 \
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] Postgis 2.2.0 With TIGER \
data<br></font><br></div><div></div><div><br></div><div>Sorry about the noob \
question, but I am stuck. I am trying to get to a point where I can geocode (get \
latitude and longitude) from an address.</div><div><br></div><div>I build and install \
Postgres 9.3 and Postgis 2.2.0</div><div><br></div><div>I create a database named \
"geocode" and create the proper extensions, grants, search \
paths:</div><div><br></div><div><div>/usr/local/pgsql/bin/psql -d geocode -c "CREATE \
EXTENSION postgis"</div><div>/usr/local/pgsql/bin/psql -d geocode -c "CREATE \
EXTENSION postgis_topology"</div><div>/usr/local/pgsql/bin/psql -d geocode -c "CREATE \
EXTENSION fuzzystrmatch;"</div><div>/usr/local/pgsql/bin/psql -d geocode -c "CREATE \
EXTENSION postgis_tiger_geocoder;"</div><div>/usr/local/pgsql/bin/psql -d geocode -c \
"CREATE EXTENSION address_standardizer;"</div><div>/usr/local/pgsql/bin/psql geocode \
                -f
/usr/local/pgsql/share/contrib/postgis-2.2/legacy.sql</div><div><br></div><div>/usr/local/pgsql/bin/psql \
-d geocode -c "GRANT ALL ON geometry_columns TO \
PUBLIC;"</div><div>/usr/local/pgsql/bin/psql -d geocode -c "GRANT ALL ON \
geography_columns TO PUBLIC;"</div><div>/usr/local/pgsql/bin/psql -d geocode -c \
"GRANT ALL ON spatial_ref_sys TO \
PUBLIC;"</div><div><br></div><div>/usr/local/pgsql/bin/psql -d geocode -c "ALTER \
DATABASE geocode SET search_path=public, \
tiger;"</div></div><div><br></div><div>Here's some information on the resulting \
environment:</div><div><br></div><div>=========================================================================================</div><div>"SELECT \
version();"</div><div><div>&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;version &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;</div><div>--------------------------------------------------------------------------------------------------------------</div><div>&nbsp;PostgreSQL \
9.3.0 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.7.2 20120921 (Red Hat \
4.7.2-2), 64-bit</div><div>(1 row)</div><div><br></div><div>"SELECT \
postgis_full_version();"</div><div>&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; postgis_full_version &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;</div><div>--------------------------------------------------------------- \
------------------------------------------------------------------------------------------</div><div>&nbsp;POSTGIS="2.2.0dev \
r12128" GEOS="3.3.8-CAPI-1.7.8" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.1, \
released 2012/05/15" LIBXML="2.7.8" TOPOLOGY  RASTER</div><div>(1 \
row)</div><div><br></div><div>"SELECT name, default_version,installed_version FROM \
pg_available_extensions WHERE name LIKE 'postgis%';"</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| default_version | \
installed_version&nbsp;</div><div>------------------------+-----------------+-------------------</div><div>&nbsp;postgis_tiger_geocoder \
| 2.2.0dev &nbsp; &nbsp; &nbsp; &nbsp;| 2.2.0dev</div><div>&nbsp;postgis &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 2.2.0dev &nbsp; &nbsp; &nbsp; \
&nbsp;| 2.2.0dev</div><div>&nbsp;postgis_topology &nbsp; &nbsp; &nbsp; | 2.2.0dev \
&nbsp; &nbsp; &nbsp; &nbsp;| 2.2.0dev</div><div>(3 \
rows)</div></div><div>==========================================================================================</div><div><br></div><div>The&nbsp;pprint_addy() \
and normalize_address() functions work as expected in the examples I've \
seen.</div><div><br></div><div>I generate, modify and run a tiger load script to \
retrieve TIGER data for my state:</div><div>/usr/local/pgsql/bin/psql -d \
geocode&nbsp;-c "SELECT loader_generate_script(ARRAY['IL'], 'sh');" -A -o \
ILdata.sh</div><div><br></div><div>Everything appears to load normally. The only \
anomaly I see is the following message when installing the various featnames.dbf \
files:</div><div>XXXXXXX_featnames.dbf: shape (.shp) or index files (.shx) can not be \
opened, will just import attribute data.</div><div>However, from what I can see those \
files contain no shape information so I do not think this is an \
error.</div><div><br></div><div>I run the&nbsp;install_missing_indexes() function \
which appears to work.</div><div><br></div><div>However, when I attempt to geocode I \
get an immediate empty \
return.</div><div><br></div><div><div>/usr/local/pgsql/bin/psql -d geocode -c "SELECT \
g.rating, ST_X(g.geomout) As lon, ST_Y(g.geomout) As lat FROM geocode('810 W Main St, \
West Dundee, IL 60118') As g;"</div><div>&nbsp;rating | lon | \
lat&nbsp;</div><div>--------+-----+-----</div><div>(0 \
rows)</div></div><div><br></div><div>At this point, I'm lost&#8230; Any help greatly \
appreciated.</div><div><br></div><div>-- \
Greg</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>
 _______________________________________________
postgis-users mailing list
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></span></body></html>




_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/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