Making Multiple ERDDAP Forms

13 views
Skip to first unread message

Samantha Ouertani - NOAA Affiliate

unread,
Apr 3, 2024, 1:01:25 PMApr 3
to ERDDAP
Hello,

I have a question regarding the Data Access Form for tabledap datasets. 
How do I query a dataset for multiple parameters in a single variable, using the "=" operator? 

For example, looking at the following dataset: https://erddap.aoml.noaa.gov/gdp/erddap/tabledap/OSMC_RealTime.html 

I would like to query the dataset for two ID's in the "platform_code" variable: ID numbers "2101853" and "7801588". I know I am able to retrieve data from both ID's using platform_code =~ "2101853|7801588"  but the ~= operator increases the time the request takes, compared to the = operator used for a single ID. Here is the request I make for the two IDs using the ~= operator: https://erddap.aoml.noaa.gov/gdp/erddap/tabledap/OSMC_RealTime.asc?platform_code%2Ctime%2Clatitude%2Clongitude%2Csst&platform_code=~%222101853%7C7801588%22

How can I request multiple IDs with the = operator? For this example, I am only requesting two IDs, but ideally I would like to request up to 60 IDs at once. 

Thank you,
Samantha

--
Samantha Ouertani (she/her and they/them)
CIMAS (UMiami/NOAA) Research Associate II
Google Voice: (954) 247-1413
samantha...@noaa.gov
Global Drifter Program at NOAA/AOML
4301 Rickenbacker Cswy
Miami, Florida, U.S.A. 33149

bobsimons2.00

unread,
Apr 3, 2024, 6:21:28 PMApr 3
to ERDDAP
You can build queries by constructing the URL that you can't build by using the Data Access Form.
But even with constructing the URL, there are only two ways to get the data for more than one platform_code, and you identified them:
1) Make a separate "=" query for each platform_code that you want.
2) Use one "=~" (regular expession) query to get all of the data for all of the platform_codes at once.
There are no alternatives.

Yes, the regular expression version takes longer to process. That's because, in most cases, ERDDAP often must filter all of the data in the dataset in order to find the matching data. That extra power (of the regular expression) comes at a cost. 

We could change the query language and make exceptions to the current rules, but I think that would be a bad idea because:
1) It adds complexity to the handling of queries.
2) Where do you stop making exceptions?
3) This exception breaks the DAP 2.0 query system which ERDDAP is following. (That's the main reason.)

I know that isn't what you want to hear. I'm sorry.
The good news is: you have 2 ways to get what you want. 

Samantha Ouertani - NOAA Affiliate

unread,
Apr 4, 2024, 11:20:46 AMApr 4
to bobsimons2.00, ERDDAP
Hi Bob,

Thank you for the clarification. I appreciate the detail you provided; I'll move forward with one of the two options you listed. 

Best,
Samantha

--
You received this message because you are subscribed to the Google Groups "ERDDAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erddap+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/erddap/f4242d8e-5dee-40ab-831a-8c8a5183fd08n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages