Hi everyone
I have a set of files with lats & longs of objects in two columns separated by tabs. How can I import them on GPlates, and how can I apply to them my own set of euler poles to rotate them?
thanks
gio
One option is to write a small program to convert the coordinates into geojson. GPlates can open geojson file.
import json
import numpy as np
lats = np.random.uniform(low=-90, high=90, size=(50,))
lons = np.random.uniform(low=-180, high=180, size=(50,))
np.savetxt('test.csv', np.c_[lons,lats],header='lon,lat',comments='', fmt='%.4f, %.4f')
data = np.genfromtxt('test.csv',skip_header=1, delimiter=',')
json_data={}
json_data['type']="FeatureCollection"
json_data["features"]=[]
for row in data:
print(row)
feature={}
feature['type'] = "Feature"
feature["geometry"]={}
feature["properties"]={}
feature["geometry"]['type'] = "Point"
feature["geometry"]['coordinates'] = [row[0], row[1]]
json_data["features"].append(feature)
with open('test.json', 'w') as outfile:
json.dump(json_data, outfile)
To rotate them, you need rotation file.
See this link
https://docs.google.com/document/d/1nghszKv4BZpfl5vWQSBFhRfM5HrzJaj2wT1L39xXPjA/pub
In regards to loading the lat lon data, an alternative is to try Christian’s idea mentioned at…
https://mailman.sydney.edu.au/pipermail/gplates-discuss/2017-March/000593.html
…specifically…
probably the most simple way: Make sure you have lon lat columns only (no metadata/attibutes!) then save the file as *.gmt and load it into GPlates (suffixing .gmt will make GPlates think it is GMT’s OGR format - http://gmt.soest.hawaii.edu/doc/latest/GMT_Docs.html#the-gmt-vector-data-format-for-ogr-compatibility).
THANK YOU mchin very helpful!
THANK YOU John I’ll try out your suggestion