[GPlates-discuss] pygplates - motion paths

John Cannon john.cannon at sydney.edu.au
Tue Jun 5 23:13:01 AEST 2018


Hi Peter,

To export the reconstructed motion paths (polylines) to Shapefile directly you can use this sample code:

  https://protect-au.mimecast.com/s/FFGGCBNZwLiJMYzLFz4YY3?domain=gplates.org

...where, in your case, you have already created the motion path features. Here each seed point results in an exported polyline (the reconstructed motion path from that seed point).


For exporting to a text file you could base it off the following sample code:

  https://protect-au.mimecast.com/s/sUP6CD1jy9trn4D8S5N--s?domain=gplates.org

...except, in the inner for loop (that iterates over points in a reconstructed motion path), you can output each lat/lon to text file instead of printing.


And if exporting the motion paths as they look at present day you could set the reconstruction time to zero (in pygplates.reconstruct() in the above sample codes).

Regards,
John

From: GPlates-discuss <gplates-discuss-bounces at mailman.sydney.edu.au> On Behalf Of Peter Webb
Sent: Tuesday, 5 June 2018 10:00 PM
To: gplates-discuss at mailman.sydney.edu.au
Subject: [GPlates-discuss] pygplates - motion paths

Dear users,

I am relatively new to both python and pygplates. I have managed to create a script which:


  1.  reads a text file of points, using csv.reader
  2.  creates a gpml file of the points, using pygplates.PointOnSphere and pygplates.Feature
  3.  assigns plate id to the points, using pygplates.partition_into_plates
  4.  converts the points to motion paths, using pygplates.Feature.create_motion_path

I now want to export the motion path for each point as a polyline feature for use in ArcMap and/or export the paleolatitude/longitude values for each path as a text file.
Currently, my attempt to write the motion path features to a shapefile only writes the present day locations of the points
Is it possible to extract and export the polyline geometry of the motion path using pygplates? I would appreciate any advice, many thanks.



Thank you for your help,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.sydney.edu.au/pipermail/gplates-discuss/attachments/20180605/a918ce58/attachment-0001.html>


More information about the GPlates-discuss mailing list