[netcdf-java] Some NetCDF-Java Issues in handling data via OPeNDAP


  I'd like to summarize some issues that I've found in NetCDF-Java in
handling data iva OPeNDAP. I'm not an expert in NetCDF-Java so please
correct me if my observations are wrong.

1. It reads DDS, DAS outputs and then attempts to read the contents of
all string data variables in DDS. Since some strings may be very long,
it degrades the performance.  I don’t know why it tries to access
string variables when it opens data via OPeNDAP. Reading DDS and DAS
seems sufficient.

2. If a string size  is more than 32767, it throws an error. I don’t
understand why it put such restriction yet. The line 151 and 152 of
[1] checks Short.MAX_VALUE, which is 2^15 - 1 = 32767 according to
[2]. This restriction makes it fail to access otherwise valid OPeNDAP

[2] http://docs.oracle.com/javase/6/docs/api/java/lang/Short.html#MAX_VALUE

3. It forms a very long URL string if data file has many variables
with long variable names. If the requested URL is too long for server
to handle, it returns an error “opendap.dap.DAP2.Exception: Method
failed:HTTP/1.1 400 Bad Request on URL=http...<all variables will be
listed here>”. I don’t understand why it tries to append all variables
to get DDS output. Here's the part of code that constructs a very long

// read the data
    DataDDS dataDDS;
    Map<DodsV, DodsV> map = new HashMap<DodsV, DodsV>(2 *
reqDodsVlist.size() + 1);
    if (reqDodsVlist.size() > 0) {

      // Create the request
      StringBuilder requestString = new StringBuilder();
      for (int i = 0; i < reqDodsVlist.size(); i++) {
        DodsV dodsV = reqDodsVlist.get(i);
        requestString.append(i == 0 ? "?" : ",");
        // requestString.append(makeDODSname(dodsV));
      String s = requestString.toString();

      try {
        dataDDS = readDataDDSfromServer(requestString.toString());
        root = DodsV.parseDataDDS(dataDDS);

      } catch (Exception exc) {
        logger.error("ERROR readDataDDSfromServer on " + requestString, exc);
        throw new IOException(exc.getMessage());

By the way, this problem can be resolved by editing Tomcat server's
conf/server.xml in Hyrax. By default, it’s 8K. You need to increase it
explicitly by specifying maxHttpHeaderSize.

    <Connector port="8080" maxHttpHeaderSize="65536" protocol="HTTP/1.1"
               redirectPort="8443" />


  • 2012 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: