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

Francis Markham fmarkham at gmail.com
Mon May 3 00:09:18 PDT 2010


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 <merkek at reidin.com> 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",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",55.33333333333334],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 at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100503/29f5a91e/attachment.html>


More information about the postgis-users mailing list