Re: [postgis-users] Converting UTM to lat/lon using Postgis

2010-05-03 Thread pcreso
See:

http://www.spatialreference.org/ref/epsg/3997/postgis/
for the insert statement to create this projection in Postgis.

For other information about this projection see:
http://www.spatialreference.org/ref/epsg/3997/

HTH,

  Brent Wood
--- On Mon, 5/3/10, Mehmet Erkek  wrote:

From: Mehmet Erkek 
Subject: Re: [postgis-users] Converting UTM to lat/lon using Postgis
To: "PostGIS Users Discussion" 
Date: Monday, May 3, 2010, 7:50 PM




 
 






Thank you for the fast answer! 

   

Hmm. It looks I don’t have srid 3997 in the DB. 

   

   

=# select srid, srtext, proj4text from spatial_ref_sys where
srid=3997; 

 srid | srtext | proj4text 

--++--- 

(0 rows) 

   

select srid, srtext, proj4text from spatial_ref_sys where 
srtext like '%Dubai%'; 

 srid | srtext | proj4text 

--++--- 

(0 rows) 

   

   

Could this be related to my postgis installation?  

   

I don’t see this srid in spatial_ref_sys.sql which came
with postgis installation either.  

   

Any idea how I can fix this? 

   

   

--- 

Mehmet ERKEK 

www.REIDIN.com 

   



From:
postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Francis
Markham

Sent: Monday, May 03, 2010 11:09 AM

To: PostGIS Users Discussion

Subject: Re: [postgis-users] Converting UTM to lat/lon using Postgis 



   

Hi Mehmet,



When you imported the shapefile, the SRID you are meant to specify is the SRID
of the data, not the SRID you want.  Since the data is in Dubai Local TM,
the SRID is 3997.  To get the transformation you want, try the following: 

select  
ST_AsText( ST_Transform(centroid(ST_SetSRID(the_geom, 3997)),4326)) from
ult.test2 limit 5; 

Hope that helps,



-Francis 



On 3 May 2010 17:03, Mehmet Erkek  wrote: 





  

Hi
All, 

  

I
havea a shape file which I imported it to a table called ‘test2’
(using  SRID=4326).  I want to get centroids of geometries in
lat/lon.  

  

Here
is what I run: 

  

select  
ST_AsText( ST_Transform(centroid(the_geom),4326)) from ult.test2 limit 5; 

  

and
what I get: 

  

POINT(496597.996430787
2774798.21242881) 

POINT(496332.629887436
2793339.61534586) 

POINT(496302.627327975
2793317.82477318) 

POINT(496305.255261594
2793353.29646291) 

POINT(496241.538851096
2774826.65593589) 

  

  

So
far all is fine except coordinates which are not  latitude/longitude  

  

My
question is : How can I convert/get these coordinates in lat/lon? 

  

  

This
what I have in my prj file:  

  

PROJCS["Dubai
Local Transverse Mercator
(DLTM)",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",50.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",55.34],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
 

  

  

And
this is my postgis version: POSTGIS="1.3.6"
GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.7.1, 23 September 2009"
USE_STATS 

  

I
appreciate any help. Thank you. 

  

  

--- 

Mehmet ERKEK 

www.REIDIN.com 

  





This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender immediately and delete the original. Any other
use of the email by you is prohibited. Please Consider the Environment Before
Printing This Email  





___

postgis-users mailing list

postgis-users@postgis.refractions.net

http://postgis.refractions.net/mailman/listinfo/postgis-users 



   




This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information. If you have received it in 
error, please notify the sender immediately and delete the original. Any other 
use of the email by you is prohibited.

Please Consider the Environment Before Printing This Email 


-Inline Attachment Follows-

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting UTM to lat/lon using Postgis

2010-05-03 Thread Francis Markham
Try http://www.spatialreference.org/ref/esri/3997/postgis/  The site is down
for me at the moment but should have the goods.

-Francis

On 3 May 2010 17:50, Mehmet Erkek  wrote:

>  Thank you for the fast answer!
>
>
> Hmm. It looks I don’t have srid 3997 in the DB.
>
>
>
>
>
> =# select srid, srtext, proj4text from spatial_ref_sys where srid=3997;
>
>  srid | srtext | proj4text
>
> --++---
>
> (0 rows)
>
>
>
> select srid, srtext, proj4text from spatial_ref_sys where  srtext like
> '%Dubai%';
>
>  srid | srtext | proj4text
>
> --++---
>
> (0 rows)
>
>
>
>
>
> Could this be related to my postgis installation?
>
>
>
> I don’t see this srid in spatial_ref_sys.sql which came with postgis
> installation either.
>
>
>
> Any idea how I can fix this?
>
>
>
>
>
> ---
>
> *Mehmet ERKEK***
>
> www.REIDIN.com <http://www.reidin.com/>
>
>
>
> *From:* postgis-users-boun...@postgis.refractions.net [mailto:
> postgis-users-boun...@postgis.refractions.net] *On Behalf Of *Francis
> Markham
> *Sent:* Monday, May 03, 2010 11:09 AM
> *To:* PostGIS Users Discussion
> *Subject:* Re: [postgis-users] Converting UTM to lat/lon using Postgis
>
>
>
> Hi Mehmet,
>
> When you imported the shapefile, the SRID you are meant to specify is the
> SRID of the data, not the SRID you want.  Since the data is in Dubai Local
> TM, the SRID is 3997.  To get the transformation you want, try the
> following:
>
> select   ST_AsText( ST_Transform(centroid(ST_SetSRID(the_geom,
> 3997)),4326)) from ult.test2 limit 5;
>
> Hope that helps,
>
> -Francis
>
> On 3 May 2010 17:03, Mehmet Erkek  wrote:
>
>
>
> Hi All,
>
>
>
> I havea a shape file which I imported it to a table called ‘test2’ (using
>  SRID=4326).  I want to get centroids of geometries in lat/lon.
>
>
>
> Here is what I run:
>
>
>
> select   ST_AsText( ST_Transform(centroid(the_geom),4326)) from ult.test2
> limit 5;
>
>
>
> and what I get:
>
>
>
> POINT(496597.996430787 2774798.21242881)
>
> POINT(496332.629887436 2793339.61534586)
>
> POINT(496302.627327975 2793317.82477318)
>
> POINT(496305.255261594 2793353.29646291)
>
> POINT(496241.538851096 2774826.65593589)
>
>
>
>
>
> So far all is fine except coordinates which are not  latitude/longitude
>
>
>
> *My question is : How can I convert/get these coordinates in lat/lon?*
>
>
>
>
>
> This what I have in my prj file:
>
>
>
> PROJCS["Dubai Local Transverse Mercator
> (DLTM)",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",50.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",55.34],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
>
>
>
>
>
> And this is my postgis version: POSTGIS="1.3.6" GEOS="2.2.3-CAPI-1.1.1"
> PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS
>
>
>
> I appreciate any help. Thank you.
>
>
>
>
>
> ---
>
> *Mehmet ERKEK*
>
> www.REIDIN.com <http://www.reidin.com/>
>
>
>
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the email by you is prohibited. Please Consider
> the Environment Before Printing This Email
>
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the email by you is prohibited. Please Consider
> the Environment Before Printing This Email
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting UTM to lat/lon using Postgis

2010-05-03 Thread Mehmet Erkek
Thank you for the fast answer!

 

Hmm. It looks I don't have srid 3997 in the DB.

 

 

=# select srid, srtext, proj4text from spatial_ref_sys where srid=3997;

 srid | srtext | proj4text

--++---

(0 rows)

 

select srid, srtext, proj4text from spatial_ref_sys where  srtext like
'%Dubai%';

 srid | srtext | proj4text

--++---

(0 rows)

 

 

Could this be related to my postgis installation? 

 

I don't see this srid in spatial_ref_sys.sql which came with postgis
installation either. 

 

Any idea how I can fix this?

 

 

---

Mehmet ERKEK

www.REIDIN.com <http://www.reidin.com/> 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of
Francis Markham
Sent: Monday, May 03, 2010 11:09 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Converting UTM to lat/lon using Postgis

 

Hi Mehmet,

When you imported the shapefile, the SRID you are meant to specify is
the SRID of the data, not the SRID you want.  Since the data is in Dubai
Local TM, the SRID is 3997.  To get the transformation you want, try the
following:

select   ST_AsText( ST_Transform(centroid(ST_SetSRID(the_geom,
3997)),4326)) from ult.test2 limit 5;

Hope that helps,

-Francis

On 3 May 2010 17:03, Mehmet Erkek  wrote:

 

Hi All,

 

I havea a shape file which I imported it to a table called 'test2'
(using  SRID=4326).  I want to get centroids of geometries in lat/lon. 

 

Here is what I run:

 

select   ST_AsText( ST_Transform(centroid(the_geom),4326)) from
ult.test2 limit 5;

 

and what I get:

 

POINT(496597.996430787 2774798.21242881)

POINT(496332.629887436 2793339.61534586)

POINT(496302.627327975 2793317.82477318)

POINT(496305.255261594 2793353.29646291)

POINT(496241.538851096 2774826.65593589)

 

 

So far all is fine except coordinates which are not  latitude/longitude 

 

My question is : How can I convert/get these coordinates in lat/lon?

 

 

This what I have in my prj file: 

 

PROJCS["Dubai Local Transverse Mercator
(DLTM)",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",637
8137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292
5199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",50
.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",55.
34],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Ori
gin",0.0],UNIT["Meter",1.0]]

 

 

And this is my postgis version: POSTGIS="1.3.6" GEOS="2.2.3-CAPI-1.1.1"
PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS

 

I appreciate any help. Thank you.

 

 

---

Mehmet ERKEK

www.REIDIN.com <http://www.reidin.com/> 

 


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete
the original. Any other use of the email by you is prohibited. Please
Consider the Environment Before Printing This Email 


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting UTM to lat/lon using Postgis

2010-05-03 Thread Francis Markham
Hi Mehmet,

When you imported the shapefile, the SRID you are meant to specify is the
SRID of the data, not the SRID you want.  Since the data is in Dubai Local
TM, the SRID is 3997.  To get the transformation you want, try the
following:

select   ST_AsText( ST_Transform(centroid(ST_SetSRID(the_geom, 3997)),4326))
from ult.test2 limit 5;
Hope that helps,

-Francis

On 3 May 2010 17:03, Mehmet Erkek  wrote:

>
>
> Hi All,
>
>
>
> I havea a shape file which I imported it to a table called ‘test2’ (using
>  SRID=4326).  I want to get centroids of geometries in lat/lon.
>
>
>
> Here is what I run:
>
>
>
> select   ST_AsText( ST_Transform(centroid(the_geom),4326)) from ult.test2
> limit 5;
>
>
>
> and what I get:
>
>
>
> POINT(496597.996430787 2774798.21242881)
>
> POINT(496332.629887436 2793339.61534586)
>
> POINT(496302.627327975 2793317.82477318)
>
> POINT(496305.255261594 2793353.29646291)
>
> POINT(496241.538851096 2774826.65593589)
>
>
>
>
>
> So far all is fine except coordinates which are not  latitude/longitude
>
>
>
> *My question is : How can I convert/get these coordinates in lat/lon?*
>
>
>
>
>
> This what I have in my prj file:
>
>
>
> PROJCS["Dubai Local Transverse Mercator
> (DLTM)",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",50.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",55.34],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
>
>
>
>
>
> And this is my postgis version: POSTGIS="1.3.6" GEOS="2.2.3-CAPI-1.1.1"
> PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS
>
>
>
> I appreciate any help. Thank you.
>
>
>
>
>
> ---
>
> *Mehmet ERKEK***
>
> www.REIDIN.com 
>
>
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise private information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the email by you is prohibited. Please Consider
> the Environment Before Printing This Email
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting UTM to lat/lon using Postgis

2010-05-03 Thread Guillaume Sueur

Hi,

As you declared your input shapefile to be in 4326 (which is lat/lon), 
Postgis doesn't transform anything in your coordinates when you ask for 
lat/lon.
Try to set the proper SRID for Dubai Local Transverse Mercator using 
SELECT setSRID(the_geom,the_srid) FROM ult.test2;
Note that you may have to drop a constraint forcing your srid to be 4326 
first.


Regards,

Guillaume

On 03/05/2010 09:03, Mehmet Erkek wrote:

Hi All,

I havea a shape file which I imported it to a table called ‘test2’
(using SRID=4326). I want to get centroids of geometries in lat/lon.

Here is what I run:

select ST_AsText( ST_Transform(centroid(the_geom),4326)) from ult.test2
limit 5;

and what I get:

POINT(496597.996430787 2774798.21242881)

POINT(496332.629887436 2793339.61534586)

POINT(496302.627327975 2793317.82477318)

POINT(496305.255261594 2793353.29646291)

POINT(496241.538851096 2774826.65593589)

So far all is fine except coordinates which are not latitude/longitude

*_My question is : How can I convert/get these coordinates in lat/lon?_*

This what I have in my prj file:

PROJCS["Dubai Local Transverse Mercator
(DLTM)",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",50.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",55.34],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

And this is my postgis version: POSTGIS="1.3.6" GEOS="2.2.3-CAPI-1.1.1"
PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS

I appreciate any help. Thank you.

---

*Mehmet ERKEK***

www.REIDIN.com 


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete
the original. Any other use of the email by you is prohibited. Please
Consider the Environment Before Printing This Email



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Converting UTM to lat/lon using Postgis

2010-05-03 Thread Mehmet Erkek
 

Hi All,

 

I havea a shape file which I imported it to a table called 'test2'
(using  SRID=4326).  I want to get centroids of geometries in lat/lon. 

 

Here is what I run:

 

select   ST_AsText( ST_Transform(centroid(the_geom),4326)) from
ult.test2 limit 5;

 

and what I get:

 

POINT(496597.996430787 2774798.21242881)

POINT(496332.629887436 2793339.61534586)

POINT(496302.627327975 2793317.82477318)

POINT(496305.255261594 2793353.29646291)

POINT(496241.538851096 2774826.65593589)

 

 

So far all is fine except coordinates which are not  latitude/longitude 

 

My question is : How can I convert/get these coordinates in lat/lon?

 

 

This what I have in my prj file: 

 

PROJCS["Dubai Local Transverse Mercator
(DLTM)",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",637
8137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292
5199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",50
.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",55.
34],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Ori
gin",0.0],UNIT["Meter",1.0]]

 

 

And this is my postgis version: POSTGIS="1.3.6" GEOS="2.2.3-CAPI-1.1.1"
PROJ="Rel. 4.7.1, 23 September 2009" USE_STATS

 

I appreciate any help. Thank you.

 

 

---

Mehmet ERKEK

www.REIDIN.com  

 

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users