I want to migrate rasters from ArcSDE 9.2 to Postgresql.

I have access to a ArcSDE server with several large raster datasets (mosaics) in ArcSDE 9.2. I can use ArcCatalog, ArcMap and ArcToolbox to view and manage the datasets. If I use the Export Raster tool, it fails, since the generated tif is larger that 4Gb.

Unfortunately, I'm not able to compile GDAL with SDE support. I have access to the SDE dlls installed on the server, but I don't have the ArcSDE Development Kit to compile GDAL with SDE support. I was able to compile GDAL, but not with SDE support.

I would like to split the raster mosaics. How can I split the mosaic in several smaller rasters?

  • I would recommend you abandon trying to place images in a database. Instead, I would recommend locating your source images and use a mosaic dataset. If you want to compare performance, you should locate the original images and load them using both tools. If you have to export tiles out of the database, you'll need to edit the question to specify the exact versions of all available software. Note that ArcGIS cannot read rasters stored in PostGIS rasters.
    – Vince
    Dec 1, 2016 at 3:47

1 Answer 1


I was able to export all data (vector and raster) from ArcSDE using GDAL. To have ArcSDE support in GDAL it is not necessary to compile GDAL. If you have access to an ArcSDE installation, that's enough. You will use dlls that are already installed on the server. You don’t need any media from ESRI, like ArcSDE Development Kit.

To this data transfer, I used a free Windows 7 virtual machine from Microsoft to run GDAL with SDE support.

Get GDAL up and running with ArcSDE enabled

  • Download MS4W (select ms4w_3.0.6 from the archives, not the last version)
  • Unzip it to c:\
  • Copy gdal_SDE.dll and ogr_SDE.dll from c:\ms4w\gdalplugins\ignored\sde-9.2 to c:\ms4w\gdalplugins

If you install MS4W on the same server where ArcSDE is installed, this is enough. It you are using another machine, you also need:

  • Copy your c:\arcgis\ArcSDE folder from the server running ArcSDE to the same location on your local machine (the entire folder zipped is just 32Mb)
  • Update you environment variables:
    • Add to PATH C:\arcgis\ArcSDE\sqlexe\bin;C:\ms4w\tools\gdal-ogr
    • Create SDEHOME with C:\arcgis\ArcSDE\sqlexe\

Check SDE support

Open the command prompt.

C:\Users\IEUser>cd c:\ms4w
C:\ms4w>gdalinfo --formats
Supported Formats:
  SDE (ro): ESRI ArcSDE
  VRT (rw+v): Virtual Raster
  GTiff (rw+v): GeoTIFF
  NITF (rw+v): National Imagery Transmission Format

C:\ms4w>ogrinfo --formats
Supported Formats:
  -> "SDE" (read/write)
  -> "ESRI Shapefile" (read/write)
  -> "MapInfo File" (read/write)
  -> "UK .NTF" (readonly)
  -> "SDTS" (readonly)
  -> "TIGER" (read/write)

Test with your own ArcSDE data

C:\ms4w>ogrinfo -ro -so -al SDE:,5159,FINAL,sdeuser,sdepassword,final.SDE.REDMUNICIPAL,sde.DEFAULT
INFO: Open of `SDE:,5159,FINAL,sdeuser,sdepassword,final.SDE.REDEMUNICIPAL,sd
      using driver `SDE' successful.

Geometry: Unknown (any)
Feature Count: 32974
Extent: (-42781.579992, 113467.000009) - (-31999.999950, 129415.940056)
Layer SRS WKT:

C:\ms4w>gdalinfo SDE:,5158,raster,sdeuser,sdepassword,raster.SDE.REN
Files: none associated
Size is 6693, 8639
Coordinate System is:

Use GDAL to get data from ArcSDE

For my use case, I’ve transferred vector data directly from ArcSDE to Postgis with:

ogr2ogr -append -f "PostgreSQL" PG:"host= user=geobox dbname=final password=geobox active_schema=teste" SDE:,5159,FINAL,sdeuser,sdepassword,final.SDE.VIALARGA,sde.DEFAULT -nln vialarga -s_srs EPSG:27493 -t_srs EPSG:3763

To transfer raster data, I’ve created tif files, for smaller raster datasets.

gdal_translate -of GTiff -co PROFILE=BASELINE -co TFW=YES -co COMPRESS=LZW -co PREDICTOR=2 -a_srs EPSG:27493 SDE:,5158,raster,sdeuser,sdepassword,raster.SDE.RAN ran27493.tif

For the larger datasets, I’ve sliced the images into tiles. I use the same gdal_translate as above with an additional -srcwin parameter generated by small python script from the question Splitting raster into smaller chunks using GDAL?


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.