Making path references relative

676 views
Skip to first unread message

newoptionz

unread,
May 9, 2008, 9:04:00 AM5/9/08
to MapInfo-L
Hi

Is there a way to automatically make the references in the '.WOR' file
relative instead of absolute? I work on my C drive, but back up the
data to a network drive - and would like the Map to be opened by
others from the network.

Also is there a easy way to check for missing references in the '.WOR'
file and resolve them without having the map crash when it opens up?

Thanks

Mike Jamieson

unread,
May 9, 2008, 10:44:56 AM5/9/08
to mapi...@googlegroups.com
The easiest way to accomplish this is to use the "workspace packager" on
the tools menu when you transfer the workspace onto the network drive.
It gives you the option of copying all the associated files as well as
writing the workspace to the network drive and sets up the .wor with the
"new" file locations.

It won't make the path's relative, but should solve the problem.


Mike

Spencer Simpson

unread,
May 9, 2008, 10:44:33 AM5/9/08
to mapi...@googlegroups.com
If you don't keep your workspaces in a folder above all your data you're
going to have to live with absolute paths to tables, and make re-linking the
tables part of your workspace publishing process.

However, before you go through any more gyrations, you may want to look into
using the Workspace Packager tool to do the actual publishing.

When MapInfo saves a workspace, it always writes the Open Table statements
with relative paths for tables in the same directory as the workspace
itself, or in a directory under that one. It writes the Open Table
statements with absolute paths for tables in other directories. Let's say I
have a mapped drive named T: I create a table at "T:\Foo.tab" and a table
at "T:\Bar\Baz.tab". If I save the workspace into T: the workspace begins
with

!Workspace
!Version 600
!Charset WindowsLatin1
Open Table "foo" As foo Interactive
Open Table "bar\baz" As baz Interactive

But if I save it in My Documents, it begins with

!Workspace
!Version 600
!Charset WindowsLatin1
Open Table "T:\foo" As foo Interactive
Open Table "T:\bar\baz" As baz Interactive

Or, if I used UNC paths when opening the tables,

!Workspace
!Version 600
!Charset WindowsLatin1
Open Table "\\bmc\dfs\temp\foo" As foo Interactive
Open Table "\\bmc\dfs\Temp\bar\baz" As baz Interactive

which insulates you from the vagaries of people mapping different drive
letters.

I'm not really clear on how you're publishing your data and your workspaces
out to the network (I really don't know why you feel the need to work on the
C: drive, but that's for a different discussion). This is going to affect
how you publish the workspaces.

Notice that each Open Table statement has the word "Interactive" in it.
This means if it can't find the table, MapInfo will prompt you for the
correct location. You may have to make re-linking the tables part of your
workspace publishing process.

Besides the Workspace Packager, you could publish a workspace like this:

1. Copy the .WOR file out to the network.
2. Log in from a computer that doesn't have copies of your data on the C:
drive.
3. Open the .WOR file. As it prompts you for the location of each table,
browse to the network location of the network copy of that table.
4. Once the workspace opens itself fully, save it to the final location,
overwriting the "unfixed" copy if you put it there.

Another way is to invest in a text editor like TextPad and create a script
to automatically do the search and replace for you.

________________________________

Spencer M. Simpson, Jr.

-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On
Behalf Of newoptionz
Sent: Friday, May 09, 2008 9:04 AM
To: MapInfo-L
Subject: [MI-L] Making path references relative

Martin A Spiers

unread,
May 9, 2008, 11:00:30 AM5/9/08
to mapi...@googlegroups.com

To make paths relative, the .wor file needs to be edited. AFAIK, there's no way of getting MapInfo to always use relative paths.
I'm not sure how well I can explain this right now, but I'll have a go.
In the case where your TAB files are in one directory and your WOR files in another, and both are subdirectories replace each instance of <path to TAB Files>/<Name of tab> with ../<TAB directory>/<Name of tab>.

Ensuring that all layers are set to open interactively will help prevent the workspace failing to open. The "Worinter" mbx tool makes this easier: obtain it from http://www.paris-pc-gis.com/ppcc/moreworinter.htm


Yours,

Martin Spiers
Senior Engineer
MWH
Kenburgh House,
Manor Row,
Bradford
BD1 4QU
Tel: 01274 718768
Fax: 01274 718799
email:  martin....@mwhglobal.com



newoptionz <newop...@gmail.com>
Sent by: mapi...@googlegroups.com

09/05/2008 14:04

Please respond to
mapi...@googlegroups.com

To
MapInfo-L <mapi...@googlegroups.com>
cc

Subject
[MI-L] Making path references relative
"Disclaimer: This electronic communication and its attachments may contain confidential, proprietary and/or legally

privileged information which are for the sole use of the intended recipient. If you are not the intended recipient, any use,

distribution, or reproduction of this communication is strictly prohibited and may be unlawful; please contact the sender

and delete this communication. MWH does not warrant or make any representation regarding this transmission whatsoever nor

does it warrant that it is free from viruses or defects, correct or reliable. MWH is not liable for any loss or damage that

occurs as a result of this communication entering your computer network. The views expressed in this message are not

necessarily those of MWH. This communication cannot form a binding agreement unless that is the express intent of the

parties and they are authorized to make such an agreement. MWH reserves all intellectual property rights contained in this

transmission. MWH reserves the right to monitor any electronic communication sent or received by its employees.

This communication may come from a variety of legal entities within or associated with the MWH group. For a full list of

details for these entities please see our website at www.mwhglobal.com. Where business communications relate to the MWH UK

Limited entity, the registered office is Terriers House, 201 Amersham Rd, High Wycombe, HP13 5AJ Tel: 01494 526240 and the

company is registered in England as registration number 01188070. Where business communications relate to the MWH

Constructors Limited entity, the registered office is as above and the company is registered in England as registration number 04635724"

Rob Schneider - Aurchem Exploration

unread,
May 9, 2008, 11:36:55 AM5/9/08
to mapi...@googlegroups.com
I also believe that this will NOT move associated raster files (only the
actual tab), these will have to be copied separately.

> .
>
>

Reply all
Reply to author
Forward
0 new messages