Mapserver & Mapinfo files --HELP

Daniel Morissette dmorissette at DMSOLUTIONS.CA
Thu Sep 30 15:58:18 EDT 2004


Matthew crowley wrote:
>
> I have spent two days trying to get a MAPINFO .tab file to display using the
> tutorial in MapLab.
>
> Basically, I just wanted to add another layer using my own source file.  OGR
> works, and I don't get any errors when I use the Preview function.  My layer
> appears in the menu, but I can't see anything displayed on the screen
>
> The extra lines from my MAP file are :
> -----------------------------------------------------------------------------
>  LAYER
>     NAME "MBBDY"
>     STATUS ON
>     TYPE POLYGON
>     CONNECTIONTYPE OGR
>     CONNECTION "c:\ms4w\apps\maplab-2.2\tutorial\data\MBBDY.tab"
>     STYLEITEM "AUTO"
>     CLASS
>     END
>   END
> -----------------------------------------------------------------------------
> and the output from OGRINFO follows:
> -----------------------------------------------------------------------------
> C:\ms4w\tools\ogr-utils>ogrinfo -ro -al
> c:\ms4w\apps\maplab-2.2\tutorial\data\MBBDY.tab
> INFO: Open of `c:\ms4w\apps\maplab-2.2\tutorial\data\MBBDY.tab'
> using driver `MapInfo File' successful.
>
> Layer name: MBBDY
> Geometry: Polygon
> Feature Count: 1
> Extent: (-102.001400, 48.996530) - (-88.989300, 60.000970)


I think the MapLab tutorial data is in LCC projection, and your data
above seems to be in geographic coordinates (lon/lat). You'll need to
set a PROJECTION object at the top of your mapfile and in your layer so
that MapServer knows that it has to reproject your data to LCC to make
it fit on top of the other layers in the map.

If the tutorial uses the data that I think it does, then at the
top-level in your mapfile you should use:

   PROJECTION
     "init=epsg:42304" # Canada LCC
   END

and your MapInfo layer should use:

   PROJECTION
     "init=epsg:4326"  # Geographic, WGS84
   END

Daniel
--
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the mapserver-users mailing list