Importing data through Layer Importer user interface

Importing a single shapefile

The following example will import a zipped shapefile roads.zip in the opengeo workspace. This file will need to be either on the machine that is running GeoServer or accessible to that machine in some way, as importing a shapefile from a remote client is not currently supported.

  1. Open the Layer Importer. You will need to log in with administrator credentials.

  2. In the box marked Choose a data source to import from select Spatial Files.

    ../../_images/sources_choosesourcefiles.png

    Spatial Files data source

  3. In the box marked Configure the data source, click Browse... to open the file chooser.

    ../../_images/sources_spatialfiles.png

    Click Browse to select a file

  4. Navigate through the directory hierarchy to the file and click to select it. Don’t click OK unless you want to import all spatial files in the directory.

    ../../_images/guiexample_shpchooser.png

    Selecting a zipped shapefile

  5. In the box marked Workspace, select opengeo.

    ../../_images/guiexample_workspace.png

    Selecting the opengeo workspace

  6. Click Next to continue.

  7. The file will be analyzed by the Layer Importer. On the next page, the layer will be displayed and selected for import. Click Import to complete to the process.

    ../../_images/guiexample_shpready.png

    Shapefile ready for import

  8. The layer will be loaded into GeoServer. After completion, a select box will appear next to the layer, containing links to the (OpenLayers) Layer Preview, GeoExplorer, and Google Earth. Click on any of these to view the newly-loaded layer.

    ../../_images/guiexample_previewlinks.png

    Layer previewing options

Note

The Layer Importer doesn’t require shapefiles to be archived. As shown in the next example, pointing the Layer Importer to a directory that contains a single shapefile will be imported in exactly the same way, so long as the directory contains all of the required component files (.shp, .shx, .dbf, etc.).

Importing multiple shapefiles

The following example will load a directory of shapefiles in the opengeo workspace. This directory will need to be either on the machine that is running GeoServer or accessible to that machine in some way, as importing shapefiles from a remote client is not currently supported.

  1. Open the Layer Importer. You will need to log in with administrator credentials.

  2. In the box marked Choose a data source to import from select Spatial Files.

    ../../_images/sources_choosesourcefiles.png

    Spatial Files data source

  3. In the box marked Configure the data source, click Browse... to open the file chooser.

    ../../_images/sources_spatialfiles.png

    Click Browse to select a file

  4. Navigate through the directory hierarchy to the directory that contains the shapefiles. Click to open that directory, so that the contents are showing, then click OK.

    ../../_images/sources_filechooser.png

    Selecting a directory of shapefiles

  5. In the box marked Workspace, select opengeo.

    ../../_images/guiexample_workspace.png

    Selecting the opengeo workspace

  6. Click Next to continue.

  7. The contents of the directory will be analyzed by the Layer Importer. On the next page, all layers found will be displayed and selected for import. Click Import to complete to the process.

    ../../_images/layerlist_select.png

    List of shapefiles ready for import

  8. The layers will all be loaded into GeoServer. After completion, a select box will appear next to each layer, containing links to the (OpenLayers) Layer Preview, GeoExplorer, and Google Earth. Click on any of these to view the newly-loaded layers.

    ../../_images/guiexample_previewlinks.png

    Layer previewing options

Importing a GeoTIFF file

The following example will import a zipped GeoTIFF file landuse.zip and create a new data store in the opengeo workspace.

The following example will load a directory of shapefiles in the opengeo workspace. This directory will need to be either on the machine that is running GeoServer or accessible to that machine in some way, as importing shapefiles from a remote client is not currently supported.

  1. Open the Layer Importer. You will need to log in with administrator credentials.

  2. In the box marked Choose a data source to import from select Spatial Files.

    ../../_images/sources_choosesourcefiles.png

    Spatial Files data source

  3. In the box marked Configure the data source, click Browse... to open the file chooser.

    ../../_images/sources_spatialfiles.png

    Click Browse to select a file

  4. Navigate through the directory hierarchy to the file and click to select it. Don’t click OK unless you want to import all spatial files in the directory.

    ../../_images/guiexample_geotiffchooser.png

    Selecting a zipped GeoTIFF

  5. In the box marked Workspace, select opengeo.

    ../../_images/guiexample_workspace.png

    Selecting the opengeo workspace

  6. In the box marked Store, select Create new.

    ../../_images/guiexample_newstore.png

    Selecting a new store to be created

  7. Click Next to continue.

  8. The file will be analyzed by the Layer Importer. On the next page, the layer will be displayed and selected for import. Click Import to complete to the process.

    ../../_images/guiexample_geotiffready.png

    GeoTIFF ready for import

  9. The layer will be loaded into GeoServer. After completion, a select box will appear next to the layer, containing links to the (OpenLayers) Layer Preview, GeoExplorer, and Google Earth. Click on any of these to view the newly-loaded layer.

    ../../_images/guiexample_previewlinks.png

    Layer previewing options

Note

The Layer Importer doesn’t require GeoTIFFs to be archived. As shown in the previous example, pointing the Layer Importer to a directory that contains a single GeoTIFF will be imported in exactly the same way.

Importing PostGIS tables

The following example will import PostGIS tables from a database called municipal into GeoServer in the opengeo workspace. Each table will be loaded as a layer.

  1. Open the Layer Importer. You will need to log in with administrator credentials.
  2. In the box marked Choose a data source to import from select PostGIS.
../../_images/sources_choosesourcepostgis.png

PostGIS data source

  1. Fill in the connection parameters. On a default Linux installation, for example, the form fields would be:

    Field Value
    Connection type Default
    Host localhost
    Port 5432
    Database municipal
    Schema public
    Username postgres
    Password postgres
    ../../_images/guiexample_postgisconnection.png

    PostGIS connection parameters

  2. In the box marked Workspace, select opengeo.

    ../../_images/guiexample_workspace.png

    Selecting the opengeo workspace

  3. Click Next to continue.

  4. The database will be analyzed by the Layer Importer. On the next page, every table containing spatial information that GeoServer can parse will be displayed and selected for import. Click Import to complete to the process.

  5. Every table will be loaded as layers in GeoServer. After completion, a select box will appear next to each layer, containing links to the (OpenLayers) Layer Preview, GeoExplorer, and Google Earth. Click on any of these to view the newly-loaded layer.

    ../../_images/guiexample_previewlinks.png

    Layer previewing options