[postgis-users] -- Still having trouble retrieving properties 100 meters around a point --
Rafael Orta
rorta_us at yahoo.com
Wed Sep 20 06:16:46 PDT 2006
Hi Greg
Thanks for your answer, Let me clarify a bit what I am doing, I got from geocode.com the latitude and longitude from my address and neighbors address. All that I am trying to do is to get a query to retrieve the properties 5 miles around me and another to retrieve the 100 properties closest to me.
I am using a geometric column called "geom" which is a point and
I generate using
update smarter.vow_properties set geom = GeometryFromText('POINT(' || latitude || ' ' ||longitude || ')', 32011);
I tried to use make point but it does give me the error below and I am wondering if the reason is that I am using the wrong SRID.
update smarter.vow_properties set geom = makePoint (longitude, latitude);
"ERROR: new row for relation "vow_properties" violates check constraint "enforce_srid_geom"
When I run this query
select srid, srtext, proj4text from spatial_ref_sys where srtext LIKE '%WGS84%'
it returns 574 rows and by the text most of then refer to other places in the world other that the US. The closes I get is 3920 (Puerto Rico / UTM Zone 20N), would this be a good choice? I found out that they are using in fact WGS-84, but I still need to pick 1 out of 574 :-)
Thanks in advance again
Rafael Orta
Greg Troxel <gdt at ir.bbn.com> wrote:
I'm new too, but I think you should omit the latitude/longitude
columns and instead simply have a geometry column (which will have
lat/lon in it); the examples in the manual are all like that and the
point of postgis is to make lat/lon be something that's understood by
the db so the spatial operators can work. Having redundant values
means it's more work and (less certainty) to have them consistent, or
it gets you into adding contraints and update triggers when it isn't
necessary or useful to do so.
For reference system, the real question is what datum the data you
have is in. For country-wide use the choice of a datum tagged as NJ
specific is almost certainly inappropriate.
For the US, and given data in lat/lon, the three likely choices are
NAD27 CONUS
NAD83
WGS84
For mapping, NAD83 and WGS84 are essentially the same (meaning
differences are below the accuracy of your data). NAD27 and NAD83
differ significantly. Odds are good that you should just use WGS84,
but ask your data provider which datum. If they don't know, you have
a problem, but in that case picking WGS84 is probably 80% likely to be
correct.
--
Greg Troxel
*****************************************************
Rafael Orta Phone: (609)-330-3193
Sr. Oracle DBA Fax: (856)-642-7679
Technical Manager
Oraprofessionals Email: rorta_us at yahoo.com
******************************************************
---------------------------------
All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060920/d5d5dbe0/attachment.html>
More information about the postgis-users
mailing list