Re: [Geoserver-users] Reload ImageMosaic store via Rest API

2016-06-01 Thread Ivan Kotev
Many thanks, Peter - this is what I needed.

As of now I will go with reindexing the whole layer. It seems that the
operation is taking less than a second so this is pretty fine for my
requirements.

Cheers,
Ivan

Date: Wed, 1 Jun 2016 08:50:29 +0200
From: Peter Kovac <peter.ko...@microstep-mis.com>
Subject: Re: [Geoserver-users] Reload ImageMosaic store via Rest API
To: geoserver-users@lists.sourceforge.net
Message-ID: <bdf8269e-5bf2-7158-bd7c-10a75a5d0...@microstep-mis.com>
Content-Type: text/plain; charset="windows-1252"

Hi Ivan,

what you want to do is what ImageMosaic calls "reindexing granules".

You can reindex the whole layer, but it is time consuming and
inefficient, because GeoServer will reexamine each granule (individual
GeoTIFF raster) and delete it from the index or add it to the index. It
might take a couple of minutes and performance for ordinary WMS requests
drops badly during that period.

curl -v -u username:password -XPOST -H "Content-type: text/plain" \
  -d "file:/path/to/dir/with/geotiff/files/" \
  
"http://localhost:8080/geoserver/rest/workspaces//coveragestores//external.imagemosaic
<http://localhost:8080/geoserver/rest/workspaces/POVAPSYS/coveragestores/aladin_test3temperature/external.imagemosaic>"


Much better approach (at least in my scenario) is to index each granule
individually just when the file is ready and is copied to the ImageMosaic
directory.
curl -v -u username:password -XPOST -H "Content-type: text/plain" \
-d "file:/path/to/dir/with/geotiff/files/your_file.tiff" \

"http://localhost:8080/geoserver/rest/workspaces//coveragestores//external.imagemosaic"


Use another REST call to delete old granules. You can use filter to e.g.
delete all granules older than 1st January 2016 (assuming you use the time
dimension).
curl -u "user:pass" -XDELETE
"http://localhost:8080/geoserver/rest/workspaces//coveragestores//coverages//index/granules.xml?filter=time%20BEFORE%202016-01-01T00:00:00Z
<http://localhost:8080/geoserver/rest/workspaces/RADMON/coveragestores/radmon_short_range/coverages/short_range/index/granules.xml?filter=time%20BEFORE%202016-01-01T00:00:00Z>"


Useful resources are online tutorial by GeoSolutions (
http://geoserver.geo-solutions.it/multidim/en/index.html ) and REST API
docs (
http://docs.geoserver.org/stable/en/user/rest/api/coverages.html#structured-coverages
).


Peter

On 31. 5. 2016 16:14, Ivan Kotev wrote:
>
> Hello All,
>
> This might be quite trivial but I cannot seem to be able to figure it
> out based on the Rest API documentation.
>
> I have several ImageMosaic stores (each of them has exactly 1 layer)
> which are in turn backed by GeoTIFF data files. Every few hours I
> refresh the data by uploading new GeoTIFF files and removing the old
> ones (external operation to GeoServer).
>
> I am looking for a Rest API based approach to the reload the data for
> a particular ImageMosaic store. Currently what I am doing is:
>
> "POST /geoserver/rest/reload", followed by:
> "POST /geoserver/rest/reset"
>
> This seems to be working but it reloads the data for *all* datastores
> which is a bit of overkill.
>
> Is there a Rest API to reload the data for a given ImageMosaic
> store/layer?
>
> Thanks much in advance.
>
> Cheers,
> Ivan

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] Reload ImageMosaic store via Rest API

2016-06-01 Thread Peter Kovac

Hi Ivan,

what you want to do is what ImageMosaic calls "reindexing granules".

You can reindex the whole layer, but it is time consuming and 
inefficient, because GeoServer will reexamine each granule (individual 
GeoTIFF raster) and delete it from the index or add it to the index. It 
might take a couple of minutes and performance for ordinary WMS requests 
drops badly during that period.


curl -v -u username:password -XPOST -H "Content-type: text/plain" \
 -d "file:/path/to/dir/with/geotiff/files/" \
 "http://localhost:8080/geoserver/rest/workspaces//coveragestores//external.imagemosaic 
"



Much better approach (at least in my scenario) is to index each granule 
individually just when the file is ready and is copied to the ImageMosaic 
directory.
curl -v -u username:password -XPOST -H "Content-type: text/plain" \
-d "file:/path/to/dir/with/geotiff/files/your_file.tiff" \

"http://localhost:8080/geoserver/rest/workspaces//coveragestores//external.imagemosaic"


Use another REST call to delete old granules. You can use filter to e.g. delete 
all granules older than 1st January 2016 (assuming you use the time dimension).
curl -u "user:pass" -XDELETE "http://localhost:8080/geoserver/rest/workspaces//coveragestores//coverages//index/granules.xml?filter=time%20BEFORE%202016-01-01T00:00:00Z 
"



Useful resources are online tutorial by GeoSolutions ( 
http://geoserver.geo-solutions.it/multidim/en/index.html ) and REST API 
docs ( 
http://docs.geoserver.org/stable/en/user/rest/api/coverages.html#structured-coverages 
).



Peter

On 31. 5. 2016 16:14, Ivan Kotev wrote:


Hello All,

This might be quite trivial but I cannot seem to be able to figure it 
out based on the Rest API documentation.


I have several ImageMosaic stores (each of them has exactly 1 layer) 
which are in turn backed by GeoTIFF data files. Every few hours I 
refresh the data by uploading new GeoTIFF files and removing the old 
ones (external operation to GeoServer).


I am looking for a Rest API based approach to the reload the data for 
a particular ImageMosaic store. Currently what I am doing is:


"POST /geoserver/rest/reload", followed by:
"POST /geoserver/rest/reset"

This seems to be working but it reloads the data for *all* datastores 
which is a bit of overkill.


Is there a Rest API to reload the data for a given ImageMosaic 
store/layer?


Thanks much in advance.

Cheers,
Ivan



--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e


___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


--
Peter Kovac
IMS Programmer
MicroStep-MIS
peter.ko...@microstep-mis.com

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] Reload ImageMosaic store via Rest API

2016-05-31 Thread Jim Hughes

Hi Ivan,

We've had a project dig into the ImageMosaic plugin recently.

What happens if you use the GeoServer UI to re-'save' the ImageMosaic 
layer?  I've seen that reload just the datastores and layers associated.


If that doesn't work for the plugin, there may be a small bit of work 
required to clean things up so that it does.


Cheers,

Jim

On 05/31/2016 10:14 AM, Ivan Kotev wrote:


Hello All,

This might be quite trivial but I cannot seem to be able to figure it 
out based on the Rest API documentation.


I have several ImageMosaic stores (each of them has exactly 1 layer) 
which are in turn backed by GeoTIFF data files. Every few hours I 
refresh the data by uploading new GeoTIFF files and removing the old 
ones (external operation to GeoServer).


I am looking for a Rest API based approach to the reload the data for 
a particular ImageMosaic store. Currently what I am doing is:


"POST /geoserver/rest/reload", followed by:
"POST /geoserver/rest/reset"

This seems to be working but it reloads the data for *all* datastores 
which is a bit of overkill.


Is there a Rest API to reload the data for a given ImageMosaic 
store/layer?


Thanks much in advance.

Cheers,
Ivan



--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e


___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


[Geoserver-users] Reload ImageMosaic store via Rest API

2016-05-31 Thread Ivan Kotev

 Hello All,

This might be quite trivial but I cannot seem to be able to figure it out
based on the Rest API documentation.

I have several ImageMosaic stores (each of them has exactly 1 layer) which
are in turn backed by GeoTIFF data files. Every few hours I refresh the
data by uploading new GeoTIFF files and removing the old ones (external
operation to GeoServer).

I am looking for a Rest API based approach to the reload the data for a
particular ImageMosaic store. Currently what I am doing is:

"POST /geoserver/rest/reload", followed by:
"POST /geoserver/rest/reset"

This seems to be working but it reloads the data for *all* datastores which
is a bit of overkill.

Is there a Rest API to reload the data for a given ImageMosaic
store/layer?

Thanks much in advance.

Cheers,
Ivan

 
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users