[mapserver-users] rosa, projection and query problem

Debbie Pagurek pagurekd at agr.gc.ca
Tue Aug 20 07:19:39 PDT 2002


OK - I solved my problem.  For some reason, after I added the projection tags the application no longer "liked" TOLERANCE 0.  So I added TOLERANCEUNITS METERS to my map file, and changed the TOLERANCE to 1 and the query part of the application works again.

So the question is... why doesn't TOLERANCE 0 work once the projection information is added?  I wasn't actually changing the projection of the layers, I just added the projection tags so that the app can be used as a WMS server.

D. Pagurek

>>> "Debbie Pagurek" <pagurekd at agr.gc.ca> 08/19/02 03:29PM >>>
Hi everone,
I've developed an application using Mapserver CGI, the ROSA applet, and shapefiles that are in decimal degrees.  The application works, including the queries on the polygons, as long as I don't include any projection information in the map file.  However, I am trying to set this application up for use as a WMS server, and as soon as I put the projection tags into the mapfile e.g.
PROJECTION
    "init=epsg:4267"
END
(this tag is in each layer definition as well as at the very top section of the mapfile)

everything works EXCEPT for the query, which results in the following:
msQueryByPoint(): Search returned no results. No matching record(s) found

But as far as I can tell from the URL, nothing has changed as a result of the click on the map.

Is there some sort of underlying conflict with PROJ and ROSA (i doubt that)... can anyone shed any light on this frustrating problem I'm having?
see below for the mapfile
I have another application that is set up the same way for use as a WMS server but it doesn't use ROSA... and it works fine, so I don't think this is a problem with the PROJ setup.
D. Pagurek

#
# Start of map file 
#
NAME ECOROSA
STATUS ON
SIZE 500 250
EXTENT -150 40 -50 90
UNITS dd
SHAPEPATH "c:\inetpub\wwwroot\ms_demo\eco\data"
IMAGECOLOR 255 255 255
# Projection definition, consult the PROJ.4 documentation for parameter discussion
#
PROJECTION
  "init=epsg:4267"
END

#
# Start of web interface definition
#
WEB
  IMAGEPATH "C:\Inetpub\wwwroot\temp\"
  IMAGEURL "/temp/"
  TEMPLATE eco_rosa.html
 METADATA
    "wms_title" "WMS Ecostratification"
    "wms_onlineresource" "http://myhost/scripts/mapserv.exe?"
    "wms_srs" "EPSG:4267"

...etc...
  END #metadata
END  #WEB

QUERYMAP
  SIZE 500 250
  STATUS ON
  STYLE HILITE
  COLOR 255 255 0
END


#
# Start of reference map
#
REFERENCE
  IMAGE "c:\inetpub\wwwroot\ms_demo\aveco2\ref_map.gif"
  EXTENT  -150 40 -50 90
  SIZE 100 50
  STATUS ON
  COLOR -1 -1 -1
  OUTLINECOLOR 255 0 0
END

#
# Start of legend
#
LEGEND
  STATUS ON
  IMAGECOLOR 255 255 255
  OUTLINECOLOR 0 0 0
   #KEYSIZE 18 12
   KEYSIZE 16 10
    LABEL
      TYPE BITMAP
      SIZE SMALL
      COLOR 0 0 0
    END
  END   #LEGEND

#
# Start of scalebar
#
SCALEBAR
  STATUS ON
  IMAGECOLOR 255 255 255
  LABEL
    COLOR 255 0 0
    SIZE tiny
  END  #LABEL
  STYLE 1
  SIZE 200 2
  COLOR 153 153 153
  UNITS kilometers
  INTERVALS 3

END   #SCALEBAR
#
# Start of layer definitions
#

LAYER
  NAME 'Ecozones'
  TYPE Polygon
  STATUS ON
  DATA ecozones
TEMPLATE "ecoquery1.html"
FOOTER "ecofooter.html"

  CLASSITEM 'ZONE'
  CLASS
    EXPRESSION '1'
    NAME 'Arctic Cordillera'   
    COLOR 204 255 255
  END  # CLASS
  CLASS
    EXPRESSION '2'
    NAME 'Northern Arctic'
    COLOR 153 204 204
  END  # CLASS
  CLASS
    EXPRESSION '3'
    NAME 'Southern Arctic'
    COLOR 0 153 204
  END  # CLASS
  CLASS
    EXPRESSION '4'
    NAME 'Taiga Plains'
    COLOR 204 204 204
  END  # CLASS
  CLASS
    EXPRESSION '5'
    NAME 'Taiga Shield'
    COLOR 153 153 153
  END  # CLASS
  CLASS
    EXPRESSION '6'
    NAME 'Boreal Shield'
    COLOR 102 204 102
  END  # CLASS
  CLASS
    EXPRESSION '7'
    NAME 'Atlantic Maritime'
    COLOR 102 204 204
  END  # CLASS
  CLASS
    EXPRESSION '8'
    NAME 'Mixed Wood Plains'
    COLOR 255 204 153
  END  # CLASS
  CLASS
    EXPRESSION '9'
    NAME 'Boreal Plains'
    COLOR 204 255 204
  END  # CLASS
  CLASS
    EXPRESSION '10'
    NAME 'Prairies'
    COLOR 255 255 153
  END  # CLASS
  CLASS
    EXPRESSION '11'
    NAME 'Taiga Cordillera'
    COLOR 204 153 204
  END  # CLASS
  CLASS
    EXPRESSION '12'
    NAME 'Boreal Cordillera'
    COLOR 153 102 204
  END  # CLASS
  CLASS
    EXPRESSION '13'
    NAME 'Pacific Maritime'
    COLOR 0 102 0
  END  # CLASS
  CLASS
    EXPRESSION '14'
    NAME 'Montane Cordillera'
    COLOR 153 204 000
  END  # CLASS
    CLASS
    EXPRESSION '15'
    NAME 'Hudson Plains'
    COLOR 204 255 153
  END  # CLASS
  TOLERANCE 0
 PROJECTION
    "init=epsg:4267"
  END
 METADATA
    "wms_title"  "Ecozones"
    "wms_Srs"  "EPSG:4267"
    "wms_abstract" "An area at the earth's surface representative of large and very generalized ecological units characterized by various abiotic and biotic factors. "
    "wms_extent" "-150 40 -50 90"
    "wms_opaque" "1"
  END

END  # LAYER


LAYER
  NAME Ecodistricts
  TYPE Polygon
  STATUS ON
  DATA eco

TEMPLATE "ecoquery3.html"

  CLASS
    NAME "Ecodistricts"
    OUTLINECOLOR 204 0 0 
  END  # CLASS
  TOLERANCE 0
 PROJECTION
    "init=epsg:4267"
  END
METADATA
    "wms_title"  "Ecodistricts"
    "wms_srs"  "EPSG:4267"
    "wms_abstract" "A part of an ecoregion characterized by distinctive assemblages of relief, geology, landforms,soils, vegetation, water, and fauna."
    "wms_extent" "-150 40 -50 90"
    "wms_opaque" "0"
 END

END  # LAYER

LAYER
  NAME Ecoregions
  TYPE Polygon
  STATUS ON 
  DATA ecoregions

HEADER "ecoheader.html"
TEMPLATE "ecoquery2.html"

  CLASS
    NAME 'Ecoregions'
    OUTLINECOLOR 0 0 0
  END #CLASS
  TOLERANCE 0
 PROJECTION
 "init=epsg:4267"
  END
 METADATA
    "wms_title"  "ecoregions"
    "wms_srs"  "EPSG:4267"
    "wms_abstract" "A part of an ecozone characterized by distinctive regional ecological factors, including climate, physiography, vegetation, soil, water and fauna."
    "wms_extent" "-150 40 -50 90"
    "wms_opaque" "0"
  END

END #LAYER

END  # MAPFILE





More information about the MapServer-users mailing list