Example: Connect to an ESRI GDB usng GDAL/OGR

Manifold has the built-in ability to connect to, link, import and read/write to hundreds of different databases, file databases, file formats, web servers and similar data sources using Manifold's own internal code, with no need to install any additional software.  

 

In addition, Manifold includes a dataport that can launch the GDAL/OGR libraries to connect to any format those libraries support.   

 

Both the Manifold collection of data sources and the GDAL/OGR libraries collection of file formats are large collections so there is considerable overlap between the two.   In many cases there is a native Manifold dataport for a data source and there is also a module available in the GDAL/OGR collections for that format.   However, there are also data sources which Manifold supports that GDAL/OGR does not, and there are formats available within GDAL/OGR that Manifold does not include as a built-in to Manifold.

 

If we want to import data from a format that Manifold does not support but which is available within GDAL/OGR, we can use the Manifold GDAL dataport to connect through GDAL/OGR to the desired format.  While that will have limitations compared to using a native Manifold connection, using GDAL may be the only way to get data out of a format that is not otherwise supported by Manifold.

 

In this example we will use GDAL to get data from a file that uses an obsolete ESRI file geodatabase format.   Manifold reads/writes to modern ESRI GDB file geodatabase format but does not read the older, obsolete form.  GDAL includes an older, reversed engineered, non-ESRI module that usually can read the older format and get much, often all, of the information it contains.

 

ico_nb_arrow_blue.png  To use GDAL or OGR we must install GDAL in Windows, and then we can use it from Manifold.  If we do not install GDAL, we will not be able to use the capabilities described in this topic. See the the GDAL / OGR topic for installation instructions. The Manifold GDAL dataport allows working with GDAL 2.0.x, 2.1.x or 2.2.x and automatically selects the latest version available with automatic adjustments for the call interface.

 

Use GDAL from Manifold to Import an "Old" GDB

We will import an "old format" GDB that is no longer supported by ESRI's SDK, but which is supported by the legacy GDB code in GDAL/OGR.

 

eg_gdb_gdal01_08a.png

 

We launch Manifold.   In the main menu choose File - Create - New Data Source.

 

eg_gdb_gdal01_08.png

Choose a Name as desired and a Type of File: gdal.  Whether or not we check Open as read-only the resulting data source will be read-only.  We un-check the Saved cached data between sessions box, to keep our project size smaller should we choose to save the project.   Click the [...] browse button.

 

eg_gdb_gdal01_09.png

 

In the resulting Select File dialog we browse over the folder where our gdb file is located.    File geodatabases are usually stored in folders that contain many files so the gdb file may not be easy to find.  

 

eg_gdb_gdal01_10.png

 

We simply enter gdb into the dialog's File name box, as seen above, since we know from experience working with ESRI GDB that there is only one file with that name.  Press Open.

 

eg_gdb_gdal01_12.png

 

Back in the New Data Source dialog we verify everything is as we want and then we click Create Data Source.

 

eg_gdb_gdal01_13.png

 

Manifold swings into action and, like magic, a new data source appears in the project using the name we specified.  We can expand the new data source to see what it contains, in this case a drawing and its table.

 

eg_gdb_gdal01_14.png

 

Double-clicking the drawing opens it.   It looks like any other drawing, but it is being brought in from an "old format" ESRI file database using the GDAL/OGR library.

 

eg_gdb_gdal01_15.png

 

To make a local, fully writable copy of the drawing we can Ctrl-click the drawing and then Ctrl-click the  drawing's table to highlight both the drawing and the drawing's table and then click the Copy button in the Project pane's toolbar.   More keyboard-centric users often prefer to highlight and then do a Ctrl-C to Copy

 

eg_gdb_gdal01_16.png

 

Clicking anywhere in the project outside of the data source, we can do a Ctrl-V to Paste or press the Paste button in the Project pane's toolbar.

 

eg_gdb_gdal01_17.png

 

If we double-click the pasted drawing to open it we see it is, of course, identically the same drawing that was copied from the data source.   But this copy of that drawing is local to the project and is fully writable.

 

eg_gdb_gdal01_18.png

To delete the data source, we can click on the data source and then press the Delete key or click the Delete icon in the Project pane's toolbar.   We now have the drawing that was in the "old format" ESRI geodatabase imported as a local drawing into our Manifold project.  We can use the Style panel to format the drawing.  Now would be a good time to save the project.

 

Using GDAL from Manifold to Import a Shapefile

Because both GDAL/OGR and Manifold each have a vast library of formats they know, in many cases formats are supported both by Manifold native capabilities and also within GDAL.   If we want to import a format, such as shapefiles, that Manifold knows but for some reason we want to use GDAL code instead of Manifold native code we can do that.    

 

To import a shapefile using GDAL instead of native Manifold shapefile capabilities we choose File - Create - New Data Source.  

 

eg_gdb_gdal01_19.png

 

We specify the Name we want to use for the new data source and a Type of File: gdal.   Click the [...] browse button.

 

eg_gdb_gdal01_20.png

 

We browse into the folder where the desired shapefile is located and click it to highlight it and to enter the name into the File name box.  Click Open.

 

eg_gdb_gdal01_21.png

 

Back in the New Data Source dialog, click Create Data Source.

 

eg_gdb_gdal01_22.png

 

Manifold creates a new data source named as we specified.  Expanding the data source and double-clicking on the drawing we open it to see that Manifold has connected through GDAL to the shapefile we want.

 

GDAL connections are always read-only, so we cannot edit this drawing.    If we want an editable version we should copy the drawing and the drawing's table and paste them into the project outside of the data source.

 

Notes

File - Import -  This topic creates a data source using GDAL.   A simpler procedure is to use File - Import, as shown in the Example: Import ERDAS GIS with GDAL and Assign Coordinate System topic.

 

See Also

Maps

 

Selection

 

Web Servers

 

Contents Pane

 

Contents - Select

 

GDAL / OGR

 

Example: Spectacular Images and Data from Web Servers - A must see topic providing a gallery of views illustrating how Manifold can use web servers such as imageservers and other free resources to provide a seemingly endless selection of spectacular background maps, satellite images and GIS data with nearly zero effort.

 

Example: An Imageserver Tutorial - An extensive tutorial showing step by step how to add new data sources that are imageservers, how to show them as layers in a map, how to create a new drawing that matches the projection of the map and how to trace over what is seen in an imageserver layer to create an area object in the drawing.

 

Example: Import ERDAS GIS with GDAL and Assign Coordinate System  - A multistep example that covers import of an unwieldy format using GDAL, followed by use of Assign Initial Coordinate System and Repair Initial Coordinate System to deal quickly with real-life complications.

 

Example: Create an ODBC Data Source with Windows - How to create an ODBC data source (a DSN) using dialogs built into Windows 10.

 

Example: Connect to Manifold from Release 8 - Step by step procedure to connect from Manifold System Release 8 to a Manifold .map file using Manifold's ODBC driver.

 

Example: Connect to an ESRI GDB File Geodatabase - Connect Manifold to an ESRI GDB file geodatabase, display the contents, make a selection in the GDB and overlay in a map.

 

Example: Connect Through Manifold ODBC to a Third Party -  With Release 8, use an ODBC connection to a Manifold .map to connect through the .map project to a third party, external data source, an ESRI GDB file geodatabase.  We use Manifold facilities as an intermediary to give Release 8 capabilities it does not have on its own, to link into data stored within an ESRI file geodatabase.

 

Example: Connect LibreOffice Through Manifold to an ESRI GDB - A companion example topic to this topic.   Shows how to connect LibreOffice Base, the database part of LIbreOffice, through Manifold to link an ESRI GDB file geodatabase table into LibreOffice.

 

Example: Connect to Manifold from QGIS - Step by step procedure to connect from QGIS 2.8.9 to a Manifold .map file using Manifold's ODBC driver.