0

I am trying to create an Image Mosaic of a set of NetCDF files that is time series based. I have read all the docs on docs.geoserver.org and various other places on the web but have not had any success. My netcdf files in general work well in GeoServer 2.15.0 however adding them one at a time manually is not a good process for us. We are generating new forecast data daily (or rather NOAA is) and monthly so the process needs to be dynamic. My data looks like as follows: List of weather data

I generated the indexer.xml and _auxiliary.xml files using following command:

java -cp '/usr/share/java/*:/usr/share/geoserver/webapps/geoserver/WEB-INF/lib/*' org.geotools.coverage.io.netcdf.tools.CreateIndexer ./wd_201802.nc -p ../user_projections/epsg.properties .

Here is the auxiliary file:

<?xml version="1.0" encoding="UTF-8"?><Indexer>
<coverages>
    <coverage>
        <schema name="windspd">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>windspd</origName>
        <name>windspd</name>
    </coverage>
    <coverage>
        <schema name="currdir">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>currdir</origName>
        <name>currdir</name>
    </coverage>
    <coverage>
        <schema name="ssp">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>ssp</origName>
        <name>ssp</name>
    </coverage>
    <coverage>
        <schema name="swh">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>swh</origName>
        <name>swh</name>
    </coverage>
    <coverage>
        <schema name="sst">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>sst</origName>
        <name>sst</name>
    </coverage>
    <coverage>
        <schema name="winddir">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>winddir</origName>
        <name>winddir</name>
    </coverage>
    <coverage>
        <schema name="mwd">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>mwd</origName>
        <name>mwd</name>
    </coverage>
    <coverage>
        <schema name="currspd">
            <attributes>the_geom:Polygon,imageindex:Integer,time:java.util.Date</attributes>
        </schema>
        <origName>currspd</origName>
        <name>currspd</name>
    </coverage>
</coverages>

and the indexer.xml:

    <?xml version="1.0" encoding="UTF-8"?><Indexer>
  <domains>
    <domain name="time">
      <attributes><attribute>time</attribute></attributes>
    </domain>
  </domains>
  <coverages>
    <coverage>
      <name>windspd</name>
      <schema name="windspd" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
    <coverage>
      <name>currdir</name>
      <schema name="currdir" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
    <coverage>
      <name>ssp</name>
      <schema name="ssp" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
    <coverage>
      <name>swh</name>
      <schema name="swh" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
    <coverage>
      <name>sst</name>
      <schema name="sst" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
    <coverage>
      <name>winddir</name>
      <schema name="winddir" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
    <coverage>
      <name>mwd</name>
      <schema name="mwd" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
    <coverage>
      <name>currspd</name>
      <schema name="currspd" >
        <attributes>the_geom:Polygon,imageindex:Integer,location:String,time:java.util.Date</attributes>
      </schema>
      <domains>
        <domain ref="time" />
      </domains>
    </coverage>
  </coverages>
  <parameters>
    <parameter name="AuxiliaryFile" value="./_auxiliary.xml" />
    <parameter name="AbsolutePath" value="true" />
  </parameters>
</Indexer>

I also tried to create the timeregex.properties with the following:

regex=[0-9]{6}

But it did not help. I also tried creating the indexer.properties with:

TimeAttribute=time
Schema=*the_geom:Polygon,location:String,time:java.util.Date
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](time)

It also did not help. I always get the error Schema 'currdir' does not exist.

Update: Got rid of .properties files as they are not needed and I updated my indexer.xml based on following link: https://gis.stackexchange.com/questions/314447/geoserver-image-mosaic-format-date-time-for-timestampfilenameextractorspi-in-i?rq=1

To add the following:

<attributes><attribute ref="timeCollector">time</attribute></attributes>

...

  <collectors>
     <collector name="timeCollector">
        <value>regex=[0-9]{6},format=yyyyMM</value>
       <spi>TimestampFileNameExtractorSPI</spi>
       <mapped>time</mapped>
    </collector>
  </collectors>

This had same error result:

28 Mar 00:41:24 ERROR [org.geotools.gce.imagemosaic] - Schema 'currdir' does not exist.
java.io.IOException: Schema 'currdir' does not exist.

More info from the GeoServer log file:

28 Mar 01:13:28 DEBUG [org.geotools.coverage.io.netcdf] - Provided URL is a file
28 Mar 01:13:28 DEBUG [org.geotools.imageio.netcdf] - Found a valid FileImageInputStream
28 Mar 01:13:28 INFO [org.geotools.coverage.io.netcdf] - ACCEPTED: /data/geoserver/netcdf/wd_201812.nc
28 Mar 01:13:28 DEBUG [org.geotools.imageio.netcdf] - Found a valid FileImageInputStream
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CREATE CONNECTION
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CREATE CONNECTION
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - Getting information about primary keys of currdir
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - Grabbing table pk metadata: SELECT "fid" FROM "currdir" WHERE 0=1
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
28 Mar 01:13:28 TRACE [org.geotools.util.factory] - ENTRY  (FeatureTypeFactory, FEATURE_TYPE_FACTORY)
28 Mar 01:13:28 TRACE [org.geotools.util.factory] - RETURN (FeatureTypeFactory, FEATURE_TYPE_FACTORY): found implementation Optional.
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CREATE CONNECTION
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - SELECT type FROM geometry_columns WHERE f_table_schema = 'PUBLIC' AND f_table_name = 'currdir' AND f_geometry_column = 'the_geom'
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CREATE CONNECTION
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - Getting information about primary keys of windspd
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - Grabbing table pk metadata: SELECT "fid" FROM "windspd" WHERE 0=1
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
28 Mar 01:13:28 TRACE [org.geotools.util.factory] - ENTRY  (FeatureTypeFactory, FEATURE_TYPE_FACTORY)
28 Mar 01:13:28 TRACE [org.geotools.util.factory] - RETURN (FeatureTypeFactory, FEATURE_TYPE_FACTORY): found implementation Optional.
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CREATE CONNECTION
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - SELECT type FROM geometry_columns WHERE f_table_schema = 'PUBLIC' AND f_table_name = 'windspd' AND f_geometry_column = 'the_geom'
28 Mar 01:13:28 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
28 Mar 01:13:28 TRACE [org.geotools.util.factory] - ENTRY  (FeatureTypeFactory, FEATURE_TYPE_FACTORY)
28 Mar 01:13:28 TRACE [org.geotools.util.factory] - RETURN (FeatureTypeFactory, FEATURE_TYPE_FACTORY): found implementation Optional.
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shp by ShpFiles for deleting all files
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shp by ShpFiles for deleting all files
28 Mar 01:13:28 TRACE [org.geotools.data.shapefile.files] - SHP Channel in ShapefileWriter has been opened. Number open: 1
28 Mar 01:13:28 TRACE [org.geotools.data.shapefile.files] - SHX Channel in ShapefileWriter has been opened. Number open: 1
28 Mar 01:13:28 TRACE [org.geotools.data.shapefile.files] - SHP Channel in ShapefileWriter has been closed. Number open: 0
28 Mar 01:13:28 TRACE [org.geotools.data.shapefile.files] - SHX Channel in ShapefileWriter has been closed. Number open: 0
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.dbf] - Field Length for time set to 255 Setting to 8 digits - two longs,one long for date and one long for time
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shp by StorageFile: netcdf4543582091439156032.shp
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shp by StorageFile: netcdf4543582091439156032.shp
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Unable to rename temporary file to the file: /data/geoserver/netcdf/netcdf.shp when attempting to replace with temporary copy
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shp by StorageFile: netcdf4543582091439156032.shp
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.prj by StorageFile: netcdf6295016736880640305.prj
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Unable to rename temporary file to the file: /data/geoserver/netcdf/netcdf.prj when attempting to replace with temporary copy
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.prj by StorageFile: netcdf6295016736880640305.prj
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.dbf by StorageFile: netcdf6501391507184562215.dbf
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Unable to rename temporary file to the file: /data/geoserver/netcdf/netcdf.dbf when attempting to replace with temporary copy
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.dbf by StorageFile: netcdf6501391507184562215.dbf
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shx by StorageFile: netcdf8839355422733884326.shx
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Unable to rename temporary file to the file: /data/geoserver/netcdf/netcdf.shx when attempting to replace with temporary copy
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shx by StorageFile: netcdf8839355422733884326.shx
28 Mar 01:13:28 DEBUG [org.geotools.data.shapefile.files] - Write lock: file:/data/geoserver/netcdf/netcdf.shp by StorageFile: netcdf4543582091439156032.shp
28 Mar 01:13:28 ERROR [org.geotools.gce.imagemosaic] - Schema 'currdir' does not exist.
java.io.IOException: Schema 'currdir' does not exist.

How to fix it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.