GPlates / gplates_web_service_doc

gplates web service documentation and examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problems with the paleocoordinate list

SaraVarela opened this issue · comments

Hello!

First, thank you very much for your amazing work and this API. It opens new avenues for research in paleodiversity and paleobiogeography :-)

In order to help paleontologists to use it, we are doing a wrap in R for analyzing paleobiodiversity through time, and, while doing this, we realized this:

when we upload our points to get the paleocoordinates, we saw 2 things:

the "perfect" example:
https://gws.gplates.org/reconstruct/reconstruct_points/?points=-120,50,120,50&time=100&model=PALEOMAP

answer:
{"type":"MultiPoint","coordinates":[[-80.08,45.58],[108.72,56.06]]}

which is ok.

But, if some of the paleocoordinates can not be calculated, the API is not returning NA for this coordinate, it is ignoring it!

http://gws.gplates.org/reconstruct/reconstruct_points/?points=-100,50,160,10&time=100&model=PALEOMAP

answer:
{"type":"MultiPoint","coordinates":[[-56.84,47.13]]}

it is just giving me one point. (So I can not identify which one is the "bad" point).

Or even, if some coordinate is wrong, the function does not work, at all.
https://gws.gplates.org/reconstruct/reconstruct_points/?points=-120,100,120,50&time=100&model=PALEOMAP
answer:
Invalid longitude or latitude (invalid latitude value 100).

In our case, users will upload their coordinates, and I am sure that there will be mistakes and also coordinates out of the boundaries of the paleogeographic models. So, I would need to identify which are the correct points. I would need to have an answer for the ones that are ok, and identify which ones are not ok. Just a list of paleocoordinates, with NAs in the position of the bad/mistaken points will work for us.

cheers from Berlin,
Sara

Hi Sara,
Thank you for reporting this issue. We will improve the service accordingly. Meanwhile, there is a workaround. If you use the "fc" parameter, the service will return a feature collection and the invalid points will also be listed in the feature collection. For example,

https://gws.gplates.org/reconstruct/reconstruct_points/?points=-100,50,160,10&time=100&model=PALEOMAP&fc

This request will get a response like this

{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-56.84, 47.13]
},
"properties": {
"valid_time": [4500.0, "-inf"]
}
}, {
"type": "Feature",
"geometry": null,
"properties": {
"valid_time": [0.0, "0.0"]
}
}]
}

As for the invalid latitude or longitude coordinates, for now, I think you can write some R code to validate them before calling the web service. I think it would be more efficient using local code to valid input data. The service request lat(-90,90) lon(-180,180).

Michael Chin

Hi @michaelchin,
ok. thanks!
:-)