File - Link

The File - Link command is basically a simplified form of the File - Create - New Data Source command.  It launches the Link dialog which allows browsing the Windows file system to locate and to choose the file to be linked.  There are two main simplifications of Link as compared to the New Data Source dialog:





In addition to the usual Windows File - Open style controls the Link dialog provides these controls:


File name - Enter the name of the file to be linked, or populate the box by clicking on a file in the display pane.  The pull-down list for the box provides a list of recently-opened files.


(File types) - Use All Files (*.*) by default or choose a specific file type to filter the types of files shown in the display pane.   For example, choosing JS Files (*.js) will only show files with a .js extension, that is, JScript script files.


Options - For many file types provides access to Cache Data option, to create and utilize an accessory .MAPCACHE file for improved performance. The Cache Data  option is checked by default.  The Cache Data  options has two options, both checked by default, one to cache only data that is expensive to dynamically compute and the other to save cached data between sessions.   It only makes sense to uncheck either option if we are desperately low on free disk space.  Note that although these options may appear as part of the Link dialog for all file types a .MAPCACHE file is not created or used with file types such as .js for JScript scripts or other file types not supporting use of .MAPCACHE.

Cache and Linked Data

Cache in Manifold helps us get around some of the limitations of linked data, including read-only data. 



When linking an image or other data into Manifold the Link dialog provides a Save cache option at the bottom of the dialog that allows us to cache data from a linked file.   Using cache provides better performance and allows us to launch Assign Initial Coordinate System in the Info pane to specify the correct initial projection for linked data. It also allows flexibility with Style when linking data from read-only files.  For example, some TIFF images linked from read-only .tif files might not display if Save cache is not checked.



Using File - Create - New Data Source allows more sophisticated control over cache options.  


Caching data within the project will save a copy of data that is brought in from the external file within the project.   It is like a virtual import that, so long as the data within the external source has not changed, uses the data that has already once been brought into the project instead of re-fetching it again from the external source.    Checking the Save cached data between sessions box will save cached data within the .map project file so the next time that .map project file is opened what was cached from the prior session will still be available for use.   If the external source has changed since the last session, then cached data will be discarded as obsolete and fresh data will be fetched to refill the cache.


  Caution: When creating data sources based on web servers, like a Google image server, turning on the Save cached data between sessions option will save in cache a copy of every image tile fetched form the server.  That can result in astonishingly fast performance when next we browse that same region in the project, because all tiles will be local and will not need to be fetched over Internet from the server, but it will also mean that the size of the project can become very large (hundreds of megabytes or many gigabytes) very quickly.   Most Manifold users will leave that check box OFF unless they want to use that data when off-line.


Cache provides two primary ways of improving performance:



Using or not using cache is not a big deal for small data, like small images, but when images or other data are gigabytes in size cache can provide dramatic improvements in speed.  That is why the Cache data box is checked by default when creating data sources on regular file formats.  It is not checked by default when creating data sources on web servers.


Cache also provides some of the benefits of imported images.   For example, if the Cache data box is enabled we will be able to launch Assign Initial Coordinate System in the Info pane to specify the correct initial projection for linked data.   If we have turned off cache we will not be able to assign the initial projection.


Three Letter Extensions - Most file names in Windows end in what is called a three letter extension, which is usually three letters at the end of the file name following a dot . character.    The three letter extension is one way Windows at times (but not always) keeps track of what a file is supposed to be.    Unfortunately, by default Windows hides the three letter extensions of files and instead tries to associate files with whatever program it thinks should be used to open that file.   This is confusing when working with the many file formats that Manifold and similar products utilize.  


Therefore, please turn off the hiding of extensions by Windows.  A typical way to do so in most versions of Windows would be from Windows Explorer, choose Tools - Folder options, press the View tab and then in the Advanced Settings pane ensure that the Hide extensions for known file types is unchecked.  Press Apply to Folders and then press OK.  You will then be able to see extensions such as .map and others.  See also the Essay on three letter extensions and why the default hiding of them by Windows is such a bad thing.


Drag and Shift-Drop - Dragging one or more files from a Windows Explorer window and Shift-dropping the files into the Project pane will link the files into the project, just like File - Link.   A simple drag and drop of files into the Project pane will import them.


The origin of linked data sources - Hovering the mouse over a linked data source will show the path to that file in a tool tip.  Right-clicking the data source and choosing Properties will also show the path, but in JSON form that escapes backslash characters:


{ "Source": "C:\\data\\OSM Venice\\ESRI" }


We can also get the path to a file that is linked by looking at the Log Window, which logs the path used for link operations.   


2021-06-29 14:39:13  -- Link: C:\data\OSM Venice\ESRI


That can be convenient, since text can be copied from the Log Window.


See Also

Importing and Linking


File - Import


File - Create - New Data Source


Assign Initial Coordinate System