ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Install ST_Raster in PostgreSQL

Available with Standard or Advanced license.

  • Place the ST_Raster library
  • Install ST_Raster

ST_Raster is a data type that allows you to store raster data directly in a geodatabase table. Use the ST_Raster type if you need to access your geodatabase raster data using SQL.

Use the Create Raster Type geoprocessing tool, or a Python script that calls the tool, to install the ST_Raster type in a geodatabase.

Note:

The ST_Raster type requires the Microsoft Visual C++ 2013 Redistributable Package (x64) when deployed on a Windows server. If the Microsoft Visual C++ 2013 Redistributable Package (x64) is not present on the PostgreSQL server, download it from the Microsoft site and install it.

Once the type is installed, you must change the geodatabase configuration settings so new rasters created in the geodatabase will use the ST_Raster data type.

Place the ST_Raster library

You must place the ST_Raster library (libst_raster_pg) in the PostgreSQL lib/pgsql directory.

You can download the libst_raster_pg library from My Esri, or copy it from an <ArcGIS Server or ArcMap installation directory>\DatabaseSupport\PostgreSQL\<Operating System> directory. Be sure to copy the correct library for your PostgreSQL server's operating system.

Once you have placed the ST_Raster library, you can install ST_Raster.

Install ST_Raster

You can either run the Create Raster Type tool from ArcGIS Desktop (Standard or Advanced), or run a Python script from an ArcGIS Server or ArcGIS Desktop (Standard or Advanced) client to install the ST_Raster type.

Run geoprocessing tools

If you have access to ArcGIS Desktop (Standard or Advanced), you can run the Create Raster Type tool to install the ST_Raster type.

  1. Start the ArcGIS Desktop client.
  2. Connect to the geodatabase as the sde user.
  3. Open the Create Raster Type tool.

    This tool is in the Geodatabase Administration toolset of the Data Management toolbox.

  4. Specify the database connection you created in step 2 as the Input Database Connection.
  5. Click OK (ArcMap) or Run (ArcGIS Pro).
  6. Export the geodatabase's current configuration settings to a text file using the Export Geodatabase Configuration Keyword tool.
  7. Edit the text file and set RASTER_STORAGE to ST_Raster.
    • If you want all raster datasets and raster catalogs to use the ST_Raster type without people having to specify a keyword, alter the RASTER_STORAGE parameter under the DEFAULTS keyword.
    • If only some of the raster datasets and raster catalogs should use the ST_Raster type, create a custom keyword and set the RASTER_STORAGE parameter for that keyword to ST_Raster.
  8. Import the altered text file to the geodatabase using the Import Geodatabase Configuration Keyword tool.

Use Python

You can run a Python script to create a database connection (.sde) file that connects to the geodatabase as the geodatabase administrator, install the ST_Raster type in the geodatabase, and set the RASTER_STORAGE parameter to ST_Raster.

  1. Create a database connection (.sde) file that connects to the geodatabase as the sde user. Be sure to save the user name and password with the connection file.

    In this example, a connection file (adminconnect.sde) is created in C:\temp.

    import arcpy
    arcpy.CreateDatabaseConnection_management (r'c:/temp',"adminconnect.sde", "POSTGRESQL", "teamdata", "DATABASE_AUTH", "sde", "Cky00r", "SAVE_USERNAME", "projects")
    

  2. Install the ST_Raster type.

    Here, the adminconnect.sde file is used by the CreateRasterType_management function to connect to the geodatabase and install the ST_Raster type:

    arcpy.CreateRasterType_management (r'c:/temp/adminconnect.sde')
    

  3. Export the current geodatabase configuration.

    In this example, the gdbconfig file is exported to the C:\temp folder.

    arcpy.ExportGeodatabaseConfigurationKeyword_management (r'c:/temp/adminconnect.sde', r'c:/temp/gdbconfig.txt')
    

  4. Open the text file in a text editor and set RASTER_STORAGE to ST_Raster.
    • If you want all raster datasets and raster catalogs to use the ST_Raster type without people having to specify a keyword, alter the RASTER_STORAGE parameter under the DEFAULTS keyword.
    • If only some of the raster datasets and raster catalogs should use the ST_Raster type, create a custom keyword and set the RASTER_STORAGE parameter for that keyword to ST_Raster.
  5. Save and close the text file.
  6. Import the edited file.

    arcpy.ImportGeodatabaseConfigurationKeyword_management (r'c:/temp/adminconnect.sde', r'c:/temp/gdbconfig.txt')
    

ST_Raster is installed in the geodatabase, and your new configuration settings are available for use when data is created.

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2017 Esri. | Privacy | Legal