Conversion of Shape files to Tab files when shape file column widths exceed Universal Translator's capacity

515 views
Skip to first unread message

Boggled

unread,
Aug 20, 2009, 11:15:55 AM8/20/09
to MapInfo-L
Hi Folks,

I have been at this for a while and have exhausted many possiblities
but my attempts are only partially successful. If any of

you came across similar GIS tasks I'd appreciate an input.


I need to convert a few thousand shape files into Map Info *.tab
format. Universal Translater handled most of this

in batches.

However, I have a few hundred shape files with column widths exceeding
Universal Translator's capacity.

I have no access to any ESRI products. Thus, I tried to restructure
the original shape files by opening the .dbf portion of

it in excel and adjusting the column widths there. Excel can do this
on a manual basis one at a time. However,

when automated with a VBA macro Microsoft's Jet system is not able to
open the *.dbf file.


My final goal is to convert these wide column shape files to Tab files
with the same names and directory structure as the

original ESRI data. This sounds simple but in fact is quite
challenging.


One of my problems is that I was trying to work with a MapBasic script
that automates the opening of the shape files in

MapInfo. I learned that this script allows you to view the shape file
but it does not translate directly into the *.tab

format as the Universal Translater does. It appears that my script
gives me MapInfo Table files but not the actual .tab file.



Any insight would be appreciated.

Thanks,

Christopher

Uffe Kousgaard

unread,
Aug 20, 2009, 1:30:54 PM8/20/09
to mapi...@googlegroups.com
> However, I have a few hundred shape files with column widths exceeding
> Universal Translator's capacity.

How wide are they?

You can also try to open just the dbf file in mapinfo and change the
structure.

Regards
Uffe Kousgaard

Jay Russell

unread,
Aug 20, 2009, 2:34:25 PM8/20/09
to MapInfo-L

This code translates a SHP file into a MapInfo .TAB. In this case
Switch_PT.TAB becomes Dist_Switches.TAB. You could then use the alter
Table command on the new table. You will need to fill in the code to
automate the changing table names and the Alter Table commands
specific to your data.

Register Table "C:\MAPDATA\LANDRTS\Switch_PT.shp" TYPE SHAPEFILE
Charset "WindowsLatin1" CoordSys Earth Projection 3, 62, "survey ft",
-99, 27.8333333333, 28.3833333333, 30.2833333333, 2000000, 0 Bounds
(-221554461.125, -185747019.928) (225554461.125, 261361902.322)
PersistentCache Off Symbol (35,0,12) Into "C:\MAPDATA\LANDRTS
\Switch_PT.TAB"

Open Table "C:\MAPDATA\LANDRTS\Switch_PT.TAB" Interactive

Commit Table Switch_PT As "C:\MAPDATA\LANDRTS\Tables
\Dist_Switches.TAB" TYPE NATIVE Charset "WindowsLatin1"
Close Table Switch_Pt
Open Table "C:\MAPDATA\LANDRTS\Tables\Dist_Switches.TAB"

'Modifies short column names to the full column name
Alter Table "Dist_Switches" (Propertyse Propertysection,Servicecen
Servicecenter,Serialnumb Serialnumber ) Interactive

Boggled

unread,
Aug 23, 2009, 2:07:27 PM8/23/09
to MapInfo-L
Hi,


Generally, the tables in question have total attribute column widths
exceeding 4000 bytes. The log file error message generated by
Universal Translator as follows:
"C:\siga\ak\sa_ap_1_c-2_1.tab' could not be created. Check that file
path name is valid and there is adequate disk space. Also ensure that
the total record length for all the attributes is less than 4000 bytes
and number of attributes are less than 250"


"You can also try to open just the dbf file in mapinfo and change the
structure..."


Yes, this is the process I've also tried to automate. Here I ran into
a problem where I got the error message that Microsoft Jet cannot
open .dbf files.


I can change the dbf manually but since there are 100's of files I am
seeking to automate it.

Thanks,
Christopher

Boggled

unread,
Aug 23, 2009, 2:09:11 PM8/23/09
to MapInfo-L
Thanks Jay

On Aug 20, 3:34 pm, Jay Russell <jay.russ...@centerpointenergy.com>
wrote:

Timothy Mashford

unread,
Aug 23, 2009, 9:22:26 PM8/23/09
to mapi...@googlegroups.com
You said you had a MapBasic program which can successfully batch open the shapefiles in MapInfo? This opens a 'view' of the shapefile, creating a single .tab file which points to the shapefiles.

So then, once the shapefile is opened as a view in MapInfo, you can use Commit Table As to save it into a native MapInfo .TAB file.

You will have to give it a temporary filename, since you want it to be the same as the existing shapefile name, but that filename will probably already be in use by the 'view' tab. For example, suppose you're working with a shapefile called 'Roads' which has been opened as a view in MapInfo as Roads.TAB. The basic process would be:

1. Commit Table Roads As "Roads1.TAB"
2. Close Table Roads
3. Open Roads1
4. Rename Table Roads1 As "Roads" (this should overwrite the existing single roads.tab file)

You'll have to put in some extra details, particularly for getting folder locations - use TableInfo(table, TAB_INFO_TABFILE) and PathToDirectory$()

Tim

ngoc linh

unread,
Aug 27, 2009, 2:03:17 AM8/27/09
to mapi...@googlegroups.com
how to save as copy multi layer  or more a table  please help me

--
ngoclinh

Boggled

unread,
Sep 1, 2009, 11:08:54 AM9/1/09
to MapInfo-L
Thanks for your input everyone,

I'm impressed with how quickly people get back to each other on this
forum

In the end I seem to have solved my issues by using a 3rd party FME
It seems to have successfully converted even the awkward shapefiles
with the
overwide columnwidths to MapInfo *.tab files

On Aug 27, 3:03 am, ngoc linh <ngoclinh...@gmail.com> wrote:
> On Mon, Aug 24, 2009 at 8:22 AM, Timothy Mashford <tmashf...@gmail.com>wrote:
>
>
>
>
>
> > You said you had a MapBasic program which can successfully batch open the
> > shapefiles in MapInfo? This opens a 'view' of the shapefile, creating a
> > single .tab file which points to the shapefiles.
> > So then, once the shapefile is opened as a view in MapInfo, you can use
> > Commit Table As to save it into a native MapInfo .TAB file.
>
> > You will have to give it a temporary filename, since you want it to be the
> > same as the existing shapefile name, but that filename will probably already
> > be in use by the 'view' tab. For example, suppose you're working with a
> > shapefile called 'Roads' which has been opened as a view in MapInfo as
> > Roads.TAB. The basic process would be:
>
> > 1. Commit Table Roads As "Roads1.TAB"
> > 2. Close Table Roads
> > 3. Open Roads1
> > 4. Rename Table Roads1 As "Roads" (this should overwrite the existing
> > single roads.tab file)
>
> > You'll have to put in some extra details, particularly for getting folder
> > locations - use TableInfo(table, TAB_INFO_TABFILE) and PathToDirectory$()
>
> > Tim
>
> ngoclinh- Hide quoted text -
>
> - Show quoted text -

Boggled

unread,
Sep 1, 2009, 11:17:42 AM9/1/09
to MapInfo-L
A free trial of this Feature Management Engine software can be found
at

www.safe.com
> > - Show quoted text -- Hide quoted text -

meags

unread,
Sep 7, 2014, 11:15:39 PM9/7/14
to mapi...@googlegroups.com
Hi Boggled, this is a really old post so hopefully you can be still found here. Im having the same problem & its giving me grief. What FME edition did you install do you remember?
M
Reply all
Reply to author
Forward
0 new messages