[Geoserver-users] bulk geotiff import

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?

The REST API can be used to load and configure raster content. The importer can also be pointed at a directory of spatial files and do a bulk import … and the importer is also available via a REST API :slight_smile:

···

On 6 January 2016 at 09:24, Alex O’Ree <spyhunter99@anonymised.com> wrote:

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?



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


Jody Garnett

Fantastic, can you point me towards the documentation or any where
with more info?

On Wed, Jan 6, 2016 at 12:36 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

The REST API can be used to load and configure raster content. The importer
can also be pointed at a directory of spatial files and do a bulk import ...
and the importer is also available via a REST API :slight_smile:

--
Jody Garnett

On 6 January 2016 at 09:24, Alex O'Ree <spyhunter99@anonymised.com> wrote:

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?

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

Found it here, http://docs.geoserver.org/stable/en/user/rest/api/datastores.html

thanks for the pointer!

On Wed, Jan 6, 2016 at 12:54 PM, Alex O'Ree <spyhunter99@anonymised.com> wrote:

Fantastic, can you point me towards the documentation or any where
with more info?

On Wed, Jan 6, 2016 at 12:36 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

The REST API can be used to load and configure raster content. The importer
can also be pointed at a directory of spatial files and do a bulk import ...
and the importer is also available via a REST API :slight_smile:

--
Jody Garnett

On 6 January 2016 at 09:24, Alex O'Ree <spyhunter99@anonymised.com> wrote:

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?

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

Jody, et al

I'm having some issues get the geotiffs imported via the REST API. I
can import from the web app without any issues. I think I may either
be misinterpreting the documentation and/or the docs may be slightly
inaccurate.

First a bit more info for my setup. v 2.8.RC1
All geotiff files are located in data_dir/maps

I have a workspace called "maps"

I've tried a number of different combinations
HTTP verb: POST
URL http://localhost:8080/geoserver/rest/workspaces/maps/datastores.json
Content-type application/json
Body contents
{
Location: "file:///data_dir/maps/MyGeoTiff.tiff"
}

I'm getting an 500 internal server error. The server logs say, cannot
resolve class exception "Location".

I'm not sure what "right" looks like here. Any pointers to examples?

On Wed, Jan 6, 2016 at 3:57 PM, Alex O'Ree <spyhunter99@anonymised.com> wrote:

Found it here, http://docs.geoserver.org/stable/en/user/rest/api/datastores.html

thanks for the pointer!

On Wed, Jan 6, 2016 at 12:54 PM, Alex O'Ree <spyhunter99@anonymised.com> wrote:

Fantastic, can you point me towards the documentation or any where
with more info?

On Wed, Jan 6, 2016 at 12:36 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

The REST API can be used to load and configure raster content. The importer
can also be pointed at a directory of spatial files and do a bulk import ...
and the importer is also available via a REST API :slight_smile:

--
Jody Garnett

On 6 January 2016 at 09:24, Alex O'Ree <spyhunter99@anonymised.com> wrote:

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?

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

HTTP PUT to

http://localhost:8080/geoserver/rest/workspaces/myworkspace/datastores/test/external.shp
with the content text/plain
file://data_dir/maps/xyz.tiff

fails with "unable to configure datastore, bad parameters. I'm
assuming this is from the .shp extension.
Changing the extension of the put url to .tiff I get

unsupported format: tiff

I've tried with a few other variants.

It looks like REST API creation of datastores is limited to shape
files. Is that correct?

On Thu, Jan 7, 2016 at 12:59 PM, Alex O'Ree <spyhunter99@anonymised.com> wrote:

Jody, et al

I'm having some issues get the geotiffs imported via the REST API. I
can import from the web app without any issues. I think I may either
be misinterpreting the documentation and/or the docs may be slightly
inaccurate.

First a bit more info for my setup. v 2.8.RC1
All geotiff files are located in data_dir/maps

I have a workspace called "maps"

I've tried a number of different combinations
HTTP verb: POST
URL http://localhost:8080/geoserver/rest/workspaces/maps/datastores.json
Content-type application/json
Body contents
{
Location: "file:///data_dir/maps/MyGeoTiff.tiff"
}

I'm getting an 500 internal server error. The server logs say, cannot
resolve class exception "Location".

I'm not sure what "right" looks like here. Any pointers to examples?

On Wed, Jan 6, 2016 at 3:57 PM, Alex O'Ree <spyhunter99@anonymised.com> wrote:

Found it here, http://docs.geoserver.org/stable/en/user/rest/api/datastores.html

thanks for the pointer!

On Wed, Jan 6, 2016 at 12:54 PM, Alex O'Ree <spyhunter99@anonymised.com> wrote:

Fantastic, can you point me towards the documentation or any where
with more info?

On Wed, Jan 6, 2016 at 12:36 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

The REST API can be used to load and configure raster content. The importer
can also be pointed at a directory of spatial files and do a bulk import ...
and the importer is also available via a REST API :slight_smile:

--
Jody Garnett

On 6 January 2016 at 09:24, Alex O'Ree <spyhunter99@anonymised.com> wrote:

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?

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

Hi Alex,

try this if you have the file on your local computer:

curl -u “user:password” -XPUT -H ‘Content-type: image/tiff’
–data-binary @“$LOCAL_GEOTIFF”
"http://$HOSTNAME:$PORT/geoserver/rest/workspaces/$WORKSPACE/coveragestores/$STORE_NAME/file.geotiff

where variables are the following:
$LOCAL_GEOTIFF - path to the file on your local computer
$HOSTNAME, $PORT - obviously GeoServer instance hostname and port
$WORKSPACE - workspace name
$STORE_NAME - name of the datastore that will be created for your GeoTIFF

If the file is already on the server where the GeoServer runs (and the file is readable by the GeoServer process), try it like this

REMOTE_GEOTIFF=“file:///path/to/your/remote/geotiff.tiff”
curl -w “%{http_code}” -u “admin:Merc4tr99” -XPUT -H ‘Content-type: text/plain’
-d “$REMOTE_GEOTIFF”
http://$HOSTNAME:$PORT/geoserver/rest/workspaces/$WORKSPACE/coveragestores/$STORE_NAME/external.geotiff”

I think your confusion stems from using incorrect documentation: you have raster data, so you should read “Coverage stores” section of the manual: http://docs.geoserver.org/stable/en/user/rest/api/coveragestores.html

Data stores are for vector data (citing http://docs.geoserver.org/stable/en/user/rest/api/datastores.html ):

···

On 12. 1. 2016 18:25, Alex O’Ree wrote:

HTTP PUT to

[http://localhost:8080/geoserver/rest/workspaces/myworkspace/datastores/test/external.shp](http://localhost:8080/geoserver/rest/workspaces/myworkspace/datastores/test/external.shp)
with the content text/plain
file://data_dir/maps/xyz.tiff

fails with "unable to configure datastore, bad parameters. I'm
assuming this is from the .shp extension.
Changing the extension of the put url to .tiff I get

unsupported format: tiff

I've tried with a few other variants.

It looks like REST API creation of datastores is limited to shape
files. Is that correct?

On Thu, Jan 7, 2016 at 12:59 PM, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com) wrote:

Jody, et al

I'm having some issues get the geotiffs imported via the REST API. I
can import from the web app without any issues. I think I may either
be misinterpreting the documentation and/or the docs may be slightly
inaccurate.

First a bit more info for my setup. v 2.8.RC1
All geotiff files are located in data_dir/maps

I have a workspace called "maps"

I've tried a number of different combinations
HTTP verb: POST
URL [http://localhost:8080/geoserver/rest/workspaces/maps/datastores.json](http://localhost:8080/geoserver/rest/workspaces/maps/datastores.json)
Content-type application/json
Body contents
{
Location: "file:///data_dir/maps/MyGeoTiff.tiff"
}

I'm getting an 500 internal server error. The server logs say, cannot
resolve class exception "Location".

I'm not sure what "right" looks like here. Any pointers to examples?

On Wed, Jan 6, 2016 at 3:57 PM, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com) wrote:

Found it here, [http://docs.geoserver.org/stable/en/user/rest/api/datastores.html](http://docs.geoserver.org/stable/en/user/rest/api/datastores.html)

thanks for the pointer!

On Wed, Jan 6, 2016 at 12:54 PM, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com) wrote:

Fantastic, can you point me towards the documentation or any where
with more info?

On Wed, Jan 6, 2016 at 12:36 PM, Jody Garnett [<jody.garnett@anonymised.com>](mailto:jody.garnett@anonymised.com) wrote:

The REST API can be used to load and configure raster content. The importer
can also be pointed at a directory of spatial files and do a bulk import ...
and the importer is also available via a REST API :)

--
Jody Garnett

On 6 January 2016 at 09:24, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com) wrote:

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@anonymised.comsourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
[http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140](http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140)
_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@anonymised.comsourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)

-- 
Peter Kovac
IMS Programmer
MicroStep-MIS
[peter.kovac@anonymised.com](mailto:peter.kovac@anonymised.com)

It worked! Thanks so much!

On Jan 13, 2016 2:58 AM, “Peter Kovac” <peter.kovac@anonymised.com> wrote:

Hi Alex,

try this if you have the file on your local computer:

curl -u “user:password” -XPUT -H ‘Content-type: image/tiff’
–data-binary @“$LOCAL_GEOTIFF”
"http://$HOSTNAME:$PORT/geoserver/rest/workspaces/$WORKSPACE/coveragestores/$STORE_NAME/file.geotiff

where variables are the following:
$LOCAL_GEOTIFF - path to the file on your local computer
$HOSTNAME, $PORT - obviously GeoServer instance hostname and port
$WORKSPACE - workspace name
$STORE_NAME - name of the datastore that will be created for your GeoTIFF

If the file is already on the server where the GeoServer runs (and the file is readable by the GeoServer process), try it like this

REMOTE_GEOTIFF=“file:///path/to/your/remote/geotiff.tiff”
curl -w “%{http_code}” -u “admin:Merc4tr99” -XPUT -H ‘Content-type: text/plain’
-d “$REMOTE_GEOTIFF”
http://$HOSTNAME:$PORT/geoserver/rest/workspaces/$WORKSPACE/coveragestores/$STORE_NAME/external.geotiff”

I think your confusion stems from using incorrect documentation: you have raster data, so you should read “Coverage stores” section of the manual: http://docs.geoserver.org/stable/en/user/rest/api/coveragestores.html

Data stores are for vector data (citing http://docs.geoserver.org/stable/en/user/rest/api/datastores.html ):

A data store contains vector format spatial data. It can be a file (such as a shapefile), a database (such as PostGIS), or a server (such as a remote Web Feature Service).

On 12. 1. 2016 18:25, Alex O’Ree wrote:

HTTP PUT to

[http://localhost:8080/geoserver/rest/workspaces/myworkspace/datastores/test/external.shp](http://localhost:8080/geoserver/rest/workspaces/myworkspace/datastores/test/external.shp)
with the content text/plain
file://data_dir/maps/xyz.tiff

fails with "unable to configure datastore, bad parameters. I'm
assuming this is from the .shp extension.
Changing the extension of the put url to .tiff I get

unsupported format: tiff

I've tried with a few other variants.

It looks like REST API creation of datastores is limited to shape
files. Is that correct?

On Thu, Jan 7, 2016 at 12:59 PM, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com) wrote:

Jody, et al

I'm having some issues get the geotiffs imported via the REST API. I
can import from the web app without any issues. I think I may either
be misinterpreting the documentation and/or the docs may be slightly
inaccurate.

First a bit more info for my setup. v 2.8.RC1
All geotiff files are located in data_dir/maps

I have a workspace called "maps"

I've tried a number of different combinations
HTTP verb: POST
URL [http://localhost:8080/geoserver/rest/workspaces/maps/datastores.json](http://localhost:8080/geoserver/rest/workspaces/maps/datastores.json)
Content-type application/json
Body contents
{
Location: "file:///data_dir/maps/MyGeoTiff.tiff"
}

I'm getting an 500 internal server error. The server logs say, cannot
resolve class exception "Location".

I'm not sure what "right" looks like here. Any pointers to examples?

On Wed, Jan 6, 2016 at 3:57 PM, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com) wrote:

Found it here, [http://docs.geoserver.org/stable/en/user/rest/api/datastores.html](http://docs.geoserver.org/stable/en/user/rest/api/datastores.html)

thanks for the pointer!

On Wed, Jan 6, 2016 at 12:54 PM, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com) wrote:

Fantastic, can you point me towards the documentation or any where
with more info?

On Wed, Jan 6, 2016 at 12:36 PM, Jody Garnett [<jody.garnett@anonymised.com>](mailto:jody.garnett@anonymised.com) wrote:

The REST API can be used to load and configure raster content. The importer
can also be pointed at a directory of spatial files and do a bulk import ...
and the importer is also available via a REST API :)

--
Jody Garnett

On 6 January 2016 at 09:24, Alex O'Ree [<spyhunter99@anonymised.com>](mailto:spyhunter99@anonymised.com.84...) wrote:

I have a large collection of geotiff files, is there a process to
getting them all bulk imported into geoserver? Any kind of script or
command line interface I can use? Perhaps a rest api?

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
[http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140](http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140)
_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)

-- 
Peter Kovac
IMS Programmer
MicroStep-MIS
[peter.kovac@anonymised.com7118...](mailto:peter.kovac@anonymised.com)