GPlates Web Services Examples

This page contains examples of using GPlates Web Services under various circumstances.

QGIS

Step 1: Click menu item "Layer-->Add Layer-->Add Vector Layer"

QGIS Examples #1

Step 2: In the popup dialog, choose "Protocol" as "Source Type" and type in the URI, for example

https://gws.gplates.org/reconstruct/coastlines?time=100
.

QGIS Examples #2

Step 3: Click "Open" button and the reconstructed coastlines will show in QGIS.

QGIS Examples #3

JavaScript CORS

    var url = 'https://gws.gplates.org/reconstruct/coastlines/?time=50';
    var method = "GET"      
    var xhr = new XMLHttpRequest();
    if("withCredentials" in xhr){
        xhr.open(method, url, true);
    }else if(typeof XDomainRequest != "undefined"){
        xhr = new XDomainRequest();
        xhr.open(method, url);
    }else{
        xhr = null;
    }
    if (!xhr) {
      throw new Error('Does your web browser support CORS?');
    }
    xhr.onload = function() {
        var text = xhr.responseText;
        console.log(text);
    };
    xhr.onerror = function() {
        alert('something is wrong!');
    };

    xhr.send();
                    

C#

 
    string sURL;
    sURL = "https://gws.gplates.org/reconstruct/coastlines/?time=50";

    WebRequest wrGETURL;
    wrGETURL = WebRequest.Create(sURL);
    
    Stream objStream;
    objStream = wrGETURL.GetResponse().GetResponseStream();

    StreamReader objReader = new StreamReader(objStream);
    objReader.ReadLine();

Shell

curl https://gws.gplates.org/reconstruct/coastlines/?time=140 > data.json

or

wget "https://gws.gplates.org/reconstruct/coastlines/?time=140" -O data.json