[GPlates-discuss] loading features with .xy files

Mark Turner mturner at gps.caltech.edu
Fri Feb 3 19:55:28 EST 2012


hi all,

I have a simple python script that converts .xy data into .gpml :

http://web.gps.caltech.edu/~mturner/gplates/utils/convert_xy_to_gpml.py

depending on what kind of files you have, this might work?

The script gives some limited control over what kind of features to create 
from the .xy data.  Please copy and use as needed.

Run the command in a terminal window with no arguments to get the help page,
like this:

$ ./convert_xy_to_gpml.py

usage:
./convert_xy_to_gpml.py [-line] [-polygon] [-:] [-type] [-rid] -[begin] -[end] input_files

This script creates gpml features from raw coordinate data,
typically in .xy or .dat formats, and command line options.

The script reads one or more text files with coordinate data
in 'lon lat' columns (or 'lat lon' if -: is used; see below.),
and converts the data to a either line or polygon geometry.

The output file name are the same as the input names,
with the '.gpml' sting appended.

Multiple features may exist in a single input file,
as long as they are separated by '>' header lines.

The name property of the feature will be read from header line,
ommiting the '>' character, and removing any whitespace found
between the '>' and text, and removing any trailing whitespace.

optional arguments that apply to all features created:

Use -: to toggle between (longitude,latitude) and (latitude,longitude) input.
[Default  is  (longitude,latitude)].

Use -line to create line features (default)
Use -polygon to create polygon features
  NOTE: the raw coordinate data must have identical first and last points
  to form valid polygon geometry.

Use -type to set a gpml feature type (default is UnclassifiedFeature)
Use -rid to set a rotation id (default is 0)
Use -begin to set the begin_age (default is 100)
Use -end to set the end_age (default is 0)



Mark Turner
California Institute of Technology
Division of Geological and Planetary Sciences, Mail Code 100-23
Pasadena, CA 91125
Phone: 626-395-4543
Fax: 626-395-1740



More information about the GPlates-discuss mailing list