[Mapserver-users] Jumpstart: Getting MapInfo files working with Mapserver
Roland Corbet
Roland at cyber-media.co.uk
Sun Jan 18 15:38:03 PST 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. 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. 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> IMAGETYPE =
PNG</FONT>
<BR><FONT SIZE=3D2> =
EXTENT 311061.028851 =
133724.001154 318723.716551 142576.047282</FONT>
<BR><FONT SIZE=3D2> =
SIZE 300 =
300</FONT>
<BR><FONT SIZE=3D2> SHAPEPATH =
"C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland"</FONT>
<BR><FONT SIZE=3D2> IMAGECOLOR 255 =
255 255</FONT>
</P>
<P><FONT SIZE=3D2> # Start of LAYER DEFINITIONS =
--------------------------------------------</FONT>
</P>
<P><FONT SIZE=3D2> LAYER</FONT>
<BR><FONT SIZE=3D2> NAME =
"Sample"</FONT>
<BR><FONT SIZE=3D2> TYPE POLYGON</FONT>
<BR><FONT SIZE=3D2> CONNECTIONTYPE =
OGR</FONT>
<BR><FONT SIZE=3D2> CONNECTION =
"C:\Inetpub\wwwroot\Mapserver\tutorial\dataroland\Sample.TAB"<=
/FONT>
<BR><FONT SIZE=3D2> STATUS ON</FONT>
<BR><FONT SIZE=3D2> CLASS</FONT>
<BR><FONT SIZE=3D2> =
COLOR 232 232 255</FONT>
<BR><FONT SIZE=3D2> =
OUTLINECOLOR 32 32 255</FONT>
<BR><FONT SIZE=3D2> END</FONT>
<BR><FONT SIZE=3D2> END</FONT>
<BR><FONT SIZE=3D2> # 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["unnamed",</FONT>
<BR><FONT SIZE=3D2> =
GEOGCS["unnamed",</FONT>
<BR><FONT SIZE=3D2> =
DATUM["OSGB_1936",</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; SPHEROID["Airy 1930",6377563.396,299.3249646],</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; TOWGS84[375,-111,431,0,0,0,0]],</FONT>
<BR><FONT SIZE=3D2> =
PRIMEM["Greenwich",0],</FONT>
<BR><FONT SIZE=3D2> =
UNIT["degree",0.0174532925199433]],</FONT>
<BR><FONT SIZE=3D2> =
PROJECTION["Transverse_Mercator"],</FONT>
<BR><FONT SIZE=3D2> =
PARAMETER["latitude_of_origin",49],</FONT>
<BR><FONT SIZE=3D2> =
PARAMETER["central_meridian",-2],</FONT>
<BR><FONT SIZE=3D2> =
PARAMETER["scale_factor",0.9996012717],</FONT>
<BR><FONT SIZE=3D2> =
PARAMETER["false_easting",400000],</FONT>
<BR><FONT SIZE=3D2> =
PARAMETER["false_northing",-100000],</FONT>
<BR><FONT SIZE=3D2> =
UNIT["Meter",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). 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 "WEB" and "LOG" =
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