[GRASS5] v.in.mif

Hi all,

i had just imported the 9023.MIF/MID files into GRASS from www.english-nature.org.uk/pubs/gis .

I used this Region:

                         REGION FACILITY
LOCATION: britain MAPSET: test

CURRENT REGION: N=732954 S=0 RES=1 ROWS=732954
                E=730403 W=0 RES=1 COLS=730403
PROJECTION: 99 (Transverse Mercator)
ZONE: 0
DATUM: osgb36
ELLIPSOID: airy

First thing i had to do was rename the files from 9023.MIF and 9023.MID to 9023.mif and 9023.mid.
Than i had to add a logfile output(otherwise v.in.mif ended without producing anything, not even an error), maybe it would be a good idea to pipe the logging-output to nirwana
by default?

GRASS:~ > v.in.mif input=/home/heiko/grassdaten/britain/9023NA.mif output=9023MIF logfile=/tmp/miflog.txt

WARNING: Duplicate ring added.
WARNING: You must run `v.support option=build' on
  this (these) map(s) to build the topology.

GRASS:~ > v.support map=9023MIF option=build
V.SUPPORT:

Selected information from vector header
Organization:
Map Name: 9023MIF
Source Date:
Orig. Scale: 200
No snapping will be done

    Reading Vector file 100%
    Building areas 100%
    Building islands 100%
    Attaching labels
PNT_TO_AREA failed: (487645.986637, 421993.662174) (Category 27)
PNT_TO_AREA failed: (472080.339655, 415630.182221) (Category 28)
PNT_TO_AREA failed: (396831.840312, 347753.296154) (Category 36)
WARNING: area 62 label: 31 matched another label: 42.
PNT_TO_AREA failed: (506536.608376, 386967.204960) (Category 43)
PNT_TO_AREA failed: (413584.035007, 333139.904697) (Category 49)
PNT_TO_AREA failed: (652335.198233, 303559.020389) (Category 58)
PNT_TO_AREA failed: (646401.438483, 309376.050000) (Category 60)
PNT_TO_AREA failed: (646401.438483, 309376.050000) (Category 61)
WARNING: area 183 label: 66 matched another label: 67.
WARNING: area 180 label: 78 matched another label: 79.
PNT_TO_AREA failed: (541797.631173, 190794.412779) (Category 81)
PNT_TO_AREA failed: (608065.746866, 154680.930000) (Category 92)
PNT_TO_AREA failed: (571502.343881, 162589.318863) (Category 93)
PNT_TO_AREA failed: (571502.343881, 162589.318863) (Category 95)
PNT_TO_AREA failed: (453538.667104, 142008.500280) (Category 104)
WARNING: area 176 label: 114 matched another label: 117.
WARNING: area 174 label: 119 matched another label: 121.
WARNING: area 8 label: 123 matched another label: 124.
WARNING: area 172 label: 128 matched another label: 130.
WARNING: area 143 label: 206 matched another label: 207.
WARNING: area 143 label: 207 matched another label: 208.
Number of lines: 424
Number of nodes: 306
Number of areas: 188
Number of isles: 92
Number of atts : 196
Number of unattached atts : 13
Snapped lines : 0

After that v.in.mif worked for me , produced a Logfile containing:
Mapinfo Data File:

VERSION: 300
DELIMITER: ,
Projection info: Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000, -100000 Bounds (-7845061.1011, -15524202.1641) (8645061.1011, 4470074.53373)

Field data -- 2 columns

Field 0 is nacode of type Integer
Field 1 is naname of type Char

I also tried to import the Field 1 data with :

GRASS:~ > v.in.mif input=/home/heiko/grassdaten/britain/9023NA.mif output=9023MIF logfile=/tmp/miflog.txt attribute=naname
or

GRASS:~ > v.in.mif input=/home/heiko/grassdaten/britain/9023NA.mif output=9023MIF logfile=/tmp/miflog.txt attribute=Field1

but failed.

Any suggestions about the warnings,
PNT_TO_AREA failed -lines and the Field Data?

Best Regards

Heiko Kehlenbrink

Heiko Kehlenbrink wrote:

Hi all,

i had just imported the 9023.MIF/MID files into GRASS from www.english-nature.org.uk/pubs/gis .

I used this Region:

                        REGION FACILITY
LOCATION: britain MAPSET: test

CURRENT REGION: N=732954 S=0 RES=1 ROWS=732954
               E=730403 W=0 RES=1 COLS=730403
PROJECTION: 99 (Transverse Mercator)
ZONE: 0
DATUM: osgb36
ELLIPSOID: airy

First thing i had to do was rename the files from 9023.MIF and 9023.MID to 9023.mif and 9023.mid.
Than i had to add a logfile output(otherwise v.in.mif ended without producing anything, not even an error), maybe it would be a good idea to pipe the logging-output to nirwana
by default?

Heiko

This is currently being revised, along with it's very similar sister module v.in.shape, to be more modular and have better import routines, and these improvements should be available by PR4. For now some remarks:

GRASS:~ > v.in.mif input=/home/heiko/grassdaten/britain/9023NA.mif output=9023MIF logfile=/tmp/miflog.txt

WARNING: Duplicate ring added.

I haven't seen these warnings are actually associated with any errors, and are probably spurious. It perhaps happens if a polygon is scanned after all its neighbours.

WARNING: You must run `v.support option=build' on
this (these) map(s) to build the topology.

GRASS:~ > v.support map=9023MIF option=build
V.SUPPORT:

Selected information from vector header
Organization:
Map Name: 9023MIF
Source Date:
Orig. Scale: 200
No snapping will be done

   Reading Vector file 100%
   Building areas 100%
   Building islands 100%
   Attaching labels
PNT_TO_AREA failed: (487645.986637, 421993.662174) (Category 27)
PNT_TO_AREA failed: (472080.339655, 415630.182221) (Category 28)
PNT_TO_AREA failed: (396831.840312, 347753.296154) (Category 36)
WARNING: area 62 label: 31 matched another label: 42.
PNT_TO_AREA failed: (506536.608376, 386967.204960) (Category 43)
PNT_TO_AREA failed: (413584.035007, 333139.904697) (Category 49)
PNT_TO_AREA failed: (652335.198233, 303559.020389) (Category 58)
PNT_TO_AREA failed: (646401.438483, 309376.050000) (Category 60)
PNT_TO_AREA failed: (646401.438483, 309376.050000) (Category 61)
WARNING: area 183 label: 66 matched another label: 67.
WARNING: area 180 label: 78 matched another label: 79.
PNT_TO_AREA failed: (541797.631173, 190794.412779) (Category 81)
PNT_TO_AREA failed: (608065.746866, 154680.930000) (Category 92)
PNT_TO_AREA failed: (571502.343881, 162589.318863) (Category 93)
PNT_TO_AREA failed: (571502.343881, 162589.318863) (Category 95)
PNT_TO_AREA failed: (453538.667104, 142008.500280) (Category 104)
WARNING: area 176 label: 114 matched another label: 117.
WARNING: area 174 label: 119 matched another label: 121.
WARNING: area 8 label: 123 matched another label: 124.
WARNING: area 172 label: 128 matched another label: 130.
WARNING: area 143 label: 206 matched another label: 207.
WARNING: area 143 label: 207 matched another label: 208.
Number of lines: 424
Number of nodes: 306
Number of areas: 188
Number of isles: 92
Number of atts : 196
Number of unattached atts : 13
Snapped lines : 0

The centroid location code is probably buggy. Code was inserted to find the centroids of actual imported polygons, based on mistrust of the values in the MIF file. That had reasons at the time, but is perhaps over-cynical, the new version will just scan the `Centre' values.

After that v.in.mif worked for me , produced a Logfile containing:
Mapinfo Data File:

VERSION: 300
DELIMITER: ,
Projection info: Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000, -100000 Bounds (-7845061.1011, -15524202.1641) (8645061.1011, 4470074.53373)

Field data -- 2 columns

Field 0 is nacode of type Integer
Field 1 is naname of type Char

I also tried to import the Field 1 data with :

GRASS:~ > v.in.mif input=/home/heiko/grassdaten/britain/9023NA.mif output=9023MIF logfile=/tmp/miflog.txt attribute=naname

or

GRASS:~ > v.in.mif input=/home/heiko/grassdaten/britain/9023NA.mif output=9023MIF logfile=/tmp/miflog.txt attribute=Field1

but failed.

Likely there is a bug in the mid import stage. Again there's no point to maintaining this as changes should be made to the new version.

David