Need Help with Mapscript Tcl - mapObj

Yeewen Sat yeewen at petromap.com
Thu Dec 7 10:45:55 PST 2000


If I use namespace, I get these errors:

invalid command name "mapscript::mapObj"
    while executing
"mapscript::mapObj map1 $file"
    (file "test.tcl" line 26)

So, I don't use mapscript namespace in my tcl.

Thanks to Tom for the ms_error suggestion, I found out what my problem was.
It's in newsym.sym file - some invalid gif images reference. I don't really
need them, so I removed them. At the end, I was able to load a mapfile, draw
it, and save the image (.gif) created.

Now, I have more questions :-)

Is there a way to generate GIF images based on the zoom value,
mapsize...like how mapserv cgi does it - given a mapfile, zoom value,
mapsize, imgext, imgxy, creates a gif for the specified area. So, can I do
that through mapscript? Right now, load, draw and save image will save the
entire map.

Thanks,
Yeewen





-----Original Message-----
From: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu]On Behalf Of Tom
Poindexter
Sent: December 6, 2000 2:51 PM
To: Yeewen Sat; mapserver-users at lists.gis.umn.edu
Subject: Re: Need Help with Mapscript Tcl - mapObj


On Wed, Dec 06, 2000 at 11:44:20AM -0700, Yeewen Sat wrote:

> I constructed a mapObj with a mapfile with this line:
>
> mapObj map1 $file

The Tcl Mapscript interface should live in the 'mapscript' namespace:

  mapscript::mapObj map1 $file


> $file is the mapfile name without the .map extension. (with .map
extension,
> I got segmentation fault in tclsh)


The file name should include .map

> I don't understand why I keep getting NULL back from it...and what ever I
do
> after will (of course) fails.

You can examine the 'ms_error' object to get the failure codes:

puts [mapscript::ms_error cget -code]
puts [mapscript::ms_error cget -routine]
puts [mapscript::ms_error cget -message]

The message is rather terse, but you should be able to figure out what
the mapfile parse is complaining about.

--
Tom Poindexter
tpoindex at nyx.net
http://www.nyx.net/~tpoindex/




More information about the MapServer-users mailing list