[GRASS5] Re: missing mapinfo support

Michael Barton michael.barton at asu.edu
Sat Nov 22 11:41:01 EST 2003


On Saturday, November 22, 2003, at 12:01 PM, 
grass5-request at grass.itc.it wrote:

> From: Allan Metts <ametts2 at mindspring.com>
> Date: Fri Nov 21, 2003  5:37:30 PM Europe/Madrid
> To: grass5 at grass.itc.it
> Subject: [GRASS5] Missing MapInfo support in 5.0.3?
>
>
> Hi there,
>
> I just built and installed GRASS 5.0.3.  I have manual pages for 
> v.in.mif an s.in.mif, but the commands themselves don't seem to be 
> available.  Did I fail to enable a compile option?  Or is this feature 
> something that was added to the code in a subsequent version?
>
> I'm very new to GRASS -- but I intend to use it in the midst of a 
> MapInfo-based environment.  So any pointers from the experts would be 
> most appreciated (at the moment, I'm seeing mostly ".MAP", ".TAB", and 
> ".DAT" files -- not ".MIFs").

I have had to deal with this difficulty because a lot of my old data 
and that of collaborators is in MapInfo. Both v.in.mif and s.in.mif 
have broken for quite some time. Unfortunately, they were never removed 
from the manual. To get MapInfo point data into GRASS is relatively 
trivial, but line and poygon data are much more problematic.

For both point and line/polygon data, make sure you set the proper 
projection before proceeding. Then...

For site data:

1. Create x and y columns (e.g. easting and northing for UTM's) and 
update them using the centroid(x) and centroid(y) function. This gives 
you x and y coordinates for each point. Make sure that x is the first 
column and y is the second column in your table. Make sure you have no 
empty cells (i.e., no blanks in the data; put in NA or -999 or 
something to indicate a null value).

2. Export your table as text, selecting Latin 1 UNIX text.

3. Use s.in.ascii to import the table into GRASS. It should all be 
there.

For line and poygon data (if ANYONE knows a better way, PLEASE let us 
BOTH know):

1. Export your data into DXF without attributes. Theoretically, you 
should be able to read in DXF attributes into GRASS, along with the 
lines and polygons, but I have been unable to get this to work. DXF 
files created by MapInfo with attributes will not import for some 
reason.

2. Use v.in.dxf to read in the data.

3. You will have to manually relabel the lines or polygons in v.digit.\

Alternate 1 for line/polygon data (and site data for that matter)

1. Export the associated data table to dbf format

2. Import the data table to PostgreSQL using pg.in.dbf. Note that 
current versions of pg.in.dbf can truncate longish numbers (e.g., UTM 
coordinates with a couple decimal places). To avoid this, redefine all 
fields (or at least long numbers) as text prior to export. Once in 
PostgreSQL, you can use the values as numbers again.

3. Use a key field to link the data values back up to the vector 
line/polygons

Alternate 2 for line/polygon data

1. Export to MIF

2. Convert MIF to ArcView shape file

3. Import into GRASS using v.in.shape

NOTE: MIF to vector import seems to be fixed in upcoming GRASS 5.7 
using OGR import

I hope this helps.

Michael Barton

____________________
C. Michael Barton, Professor
Department of Anthropology
PO Box 872402
Arizona State University
Tempe, AZ  85287-2402
USA

Phone: 480-965-6262
Fax: 480-965-7671




More information about the grass-dev mailing list