[CIG-SHORT] question about coordinate transform

Charles Williams willic3 at gmail.com
Tue Aug 15 16:19:00 PDT 2017


Dear Tu,

The parameters you list are the parameters controlling a local Transverse Mercator projection (see Proj.4 documentation).  The first two are the coordinates of the projection origin, and the last one is a scaling factor.  It appears to me that you have not defined your source and destination projections.  I believe that you want a geographic coordinate system as your source (you will need to define all the parameters for that, including ellipsoid and datum parameters), and a geoprojected system as your destination, and you must also define the parameters for that.

Cheers,
Charles


> On 15/08/2017, at 2:59 PM, tu xiang <tuxiang2016 at outlook.com> wrote:
> 
> Hello, everyone
>  
> Does the geographical coordinates (+lat_0=45.5231 +lon_0=-122.6765 +k=0.9996) correspond to the origin of Cartesian coordinates for mesh in the 3D subduction example?
> 
> I want to try to transform some geographical coordinates, then, I write next code:
> #!/usr/bin/env nemesis
>  
> import coordsys
> import numpy as np
> point=np.array([[45.5231,-122.6765,0.9996],[46.0,-122.0,1.0],[45.0,-122.0,0.5]])
> print point
> print type(point)
> coordsys.geoToMesh(point)
>  
> 
> But it output errors!
> 
> Traceback (most recent call last):
>   File "demo.py", line 9, in <module>
>     coordsys.geoToMesh(point)
>   File "/home/bxu/covert/coordsys.py", line 54, in geoToMesh
>     convert(xyz, cs_mesh(), cs_geo3D())
>   File "/home/bxu/pylith/pylith-2.2.1rc1-linux-x86_64/lib/python2.7/site-packages/spatialdata/geocoords/Converter.py", line 33, in convert
>     geocoords.Converter.convert(coords, csDest, csSrc)
> RuntimeError: Error while projecting location.
>   latitude or longitude exceeded limits
>   projection: tmerc
>   units: m
>   proj options: +lat_0=45.5231 +lon_0=-122.6765 +k=0.9996
>   lon: 0.794528
>   lat: -2.14111
>  
> It said the latitude or longitude exceeded limits, I do not know what does it mean?
>  
> Looking forward to your reply.
> Best regards,
> Tu Xiang
> 
>  
>  
> 
> 
> _______________________________________________
> CIG-SHORT mailing list
> CIG-SHORT at geodynamics.org <mailto:CIG-SHORT at geodynamics.org>
> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-short <http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-short>
Charles Williams I Geodynamic Modeler
GNS Science I Te Pῡ Ao
1 Fairway Drive, Avalon 5010, PO Box 30368, Lower Hutt 5040, New Zealand
Ph 0064-4-570-4566 I Mob 0064-22-350-7326 I Fax 0064-4-570-4600
http://www.gns.cri.nz/ <http://www.gns.cri.nz/> I Email: C.Williams at gns.cri.nz <mailto:your.email at gns.cri.nz>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/cig-short/attachments/20170816/bcf9299d/attachment-0001.html>


More information about the CIG-SHORT mailing list