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

List:       postgis-users
Subject:    Re: [postgis-users] How to use accurate SRID ?
From:       "Paragon Corporation" <lr () pcorp ! us>
Date:       2010-08-24 10:28:13
Message-ID: 66BCEE2B1F1D4AA0B2CC06785B99FDAA () J
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Nguyen,
 
1) If you care about accurate measurement, don't use SRID 900913.  It is
grossly inaccurate for measurement and was designed specifically for map
visualization.
2) If you are using PostGIS 1.5, you may want to store your long lat data in
geography data type.  It will allow you to keep data in degrees, but will
give you answers in meters for measurement.
 
This FAQ might help you decide
http://www.postgis.org/documentation/manual-svn/ch04.html#PostGIS_GeographyV
SGeometry
 
3) Using 32611 is best assuming its right for your area if you are dealing
with just that region and want the full geometry processing, speed power, or
using  PostGIS < 1.5
 
 
Leo and Regina
http://www.postgis.us
 
 

  _____  

From: postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of nguyen
liem
Sent: Monday, August 23, 2010 11:55 PM
To: PostGIS Users Discussion
Subject: [postgis-users] How to use accurate SRID ?


Hi all,

I stored all my geometry in SRID 4326. I would like to calculate the
distance between 2 points in metter. 

----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------
I see an example about ST_Distance_Sphere here:
http://postgis.refractions.net/docs/ST_Distance_Sphere.html


SELECT round(CAST(ST_Distance_Sphere(ST_Centroid(the_geom),
ST_GeomFromText('POINT(-118 38)',4326)) As numeric),2) As dist_meters,


round(CAST(ST_Distance(ST_Transform(ST_Centroid(the_geom),32611),
		ST_Transform(ST_GeomFromText('POINT(-118 38)', 4326),32611))
As numeric),2) As dist_utm11_meters,
round(CAST(ST_Distance(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118
38)', 4326)) As numeric),5) As dist_degrees,


round(CAST(ST_Distance(ST_Transform(the_geom,32611),
		ST_Transform(ST_GeomFromText('POINT(-118 38)', 4326),32611))
As numeric),2) As min_dist_line_point_meters
FROM
	(SELECT ST_GeomFromText('LINESTRING(-118.584 38.374,-118.583 38.5)',
4326) As the_geom) as foo;


	 dist_meters | dist_utm11_meters | dist_degrees |
min_dist_line_point_meters
	
-------------+-------------------+--------------+---------------------------
-
		70424.47 |         70438.00 |      0.72900 |
65871.18


SRID 32611: the distance is 70438.00 metters.

----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------
If i changed SRID from 32611 to 900913


 dist_meters | dist_utm11_meters | dist_degrees | min_dist_line_point_meters
	
-------------+-------------------+--------------+---------------------------
-
		70424.47 |         89738.89 |      0.72900 |
83857.70

SRID 32611: the distance is 89738.89 metters


I don't know what is the different between SRID 32611 and SRID 900913 ?
I should use 32611 or 900913 to calculate the distance in metter ?
Could i calculate distance by ST_Distance_Sphere for geometry with SRID 4326
?
Whats the different between ST_Distance_Sphere(SRID 4326), ST_Distance(SRID
32611), ST_Distance (SRID 900913) ?

Cheers.

-- 

Liem Nguyen (DBA)

AXON ACTIVE VIETNAM
 <http://www.axonactive.vn/> www.axonactive.vn
 
10th Floor, Hai Au Building, 39B Truong Son, Ward 4, Tan Binh District, Ho
Chi Minh City, Vietnam
T +84 8 629 738 59, F +84 8 381 134 89, M +84 168 994 8897
8897 +10° 48' 32.72", +106° 39' 51.58"



[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16625"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff 
size=2 face=Arial>Nguyen,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff 
size=2 face=Arial>1) If you care about accurate measurement, don't use <FONT 
color=#000000 size=3 face="Times New Roman"><FONT color=#0000ff>SRID 
900913.&nbsp; It is grossly inaccurate for measurement and was designed 
specifically for map visualization.</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff>2) If 
you&nbsp;are using PostGIS 1.5, you may want to store your long lat data in 
geography data type.&nbsp; It will allow you to keep data in degrees, but will 
give you answers in meters for measurement.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff>This 
FAQ might help you decide</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff 
size=2 face=Arial><A 
href="http://www.postgis.org/documentation/manual-svn/ch04.html#PostGIS_GeographyVSGeo \
metry">http://www.postgis.org/documentation/manual-svn/ch04.html#PostGIS_GeographyVSGeometry</A></FONT></SPAN></DIV></SPAN></DIV>
 <DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff>3) 
Using 32611 is best assuming its right for your area if you are dealing with 
just that region and want the full geometry processing, speed power, or 
using&nbsp; PostGIS &lt; 1.5</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff>Leo 
and Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT color=#0000ff><A 
href="http://www.postgis.us">http://www.postgis.us</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=067552010-24082010><FONT 
color=#0000ff></FONT></SPAN>&nbsp;</DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
</B>nguyen liem<BR><B>Sent:</B> Monday, August 23, 2010 11:55 PM<BR><B>To:</B> 
PostGIS Users Discussion<BR><B>Subject:</B> [postgis-users] How to use accurate 
SRID ?<BR></FONT><BR></DIV>
<DIV></DIV>Hi all,<BR><BR>I stored all my geometry in SRID 4326. I would like to 
calculate the distance between 2 points in metter. 
<BR><BR>------------------------------------------------------------------------------ \
------------------------------------------------------------------------------------------------------------<BR>I \
 see an example about ST_Distance_Sphere here: <A 
href="http://postgis.refractions.net/docs/ST_Distance_Sphere.html">http://postgis.refractions.net/docs/ST_Distance_Sphere.html</A><BR><BR><PRE \
class=programlisting>SELECT round(CAST(ST_Distance_Sphere(ST_Centroid(the_geom), \
ST_GeomFromText('POINT(-118 38)',4326)) As numeric),2) As dist_meters,<BR> \
round(CAST(ST_Distance(ST_Transform(ST_Centroid(the_geom),32611),<BR>		ST_Transform(ST_GeomFromText('POINT(-118 \
38)', 4326),32611)) As numeric),2) As \
dist_utm11_meters,<BR>round(CAST(ST_Distance(ST_Centroid(the_geom), \
ST_GeomFromText('POINT(-118 38)', 4326)) As numeric),5) As dist_degrees,<BR> \
round(CAST(ST_Distance(ST_Transform(the_geom,32611),<BR>		ST_Transform(ST_GeomFromText('POINT(-118 \
38)', 4326),32611)) As numeric),2) As min_dist_line_point_meters<BR>FROM<BR>	(SELECT \
ST_GeomFromText('LINESTRING(-118.584 38.374,-118.583 38.5)', 4326) As the_geom) as \
foo;<BR>  dist_meters | dist_utm11_meters | dist_degrees | \
min_dist_line_point_meters<BR>	-------------+-------------------+--------------+----------------------------<BR>		70424.47 \
|         <B style="COLOR: rgb(0,102,0)"><FONT size=4>70438.00</FONT></B> |      \
0.72900 |                   65871.18<BR> </PRE><BR><SPAN style="COLOR: \
rgb(0,153,0)">SRID 32611: the distance is  </SPAN><B style="COLOR: \
rgb(0,153,0)"><FONT size=+0><B><FONT  size=4>70438.00</FONT></B></FONT></B><SPAN \
style="COLOR: rgb(0,153,0)">  \
metters.</SPAN><BR><BR>--------------------------------------------------------------- \
---------------------------------------------------------------------------------------------------------------------------<BR>If \
 i changed SRID from 32611 to 900913<BR><BR><PRE class=programlisting> dist_meters | \
dist_utm11_meters | dist_degrees | \
min_dist_line_point_meters<BR>	-------------+-------------------+--------------+----------------------------<BR>		70424.47 \
|         <FONT style="COLOR: rgb(0,102,0)" size=4><B>89738.89</B></FONT> |      \
0.72900 |                   83857.70</PRE><BR><SPAN  style="COLOR: rgb(0,102,0)">SRID \
32611: the distance is </SPAN><FONT  style="COLOR: rgb(0,102,0)" \
size=4><B>89738.89</B></FONT><SPAN  style="COLOR: rgb(0,102,0)"> \
metters</SPAN><BR><PRE class=programlisting><BR></PRE>I don't know what is the \
different between  SRID 32611 and SRID 900913 ?<BR>I should use 32611 or 900913 to \
calculate the  distance in metter ?<BR>Could i calculate distance by \
ST_Distance_Sphere for  geometry with SRID 4326 ?<BR>Whats the different between \
ST_Distance_Sphere(SRID  4326), ST_Distance(SRID 32611), ST_Distance (SRID 900913) \
?<BR><BR>Cheers.<BR  clear=all><BR>-- <BR>
<DIV>
<DIV style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: rgb(31,73,125); FONT-SIZE: 8pt"><FONT face=Calibri>Liem Nguyen 
(DBA)<BR><BR>AXON ACTIVE VIETNAM</FONT></SPAN></B></DIV>
<DIV style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: rgb(31,73,125); FONT-SIZE: 8pt" lang=DE-CH><A 
href="http://www.axonactive.vn/" target=_blank><SPAN lang=EN-US><FONT 
color=#0000ff 
face=Calibri>www.axonactive.vn</FONT></SPAN></A></SPAN></B><B><SPAN 
style="COLOR: rgb(31,73,125); FONT-SIZE: 8pt"></SPAN></B></DIV>
<DIV style="MARGIN: 0in 0in 0pt"><SPAN 
style="COLOR: rgb(31,73,125); FONT-SIZE: 8pt"><FONT 
face=Calibri></FONT></SPAN>&nbsp;</DIV>
<DIV style="MARGIN: 0in 0in 0pt"><SPAN 
style="COLOR: rgb(31,73,125); FONT-SIZE: 8pt"><FONT face=Calibri>10th Floor, Hai 
Au Building, 39B Truong Son, Ward 4, Tan Binh District, Ho Chi Minh City, 
Vietnam</FONT></SPAN></DIV>
<DIV style="MARGIN: 0in 0in 0pt"><SPAN 
style="COLOR: rgb(31,73,125); FONT-SIZE: 8pt"><FONT face=Calibri>T +84 8 629 738 
59, F +84 8 381 134 89, M +84 168 994 8897</FONT></SPAN></DIV>
<DIV style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 8pt"><FONT 
size=1><U>8897 +10° 48' 32.72", +106° 39' \
51.58"</U></FONT></SPAN></DIV><PRE><BR></PRE></DIV><BR></BODY></HTML>



_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/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