NOAA   ERDDAP   Easier access to scientific data Brought to you by NOAA NMFS SFSC ERD    

ERDDAP > Computer Programs

Accessing ERDDAP as a Web Service

In addition to ERDDAP's methods for requesting data from remote data sources (griddap for gridded data and tabledap for tabular data),
and for requesting maps via Make A Graph and WMS.
ERDDAP lets computer programs access features in ERDDAP's interface (for example, the Full Text Search for Datasets).
These features can be used to build another web service on top of ERDDAP (making ERDDAP do all the work!).
So if you don't like ERDDAP's interface, we encourage you to build your own, and use ERDDAP as the foundation.
Your program can get data from our ERDDAP server, or you can set up your own ERDDAP server.

Requests
Requests for interface information from ERDDAP (for example, search results) use the web's universal standard for requests: HTTP GET.
This is the same mechanism that your browser uses when you fill out a form on a web page and click on Submit.
To use HTTP GET, you generate a specially formed URL (perhaps with a query) and send it to the web with HTTP GET.
You can form these URLs by hand and enter them in the address textfield of your browser
(for example, http://coastwatch.pfeg.noaa.gov/erddap/search/index.htmlTable?searchFor=all),
or a computer program can be written to create the URLs, submit them, and get the responses.
Often, the computer program will need to percent encode the URL (for example, replace "[" with "%5B").
Programming languages have tools to do this (for example, see java.net.URLEncoder).
HTTP GET was chosen because it is simple, it works, it is universally supported, and it is a foundation of REST and ROA.
These URLs are great because they completely define a given request,
and you can bookmark them in your browser, write them in your notes, email them to a friend, ...

Requesting Compressed Files
ERDDAP doesn't offer results stored in compressed (e.g., .zip or .gzip) files.
Instead, ERDDAP looks for accept-encoding in the HTTP GET request header sent by the client.
If a supported compression type ("gzip", "x-gzip", or "deflate") is found in the accept-encoding list,
ERDDAP includes "content-encoding" in the HTTP response header and compresses the data as it transmits it.
It is up to the client program to look for "content-encoding" and decompress the data.
Browsers and OPeNDAP clients do this by default. They request compressed data and decompress the returned data automatically.
Other clients (e.g., Java programs) have to do this explicitly.

Responses
Although humans using browsers want to receive interface results (for example, search results) as HTML documents,
computer programs often prefer to get results in simple, easily parsed, less verbose documents.
ERDDAP can return interface results as a table of data in these common, computer-program friendly, file types:

The first row of the table has the column names.
In some types of files, the second row has the column's Java-style data type (e.g., "String" or "float").
Subsequent rows of the table have the results.

.csv and .tsv issues:

Remember that these are the file types ERDDAP can use to respond to user-interface types of requests (for example, search requests).
ERDDAP supports a different set of file types for the actual data (for example, satellite and buoy data) requests (see griddap and tabledap).

Access URLs
ERDDAP has these URL access points for computer programs:

Using ERDDAP as a Data Source within Your Java Program

As described above, since Java programs can access data available on the web,
you can write a Java program that accesses data from any publicly accessible ERDDAP installation.

Or, since ERDDAP is an all-open source program, you can also set up your own copy of ERDDAP
on your own server (internal or public) to serve your own data.
Any Java programs that you write can get data from that copy of ERDDAP.

Or, since ERDDAP is an all-open source, all-Java program,
you can also set up your own copy of ERDDAP on your own computer within your Java program.
Then you can access ERDDAP's services from within your program
(for example, doing full-text searches for datasources or creating data files from remote data sources) .
See Set Up Your Own ERDDAP, especially the JavaDocs for the gov.noaa.pfel.erddap.Erddap class.
 
ERDDAP Version 1.12


Questions, comments, suggestions? Contact bob dot simons at noaa dot gov.
ERDDAP is a brought to you by NOAA NMFS SFSC ERD.
Disclaimers | Privacy Policy
Usage Limitations - The SeaWiFS images and data from this site may be used for free, but not redistributed;
    all other images and data from this site may be used and redistributed for free.