0

I have an application server creating rasters from the vector data it receives periodically. The data contains either "real" measurements or forecasts about a specific weather phenomenon, and each case is mapped to the relevant database tables, like the following simplified schema

enter image description here

As I understand it, I can create a SQL View that contain all the needed information for a valid mosaic schema, getting the union of MeasurementReportRaster and ForecastReportRaster for a specified phenomenon, for example

the_geom      (the raster extent polygon as in the documentation, BoundingBox in my schema)
location      (the LocationAttribute)
ingestion     (the TimeAttribute, ReportDtm for measurements, ForecastDtm for forecasts)

I was planning on not using the GeoServer API to add/edit/remove granules, but make the neccessary changes in the database from outside GeoServer, and let GeoServer use the derived View for indexing purposes, only reading and never writing in the database.

I did not yet have any success setting up the ImageMosaic store, is this even possible?

If yes I seek some help with the configuration in datastore.properties and indexer.properties, since I still don't clearly understand how everything works, even after reading the documentation multiple times already.


I was adding more info about the configuration, and while I was trying some more things it finally worked. I still don't get it completely but I will probably ask some more specific questions in different Q&As.

I am using the following view:

                   View "public.rain_mosaic_index_v"
  Column   |            Type             | Collation | Nullable | Default
-----------+-----------------------------+-----------+----------+---------
 the_geom  | geometry(Polygon,4326)      |           |          |
 location  | character varying(255)      |           |          |
 ingestion | timestamp without time zone |           |          |

The location is the absolute path to a raster file.

In the folder where I store the raster GeoTiffs, I also have the two configuration files:

indexer.properties

Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date
TimeAttribute=ingestion
Name=rain_mosaic_index_v
AbsolutePath=true
Caching=false
Recursive=false
CanBeEmpty=true
UseExistingSchema=true

datastore.properties

SPI=org.geotools.data.postgis.PostgisNGDataStoreFactory
host=localhost
port=5432
database=dbname
schema=public
user=username
passwd=password

Loose\ bbox=true
Estimated\ extends=false
validate\ connections=true
Connection\ timeout=10
preparedStatements=true
1
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Jan 18, 2021 at 10:25

1 Answer 1

3

You cannot use a GeoServer SQL View construct, but you can define a view in your database instead (e.g. with CREATE VIEW myView as SELECT *....) and then specify it as the source of the mosaic index using the TypeName parameter (which would be placed in the indexer.properties). You'll also need to add the UseExistingSchema property, set to true.

You might need to go back and forth a few times to get it working, at every step, please remember to start from a clean setup, without generated files (the sample image, the final mosaic property files).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.