[Mapserver-users] Jumpstart: Getting MapInfo files working with Mapserver

Roland Corbet Roland at cyber-media.co.uk
Sun Jan 18 18:38:03 EST 2004


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C3DE1C.1DBCF840
Content-Type: text/plain

We have recently decided to use Mapserver for a web-based mapping project
which we are undertaking.  The source files that we have are in MapInfo tab
format.

I am new to Mapserver and am trying to set up a basic rendering of a map
from a MapInfo tab file.

I have been through the first stage of the Mapserver tutorial and
experimented with the various settings for the files.  I'm now happy that I
can get a .sha file and perform a default render of the data using
Mapserver.

However, I'm having difficulty applying the same principle to a MapInfo tab
file.

After reading the documentation at:
http://mapserver.gis.umn.edu/doc36/ogr-howto.html

I have produced the following .map file to try and serve up a MapInfo file.

MAP
   IMAGETYPE      PNG
   EXTENT         311061.028851 133724.001154 318723.716551 142576.047282
   SIZE           300 300
   SHAPEPATH      "C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland"
   IMAGECOLOR     255 255 255

   # Start of LAYER DEFINITIONS --------------------------------------------

   LAYER
      NAME "Sample"
      TYPE POLYGON
      CONNECTIONTYPE OGR
      CONNECTION
"C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland\Sample.TAB"
      STATUS ON
      CLASS
         COLOR        232 232 255
         OUTLINECOLOR 32 32 255
      END
   END
  # End of LAYER DEFINITIONS -------------------------------

END

I obtained the Extent to use from the ogrinfo program, which resulted in the
following output for the file I am trying to plot:

Had to open data source read-only.
INFO: Open of `C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland\sample.tab'
using driver `MapInfo File' successful.

Layer name: sample
Geometry: Polygon
Feature Count: 1
Extent: (311061.028851, 133724.001154) - (318723.716551, 142576.047282)
Layer SRS WKT:
PROJCS["unnamed",
    GEOGCS["unnamed",
        DATUM["OSGB_1936",
            SPHEROID["Airy 1930",6377563.396,299.3249646],
            TOWGS84[375,-111,431,0,0,0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",49],
    PARAMETER["central_meridian",-2],
    PARAMETER["scale_factor",0.9996012717],
    PARAMETER["false_easting",400000],
    PARAMETER["false_northing",-100000],
    UNIT["Meter",1.0]]
.... (the data continues, but has not been included here)

Following a similar procedure to how I've set up the .sha files previously I
can't get a .tab file to render out following the same method.

Mapserver seems to complete the production of the image but only serves a
blank white image (the background to the map object).  However, it seems to
take no notice of the additional layer from the .tab file.

Could anyone provide me with a working example of serving a MapInfo file
through Mapserver, or perhaps identify what I'm doing wrong please?

Alternatively, is there any way to get debugging info from Mapserver without
using the "WEB" and "LOG" parameters in the .map file?

Thank you for your time and help.

Roland

------_=_NextPart_001_01C3DE1C.1DBCF840
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>Jumpstart: Getting MapInfo files working with Mapserver</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>We have recently decided to use Mapserver for a =
web-based mapping project which we are undertaking.&nbsp; The source =
files that we have are in MapInfo tab format.</FONT></P>

<P><FONT SIZE=3D2>I am new to Mapserver and am trying to set up a basic =
rendering of a map from a MapInfo tab file.</FONT>
</P>

<P><FONT SIZE=3D2>I have been through the first stage of the Mapserver =
tutorial and experimented with the various settings for the =
files.&nbsp; I'm now happy that I can get a .sha file and perform a =
default render of the data using Mapserver.</FONT></P>

<P><FONT SIZE=3D2>However, I'm having difficulty applying the same =
principle to a MapInfo tab file.</FONT>
</P>

<P><FONT SIZE=3D2>After reading the documentation at:</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://mapserver.gis.umn.edu/doc36/ogr-howto.html" =
TARGET=3D"_blank">http://mapserver.gis.umn.edu/doc36/ogr-howto.html</A><=
/FONT>
</P>

<P><FONT SIZE=3D2>I have produced the following .map file to try and =
serve up a MapInfo file.</FONT>
</P>

<P><FONT SIZE=3D2>MAP</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; IMAGETYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
PNG</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; =
EXTENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 311061.028851 =
133724.001154 318723.716551 142576.047282</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; =
SIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 300 =
300</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; SHAPEPATH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&quot;C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; IMAGECOLOR&nbsp;&nbsp;&nbsp;&nbsp; 255 =
255 255</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; # Start of LAYER DEFINITIONS =
--------------------------------------------</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; LAYER</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAME =
&quot;Sample&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE POLYGON</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECTIONTYPE =
OGR</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECTION =
&quot;C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland\Sample.TAB&quot;<=
/FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STATUS ON</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLASS</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
COLOR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 232 232 255</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
OUTLINECOLOR 32 32 255</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; END</FONT>
<BR><FONT SIZE=3D2>&nbsp; # End of LAYER DEFINITIONS =
-------------------------------</FONT>
</P>

<P><FONT SIZE=3D2>END</FONT>
</P>

<P><FONT SIZE=3D2>I obtained the Extent to use from the ogrinfo =
program, which resulted in the following output for the file I am =
trying to plot:</FONT></P>

<P><FONT SIZE=3D2>Had to open data source read-only.</FONT>
<BR><FONT SIZE=3D2>INFO: Open of =
`C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland\sample.tab'</FONT>
<BR><FONT SIZE=3D2>using driver `MapInfo File' successful.</FONT>
</P>

<P><FONT SIZE=3D2>Layer name: sample</FONT>
<BR><FONT SIZE=3D2>Geometry: Polygon</FONT>
<BR><FONT SIZE=3D2>Feature Count: 1</FONT>
<BR><FONT SIZE=3D2>Extent: (311061.028851, 133724.001154) - =
(318723.716551, 142576.047282)</FONT>
<BR><FONT SIZE=3D2>Layer SRS WKT:</FONT>
<BR><FONT SIZE=3D2>PROJCS[&quot;unnamed&quot;,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
GEOGCS[&quot;unnamed&quot;,</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
DATUM[&quot;OSGB_1936&quot;,</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; SPHEROID[&quot;Airy 1930&quot;,6377563.396,299.3249646],</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; TOWGS84[375,-111,431,0,0,0,0]],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
PRIMEM[&quot;Greenwich&quot;,0],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
UNIT[&quot;degree&quot;,0.0174532925199433]],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
PROJECTION[&quot;Transverse_Mercator&quot;],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
PARAMETER[&quot;latitude_of_origin&quot;,49],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
PARAMETER[&quot;central_meridian&quot;,-2],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
PARAMETER[&quot;scale_factor&quot;,0.9996012717],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
PARAMETER[&quot;false_easting&quot;,400000],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
PARAMETER[&quot;false_northing&quot;,-100000],</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
UNIT[&quot;Meter&quot;,1.0]]</FONT>
<BR><FONT SIZE=3D2>.... (the data continues, but has not been included =
here)</FONT>
</P>

<P><FONT SIZE=3D2>Following a similar procedure to how I've set up the =
.sha files previously I can't get a .tab file to render out following =
the same method.</FONT></P>

<P><FONT SIZE=3D2>Mapserver seems to complete the production of the =
image but only serves a blank white image (the background to the map =
object).&nbsp; However, it seems to take no notice of the additional =
layer from the .tab file.</FONT></P>

<P><FONT SIZE=3D2>Could anyone provide me with a working example of =
serving a MapInfo file through Mapserver, or perhaps identify what I'm =
doing wrong please?</FONT></P>

<P><FONT SIZE=3D2>Alternatively, is there any way to get debugging info =
from Mapserver without using the &quot;WEB&quot; and &quot;LOG&quot; =
parameters in the .map file?</FONT></P>

<P><FONT SIZE=3D2>Thank you for your time and help.</FONT>
</P>

<P><FONT SIZE=3D2>Roland</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C3DE1C.1DBCF840--



More information about the mapserver-users mailing list