[postgis-users] RE: Distance function Trouble (Obe, Regina)
Obe, Regina
robe.dnd at cityofboston.gov
Thu Apr 26 05:14:40 PDT 2007
To add to what Paul said
1) Not projected basically means your data is in degrees and does not
make any accommodations for showing your data on a flat surface so it
will show skewed presentationally and distance wise when displayed on a
flat surface. That's my laymen weenie understanding of things.
2) Once put in the right SRID for your data, your measurements will be
in degrees which for most purposes is useless, so you will probably want
to figure out your distances in meters by either
a) Projecting your data to a suitable meter based SRID using the
transform function
Below is a pgsql function posted that will help you figure out the most
suitable UTM zone for your data.
http://postgis.refractions.net/support/wiki/index.php?plpgsqlfunctions
Once you figure out the best SRID, then you can do something like
insert into newtable(myfield, the_geom)
SELECT myfield, transform(the_geom, newSRID)
FROM myoldtable
(It is quite possible depending on the data you have that it spans
multiple UTM zones)
b) or if you want to keep your data unprojected and your data is all
point data,
you can use the distance_sphere (much faster but less accurate and takes
as argument 2 points) or distance_spheroid (slower more accurate and
requires as input a 2 point geometries and a spheroid) functions
Hope that helps,
Regina
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paul
Ramsey
Sent: Thursday, April 26, 2007 1:39 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] RE: Distance function Trouble (Obe, Regina)
The correct SRID is 4326.
On 25-Apr-07, at 2:13 PM, I B Adams wrote:
>
> Okay, I have finally found some documentation on my data and it
> turns out that
> they are encoded using the wrong SRID,
>
> The details given are
>
> Projection: Geographic (not projected)
> Datum WGS84 (labeled GCS_WGS_1984 in ESRI products)
> Paramaters:
> * GEOGCS["GCS_WGS_1984",
> * DATUM["D_WGS_1984",
> * SPHEROID["WGS_1984",6378137,298.257223563]],
> * PRIMEM["Greenwich",0],
> * UNIT["Degree",0.017453292519943295]]
>
> I looked through the spatial_ref table and decided that the correct
> SRID would
> prob be 32601. So I used shp2pgsql to encode everything again.
> Added them all
> to the database etc. Now I do the distance again and get the exact
> same
> results.
>
> Have I still got the wrong SRID? What does (not projected) mean???
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
More information about the postgis-users
mailing list