Projections and debugging web processes

Cameron Shorter cshorter at optusnet.com.au
Mon Aug 23 18:00:24 EDT 1999


I belive I have worked out how to debug mapserv.cgi.  I set up
environment variables and then run from the command line, and hence can
attach the gdb debugger.  Ie, in my .bashrc I set the following:

# Env variables for debugging mapserv
QUERY_STRING="map=%2Fhome%2Fbikeast%2Fcamerons%2Fbikeast_amg56.map&layer=onroad"
REQUEST_METHOD="GET"

export QUERY_STRING REQUEST_METHOD

----------------------------
My files are in lat/long coordinates and I want to convert them to
AMG56.

The mapfile works if I comment out all the projection data.

I have been using gdb to try and debug mapserv.cgi and compare it to
shp2gif.  The problem seems to be in msAdjustExtent, but I haven't
worked it out yet.  I will be doing more work on it over the next few
days (if you cannot give me a few hints in the meantime).

The mapfile I'm using is below:

----------------------------
#
# Start of map file
#
NAME BIKEAST
STATUS ON
SIZE 300 300
SHADESET /www/mapserv/ms_symbols/symbols/shade.sym
MARKERSET /www/mapserv/ms_symbols/symbols/marker.sym
LINESET /www/mapserv/ms_symbols/symbols/line.sym

# Lat Long coordinates
#EXTENT 151.203 -33.9247 151.286 -33.8405

# amg56 coordinates
EXTENT  333893.70 6244726.01 341410.96 6254194.63
#EXTENT 333893.70+6244726.01+341410.96+6254194.63

# Extent provided by Rob
#EXTENT 323912.333333 6229086.333333 350370.666667 6255544.666667
#EXTENT 323912.333333+6229086.333333+350370.666667+6255544.666667

UNITS KILOMETERS
SHAPEPATH "/home/bikeast/camerons/data"
IMAGECOLOR 255 255 255
PROJECTION
  "proj=utm"
  "ellps=aust_SA"
  "zone=56"
  "south"
END
INTERLACE off


LABELOVERLAP FALSE

#
# Start of web interface definition
#
WEB
  HEADER bikeast_header.html
  TEMPLATE bikeast.html
  MINSCALE 1
  MAXSCALE 1550000
END

#
# Start of reference map
#
REFERENCE
  IMAGE graphics/reference_base.gif
  #IMAGE
http://nccnsw.org.au/cgi-bin/csgi/broker/delivery_agent.pl?filename=/www/hosted/nccnsw/cgi-bin/csgi/broker/cache/930655471_13239_1.gif
  #EXTENT 151.203 -33.9247 151.286 -33.8405
  STATUS ON
  COLOR -1 -1 -1
  OUTLINECOLOR 255 0 0
END

#
# Start of legend
#
LEGEND
  KEYSIZE 18 12
  LABEL
    TYPE BITMAP
    SIZE MEDIUM
    COLOR 0 0 89
  END
  STATUS ON
END

#
# Start of scalebar
#
SCALEBAR
  IMAGECOLOR 255 255 255
  LABEL
    COLOR 0 0 0	
    SIZE SMALL
  END
  SIZE 350 5
  COLOR 255 255 255
  BACKGROUNDCOLOR 0 0 0
  OUTLINECOLOR 0 0 0
  UNITS MILES
  INTERVALS 5
  STATUS ON
END

#
# Start of layer definitions
#
LAYER
  NAME "topo25k"
  TYPE RASTER
  STATUS ON
  DATA topo25k.tif
  #OFFSITE 0

  PROJECTION
    Geographic
    "ellps=aust_SA"
  END
END # Layer

LAYER
  NAME onroad
  TYPE LINE
  STATUS ON
  DATA onroad
  TOLERANCE 5
  PROJECTION
    Geographic
    "ellps=aust_SA"
  END

  CLASSITEM "STATUS"
  CLASS
    NAME "Onroad - adopted"
    EXPRESSION "a"
    COLOR 0 0 255
    SYMBOL 1
  END

  CLASS
    NAME "Onroad - BIKEast"
    EXPRESSION "b"
    COLOR 0 255 0
    SYMBOL 2
  END

  CLASS
    NAME "Individual"
    EXPRESSION "i"
    COLOR 127 127 0
    SYMBOL 3
  END


  QUERY
    TEMPLATE onroad.html
  END
END # Layer

LAYER
  NAME offroad
  TYPE LINE
  STATUS ON
  DATA offroad
  TOLERANCE 5
  PROJECTION
    Geographic
    "ellps=aust_SA"
  END

  CLASS
    NAME "offroad"
    COLOR 255 0 0
    SYMBOL 1
  END

  QUERY
    TEMPLATE offroad.html
  END
END # Layer

LAYER
  NAME "blackspot"
  TYPE POINT
  STATUS ON
  DATA blackspot
  TOLERANCE 5
  PROJECTION
    Geographic
    "ellps=aust_SA"
  END

  CLASS
    NAME "blackspot"
    COLOR 255 0 0
    SIZE 0
  END

  QUERY
    TEMPLATE offroad.html
  END
END # Layer

END # Map File

Stephen Lime wrote:
> 
> How are you initializing the web process? Are you sure intial extents are correct and are in the correct coordinate system? Everything should be in the maps projection. Individual layers are converted to that (if necessary) but no other coordinates.
> 
> Does the demo work with that install or is this all new to this particular compiled version?
> 
> Debugging web stuff ain't fun. If you're using apache (don't know about others) then you can just print to stderr and messages will show up in the logs.
> 
> Steve
> 
> <<< Cameron Shorter <cshorter at optusnet.com.au>  8/17  7:31a >>>
> I have been trying to get projections working.  So far I have been able
> to get shp2gif to draw map using my projections map file, but for some
> reason it doesn't work when I call mapserver from the web for that
> mapfile.  Mapserv does work for other non-projection map files.
> 
> Does anyone know:
> 1. Why shp2gif would work, but mapserv only produces a blank page.
> 2. How to attach a gdb to a web process.
> 3. Other ideas on debugging.
> 
> Cameron.



More information about the mapserver-users mailing list