[CIG-SHORT] question about coordinate transform
Charles Williams
willic3 at gmail.com
Tue Aug 15 16:52:37 PDT 2017
Dear Tu,
I think I see what’s going on. You are importing the coordsys.py from the example, where the mesh and geographic coordinates are actually defined. I believe the problem is that your points need to be ordered (lon, lat, z). Also, note that z-coordinates greater than zero will actually lie above your mesh.
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/a6202d99/attachment.html>
More information about the CIG-SHORT
mailing list