<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>Hi Mark,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>What does your location data look like. Are you for
example trying to compare distance of point locations from a
street?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>For example the below will give you a listing of all
streets that are within 100 meters of the POINT(-71.10668 42.27081) - note
point is in long, lat.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>The <STRONG>SRID 26986</STRONG> you'll need to change to
the SRID most suitable for your particular location which you can
look up in the spatial_ref_sys . Basically you want the measurement to be
units you want to measure by and to be suitable for the region you are looking
at. For this example, I transformed my geometries to NAD 83 Mass State
Plane meters (26986). Items you will want to replace are in bold. In
general I find it useful to store the geometry field in the coordinate system
you will be using mostly to minimize on having to write messy transform calls
and to improve on speed. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>SELECT fename, fetype, fedirps</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>FROM masuf </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>WHERE expand(transform(wkb_geometry,
<STRONG>26986</STRONG>), 100) &&
transform(geometryfromtext(<STRONG>'POINT(-71.10668 42.27081)</STRONG>', 4269),
<STRONG>26986</STRONG>)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007> <FONT
face=Arial color=#0000ff size=2>AND distance(transform(wkb_geometry,
<STRONG>26986</STRONG>), transform(geometryfromtext(<STRONG>'POINT(-71.10668
42.27081)</STRONG>', 4269), <STRONG>26986</STRONG>)) <=
100</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2>Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=410370114-12022007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><FONT face=Arial color=#0000ff
size=2></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of
</B>mark<BR><B>Sent:</B> Sunday, February 11, 2007 9:03 PM<BR><B>To:</B>
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users]
distance from imported tiger database<BR></FONT><BR></DIV>
<DIV></DIV>Hi<BR>I imported the tiger database with the ogr tool. It has created
table with the structure below.<BR>geometry_columns has an entry like
this:<BR><BR>197276;"''";"public";"masuf";"wkb_geometry";"2";"4269";"LINESTRING"
<BR><BR>Can you tell how I can query for locations based on distance using
these?<BR>thanks a lot<BR>mark<BR><BR>CREATE TABLE masuf<BR>(<BR>ogc_fid serial
NOT NULL,<BR>wkb_geometry geometry,<BR>module char(8),<BR>tlid numeric(10),
<BR>side1 numeric(1),<BR>source char(1),<BR>fedirp char(2),<BR>fename
char(30),<BR>fetype char(4),<BR>fedirs char(2),<BR>cfcc char(3),<BR>fraddl
char(11),<BR>toaddl char(11),<BR>fraddr char(11),<BR>toaddr char(11),
<BR>friaddl char(1),<BR>toiaddl char(1),<BR>friaddr char(1),<BR>toiaddr
char(1),<BR>zipl numeric(5),<BR>zipr numeric(5),<BR>aianhhfpl
numeric(5),<BR>aianhhfpr numeric(5),<BR>aihhtlil char(1),<BR>aihhtlir char(1),
<BR>census1 char(1),<BR>census2 char(1),<BR>statel numeric(2),<BR>stater
numeric(2),<BR>countyl numeric(3),<BR>countyr numeric(3),<BR>cousubl
numeric(5),<BR>cousubr numeric(5),<BR>submcdl numeric(5),<BR>submcdr
numeric(5),<BR>placel numeric(5),<BR>placer numeric(5),<BR>tractl
numeric(6),<BR>tractr numeric(6),<BR>blockl numeric(4),<BR>blockr
numeric(4),<BR>CONSTRAINT masuf_pk PRIMARY KEY (ogc_fid),<BR>CONSTRAINT
enforce_dims_wkb_geometry CHECK (ndims(wkb_geometry) = 2), <BR>CONSTRAINT
enforce_geotype_wkb_geometry CHECK (geometrytype(wkb_geometry) =
'LINESTRING'::text OR wkb_geometry IS NULL),<BR>CONSTRAINT
enforce_srid_wkb_geometry CHECK (srid(wkb_geometry) = 4269)<BR>) <BR><BR><BR>
<DIV><SPAN class=gmail_quote>On 2/11/07, <B class=gmail_sendername>mark</B>
<<A href="mailto:rkmr.em@gmail.com">rkmr.em@gmail.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #cccccc 1px solid">hi<BR>are
there any tools for importing the tiger database into postgres to use with
postgis?<BR>thanks !<BR><SPAN
class=sg>mark<BR></SPAN></BLOCKQUOTE></DIV><BR></BODY></HTML>
<HTML><BODY><P><hr size=1></P><br>
<P><STRONG><br>
The substance of this message, including any attachments, may be<br>
confidential, legally privileged and/or exempt from disclosure<br>
pursuant to Massachusetts law. It is intended solely for the<br>
addressee. If you received this in error, please contact the sender<br>
and delete the material from any computer.<br>
</STRONG></P></BODY></HTML>