Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-22 Thread Prabu Raja
Hi Steve / Daniel,

I am using ms4w from http://maptools.org/ms4w/index.phtml in Windows 7.

Following is my map file content.

MAP
NAME ms_sql
IMAGECOLOR 255 255 255
 # default output image dimensions
SIZE 256 256
 # Is the map active? Sometimes you may wish to turn this off to
# use only the reference map or scale bar.
 STATUS ON
 CONFIG MS_ERRORFILE \var\Map\error.txt
 DEBUG 0
 # set top level projection
 PROJECTION
init=epsg:4326
END
 # image format options
OUTPUTFORMAT
   NAME png
   DRIVER AGG/PNG
  MIMETYPE image/png
  IMAGEMODE RGBA
  EXTENSION png
   TRANSPARENT ON
  FORMATOPTION GAMMA=0.75
   END
EXTENT -180 -90 180 90 # World

   LAYER
  VALIDATION
'V1'  '^[-+]?[0-9]*\.?[0-9]+$'
   'V2'  '^[-+]?[0-9]*\.?[0-9]+$'
'V3'  '^[-+]?[0-9]*\.?[0-9]+$'
   'V4'  '^[-+]?[0-9]*\.?[0-9]+$'
'V5'  '^[-+]?[0-9]*\.?[0-9]+$'
   'V6'  '^[-+]?[0-9]*\.?[0-9]+$'
  END
  NAME state
  TYPE polygon
  STATUS ON
  CONNECTIONTYPE POSTGIS
  CONNECTION host=localhost dbname=pollutionmap user=*** password=***
  port=5432
  DATA wkb_geometry FROM  (SELECT ogc_fid AS
oid, wkb_geometry, totpop1 FROM state_tst) AS SUBQUERY using unique oid
  PROCESSING CLOSE_CONNECTION=DEFER
  CLASSITEM totpop1
  OPACITY 100
  CLASS
 EXPRESSION ([TOTPOP1] = %V1% AND [TOTPOP1]  %V2%)
 STYLE
COLOR 255 108 118
OUTLINECOLOR 255 255 255
 END
  END
  CLASS
 EXPRESSION ([TOTPOP1] = %V2% AND [TOTPOP1]  %V3%)
 STYLE
COLOR 254 189 75
OUTLINECOLOR 255 255 255
 END
  END
  CLASS
 EXPRESSION ([TOTPOP1] = %V3% AND [TOTPOP1]  %V4%)
 STYLE
COLOR 254 247 46
OUTLINECOLOR 255 255 255
 END
  END
  CLASS
 EXPRESSION ([TOTPOP1] = %V4% AND [TOTPOP1]  %V5%)
 STYLE
COLOR 39 251 114
OUTLINECOLOR 255 255 255
 END
  END
  CLASS
 EXPRESSION ([TOTPOP1] = %V5% AND [TOTPOP1] = %V6%)
 STYLE
COLOR 108 111 205
OUTLINECOLOR 255 255 255
 END
  END
   END
END

Below are the url's through I am trying to generate map

http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245

http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650V2=33288104V3=66515558V4=99743012V5=132970466V6=166197921


Accessing through above 2 url gives '500 Internal Server Error'.
No error message in mapserver log.

Following error message logged in apache error log.
[warn] [client 127.0.0.1] (OS 109)The pipe has been ended.  : mod_fcgid:
get overlap result error
[error] [client 127.0.0.1] Premature end of script headers: mapserv.exe

And following was logged in appache access log

GET
/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245
HTTP/1.1 500 533



On Wed, Nov 16, 2011 at 9:14 PM, Daniel Morissette dmorisse...@mapgears.com
 wrote:

 Which binaries are you using?

 If you your own custom build then are you sure it's not a case of multiple
 versions of REGEX on the same system? That used to be a problem in the old
 days with PHP's local copy of regex conflicting with the system regex, but
 I don't think that is a problem any more though.



 On 11-11-16 10:40 AM, Lime, Steve D (DNR) wrote:

 Well, that’s not good is it. Hmmm… I ran a quick test here using this
 mapfile:

 MAP

 NAME 'test'

 SIZE 450 600

 EXTENT 125000 4785000 788000 5489000

 IMAGETYPE PNG8

 LAYER

 VALIDATION

 'area' '^[-+]?[0-9]*\.?[0-9]+$'

 END

 NAME 'county'

 STATUS DEFAULT

 TYPE POLYGON

 DATA ' bdry_counpy2'

 CLASS

 EXPRESSION ([area]  %area%)

 STYLE COLOR 212 212 212 OUTLINECOLOR 0 0 0 END

 END

 END

 END

 This is against 6.0 latest trunk although I don’t think there have been
 any changes in that area…

 I can run something like:

 mapserv -nh QUERY_STRING=map=test.map**mode=maparea=5 
 test.png

 If ‘area’ parameter is provided as a non-double then the substitution
 isn’t done. I believe the substitution validation errors fail silently.
 This example works, how different is what you’re doing?

 Steve

 *From:*Prabu Raja [mailto:prab.r...@gmail.com]
 *Sent:* Wednesday, November 16, 2011 5:16 AM
 *To:* Lime, Steve D (DNR)
 *Cc:* mapserver-users@lists.osgeo.**org mapserver-users@lists.osgeo.org
 *Subject:* Re: [mapserver-users] Problem with Variable Substitution for

 EXPRESSION

 Thanks Steve.

 Tried the following regular expression

 [-+]?[0-9]*\.?[0-9]+.

 For which the internal server error is coming from Apache. No error
 logged in mapserver log.


  Internal Server Error

 The server encountered an internal error or misconfiguration and was
 unable to complete your request.**


 On Tue, Nov 15, 2011 at 8:37 PM, Lime, Steve 

[mapserver-users] Re: New blog post

2011-11-22 Thread James Rutter
It's a product called iShareGIS from Astun Technology...
www.astuntechnology.com ...it's very nice and takes all the coding bit off
the front end...I can concentrate on my data in PostGIS and rendering styles
etc in the .map file and I use Astun's Studio product to connect MapServer
layers into the OpenLayers front end.

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/New-blog-post-tp7019930p7019983.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: QGis 'Zoom to best scale' Not Working

2011-11-22 Thread SixDegrees
Thank you. I added wms_resx and wms_resy to my mapfile with reasonable values
(and some unreasonable ones, just as tests). This makes no difference. When
I make a GetCapabilities request, the layer's bounding box is correct but it
does NOT contain the resx or resy settings, as I believe it should.

I don't know if this is a problem in my mapfile or in MapServer. My mapfile
layer looks like this (file names changed for proprietary reasons):

LAYER 
   NAME MyImage
   GROUP MyGroup
   EXTENT 75.80425 35.304 76.01625 35.476
   METADATA 
  wms_title MyImage
  wms_group_title MyGroup
  wms_extent 75.80425 35.304 76.01625 35.476
  wms_srs EPSG:4326
  wms_resx 1.0 # Note: these values are for testing only. The actual
values have
  wms_resy 1.0 # also been tried, with no success. They are
5.90139233796e-06, -4.85244300668e-06
   END
   PROCESSING SCALE=AUTO 
   PROCESSING SCALE_BUCKETS=256 
   TYPE RASTER 
   DATA MyImage.vrt
   PROJECTION 
  +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
   END
END




Rahkonen Jukka wrote
 
 Hi,
 
 WMS does not advertise by default the native resolution of the data.  I
 have never tried but perhaps adding wms_resx, wms_resy metadata into layer
 metadata would add that information into GetCapabilities
 http://mapserver.org/ogc/wms_server.html.
  I do not know if QGis can utilise that information even if it exists.
 
 -Jukka Rahkonen-
 
 SixDegrees wrote:
 
 I'm not sure if this is a QGis problem or a problem with my
 Mapserver-generated WMS layer. When I load a WMS image in QGis, everything
 works as expected except when I select 'Zoom to best scale' I get a
 Mapserver error stating that the bounding box is illegal. And it is - the
 bounding box corner points in the getmap request are identical. This
 selections is supposed to zoom in so the pixels displayed are 1:1 or 100%
 
 A look at the capabilities request returned by Mapserver and the mapfile
 and
 images involved don't show anything obviously wrong. Is it possible that
 QGis is sending the wrong request? Or is something missing from either the
 capabilities document or the mapfile layer?
 
 I'm not really sure where to start looking to isolate the problem. Note
 that
 if I load images directly instead of through Mapserver WMS I am able to
 zoom
 to scale without any problem, which suggests a problem with Mapserver,
 likely in the mapfile. I am using VRT files as intermediaries between the
 Mapfile and the underlying NITF files; it seems that Mapserver should be
 using the affine transform contained in the VRT to determine proper
 scaling,
 but I'm not sure if that is sufficient. Are there arguments that need to
 be
 placed in the Mapfile metadata to help WMS generation along? Or something
 that would cause items in the capabilities document to be left out?
 
 Using QGis 1.7.0 on Linux.
 
 --
 View this message in context:
 http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7017776.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 


--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7020034.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: QGis 'Zoom to best scale' Not Working

2011-11-22 Thread SixDegrees
Sorry, I was wrong in the previous message; the resx and resy settings do
show up in the capabilities document. They make no difference, however; the
bounding box requested by QGis is still in error.


SixDegrees wrote
 
 Thank you. I added wms_resx and wms_resy to my mapfile with reasonable
 values (and some unreasonable ones, just as tests). This makes no
 difference. When I make a GetCapabilities request, the layer's bounding
 box is correct but it does NOT contain the resx or resy settings, as I
 believe it should.
 
 I don't know if this is a problem in my mapfile or in MapServer. My
 mapfile layer looks like this (file names changed for proprietary
 reasons):
 
 LAYER 
NAME MyImage
GROUP MyGroup
EXTENT 75.80425 35.304 76.01625 35.476
METADATA 
   wms_title MyImage
   wms_group_title MyGroup
   wms_extent 75.80425 35.304 76.01625 35.476
   wms_srs EPSG:4326
   wms_resx 1.0 # Note: these values are for testing only. The
 actual values have
   wms_resy 1.0 # also been tried, with no success. They are
 5.90139233796e-06, -4.85244300668e-06
END
PROCESSING SCALE=AUTO 
PROCESSING SCALE_BUCKETS=256 
TYPE RASTER 
DATA MyImage.vrt
PROJECTION 
   +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
END
 END
 
 
 
 
 Rahkonen Jukka wrote
 
 Hi,
 
 WMS does not advertise by default the native resolution of the data.  I
 have never tried but perhaps adding wms_resx, wms_resy metadata into
 layer metadata would add that information into GetCapabilities
 http://mapserver.org/ogc/wms_server.html.
  I do not know if QGis can utilise that information even if it exists.
 
 -Jukka Rahkonen-
 
 SixDegrees wrote:
 
 I'm not sure if this is a QGis problem or a problem with my
 Mapserver-generated WMS layer. When I load a WMS image in QGis,
 everything
 works as expected except when I select 'Zoom to best scale' I get a
 Mapserver error stating that the bounding box is illegal. And it is - the
 bounding box corner points in the getmap request are identical. This
 selections is supposed to zoom in so the pixels displayed are 1:1 or 100%
 
 A look at the capabilities request returned by Mapserver and the mapfile
 and
 images involved don't show anything obviously wrong. Is it possible that
 QGis is sending the wrong request? Or is something missing from either
 the
 capabilities document or the mapfile layer?
 
 I'm not really sure where to start looking to isolate the problem. Note
 that
 if I load images directly instead of through Mapserver WMS I am able to
 zoom
 to scale without any problem, which suggests a problem with Mapserver,
 likely in the mapfile. I am using VRT files as intermediaries between the
 Mapfile and the underlying NITF files; it seems that Mapserver should be
 using the affine transform contained in the VRT to determine proper
 scaling,
 but I'm not sure if that is sufficient. Are there arguments that need to
 be
 placed in the Mapfile metadata to help WMS generation along? Or something
 that would cause items in the capabilities document to be left out?
 
 Using QGis 1.7.0 on Linux.
 
 --
 View this message in context:
 http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7017776.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 
 


--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7020066.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Re: QGis 'Zoom to best scale' Not Working

2011-11-22 Thread Travis Kirstine
Are you requesting the MyGroup layer or MyImage, I'm not sure if
the group inherits the layer metadata (I'm sure someone on the list
knows).  I have noticed that when adding grouped layers in QGIS the
zoom to extent does not work however it will work when individual
layers are added.

Regards

On 22 November 2011 06:08, SixDegrees paulcarli...@comcast.net wrote:
 Sorry, I was wrong in the previous message; the resx and resy settings do
 show up in the capabilities document. They make no difference, however; the
 bounding box requested by QGis is still in error.


 SixDegrees wrote

 Thank you. I added wms_resx and wms_resy to my mapfile with reasonable
 values (and some unreasonable ones, just as tests). This makes no
 difference. When I make a GetCapabilities request, the layer's bounding
 box is correct but it does NOT contain the resx or resy settings, as I
 believe it should.

 I don't know if this is a problem in my mapfile or in MapServer. My
 mapfile layer looks like this (file names changed for proprietary
 reasons):

 LAYER
    NAME MyImage
    GROUP MyGroup
    EXTENT 75.80425 35.304 76.01625 35.476
    METADATA
       wms_title MyImage
       wms_group_title MyGroup
       wms_extent 75.80425 35.304 76.01625 35.476
       wms_srs EPSG:4326
       wms_resx 1.0 # Note: these values are for testing only. The
 actual values have
       wms_resy 1.0 # also been tried, with no success. They are
 5.90139233796e-06, -4.85244300668e-06
    END
    PROCESSING SCALE=AUTO
    PROCESSING SCALE_BUCKETS=256
    TYPE RASTER
    DATA MyImage.vrt
    PROJECTION
       +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
    END
 END




 Rahkonen Jukka wrote

 Hi,

 WMS does not advertise by default the native resolution of the data.  I
 have never tried but perhaps adding wms_resx, wms_resy metadata into
 layer metadata would add that information into GetCapabilities
 http://mapserver.org/ogc/wms_server.html.
  I do not know if QGis can utilise that information even if it exists.

 -Jukka Rahkonen-

 SixDegrees wrote:

 I'm not sure if this is a QGis problem or a problem with my
 Mapserver-generated WMS layer. When I load a WMS image in QGis,
 everything
 works as expected except when I select 'Zoom to best scale' I get a
 Mapserver error stating that the bounding box is illegal. And it is - the
 bounding box corner points in the getmap request are identical. This
 selections is supposed to zoom in so the pixels displayed are 1:1 or 100%

 A look at the capabilities request returned by Mapserver and the mapfile
 and
 images involved don't show anything obviously wrong. Is it possible that
 QGis is sending the wrong request? Or is something missing from either
 the
 capabilities document or the mapfile layer?

 I'm not really sure where to start looking to isolate the problem. Note
 that
 if I load images directly instead of through Mapserver WMS I am able to
 zoom
 to scale without any problem, which suggests a problem with Mapserver,
 likely in the mapfile. I am using VRT files as intermediaries between the
 Mapfile and the underlying NITF files; it seems that Mapserver should be
 using the affine transform contained in the VRT to determine proper
 scaling,
 but I'm not sure if that is sufficient. Are there arguments that need to
 be
 placed in the Mapfile metadata to help WMS generation along? Or something
 that would cause items in the capabilities document to be left out?

 Using QGis 1.7.0 on Linux.

 --
 View this message in context:
 http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7017776.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




 --
 View this message in context: 
 http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7020066.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-22 Thread Jeff McKenna

Hello,

If I was in your situation, I would follow Steve's advice and test it 
through the commandline (mapserv -nh QUERY_STRING=blah) to test your 
request in normal CGI mode.


Then if all else fails, create a very small one layer mapfile with a 
tiny data file and package that with a requests.txt file, and submit 
that to the MapServer Issue Tracker, or event point to it here on the list.


-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 11-11-22 5:25 AM, Prabu Raja wrote:

Hi Steve / Daniel,

I am using ms4w from http://maptools.org/ms4w/index.phtml in Windows 7.

Following is my map file content.

MAP
NAME ms_sql
IMAGECOLOR 255 255 255
# default output image dimensions
SIZE 256 256
# Is the map active? Sometimes you may wish to turn this off to
# use only the reference map or scale bar.
STATUS ON
CONFIG MS_ERRORFILE \var\Map\error.txt
DEBUG 0
# set top level projection
PROJECTION
init=epsg:4326
END
# image format options
OUTPUTFORMAT
   NAME png
   DRIVER AGG/PNG
   MIMETYPE image/png
   IMAGEMODE RGBA
   EXTENSION png
   TRANSPARENT ON
   FORMATOPTION GAMMA=0.75
END
EXTENT -180 -90 180 90 # World

LAYER
   VALIDATION
'V1' '^[-+]?[0-9]*\.?[0-9]+$'
'V2' '^[-+]?[0-9]*\.?[0-9]+$'
'V3' '^[-+]?[0-9]*\.?[0-9]+$'
'V4' '^[-+]?[0-9]*\.?[0-9]+$'
'V5' '^[-+]?[0-9]*\.?[0-9]+$'
'V6' '^[-+]?[0-9]*\.?[0-9]+$'
   END
   NAME state
   TYPE polygon
   STATUS ON
   CONNECTIONTYPE POSTGIS
   CONNECTION host=localhost dbname=pollutionmap user=***
password=***   port=5432
   DATA wkb_geometry FROM  (SELECT ogc_fid AS
oid, wkb_geometry, totpop1 FROM state_tst) AS SUBQUERY using unique oid
   PROCESSING CLOSE_CONNECTION=DEFER
   CLASSITEM totpop1
   OPACITY 100
   CLASS
  EXPRESSION ([TOTPOP1] = %V1% AND [TOTPOP1]  %V2%)
  STYLE
 COLOR 255 108 118
 OUTLINECOLOR 255 255 255
  END
   END
   CLASS
  EXPRESSION ([TOTPOP1] = %V2% AND [TOTPOP1]  %V3%)
  STYLE
 COLOR 254 189 75
 OUTLINECOLOR 255 255 255
  END
   END
   CLASS
  EXPRESSION ([TOTPOP1] = %V3% AND [TOTPOP1]  %V4%)
  STYLE
 COLOR 254 247 46
 OUTLINECOLOR 255 255 255
  END
   END
   CLASS
  EXPRESSION ([TOTPOP1] = %V4% AND [TOTPOP1]  %V5%)
  STYLE
 COLOR 39 251 114
 OUTLINECOLOR 255 255 255
  END
   END
   CLASS
  EXPRESSION ([TOTPOP1] = %V5% AND [TOTPOP1] = %V6%)
  STYLE
 COLOR 108 111 205
 OUTLINECOLOR 255 255 255
  END
   END
END
END

Below are the url's through I am trying to generate map

http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245
http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245

http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650V2=33288104V3=66515558V4=99743012V5=132970466V6=166197921
http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650V2=33288104V3=66515558V4=99743012V5=132970466V6=166197921


Accessing through above 2 url gives '500 Internal Server Error'.
No error message in mapserver log.

Following error message logged in apache error log.
[warn] [client 127.0.0.1] (OS 109)The pipe has been ended.  : mod_fcgid:
get overlap result error
[error] [client 127.0.0.1] Premature end of script headers: mapserv.exe

And following was logged in appache access log

GET
/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245
HTTP/1.1 500 533



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Problem with Variable Substitution for EXPRESSION

2011-11-22 Thread Lime, Steve D (DNR)
I'm going to try a copy of the mapfile here and see what happens... Will report 
back later today.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna
Sent: Tuesday, November 22, 2011 8:36 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with Variable Substitution for EXPRESSION

Hello,

If I was in your situation, I would follow Steve's advice and test it 
through the commandline (mapserv -nh QUERY_STRING=blah) to test your 
request in normal CGI mode.

Then if all else fails, create a very small one layer mapfile with a 
tiny data file and package that with a requests.txt file, and submit 
that to the MapServer Issue Tracker, or event point to it here on the list.

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 11-11-22 5:25 AM, Prabu Raja wrote:
 Hi Steve / Daniel,

 I am using ms4w from http://maptools.org/ms4w/index.phtml in Windows 7.

 Following is my map file content.

 MAP
 NAME ms_sql
 IMAGECOLOR 255 255 255
 # default output image dimensions
 SIZE 256 256
 # Is the map active? Sometimes you may wish to turn this off to
 # use only the reference map or scale bar.
 STATUS ON
 CONFIG MS_ERRORFILE \var\Map\error.txt
 DEBUG 0
 # set top level projection
 PROJECTION
 init=epsg:4326
 END
 # image format options
 OUTPUTFORMAT
NAME png
DRIVER AGG/PNG
MIMETYPE image/png
IMAGEMODE RGBA
EXTENSION png
TRANSPARENT ON
FORMATOPTION GAMMA=0.75
 END
 EXTENT -180 -90 180 90 # World

 LAYER
VALIDATION
 'V1' '^[-+]?[0-9]*\.?[0-9]+$'
 'V2' '^[-+]?[0-9]*\.?[0-9]+$'
 'V3' '^[-+]?[0-9]*\.?[0-9]+$'
 'V4' '^[-+]?[0-9]*\.?[0-9]+$'
 'V5' '^[-+]?[0-9]*\.?[0-9]+$'
 'V6' '^[-+]?[0-9]*\.?[0-9]+$'
END
NAME state
TYPE polygon
STATUS ON
CONNECTIONTYPE POSTGIS
CONNECTION host=localhost dbname=pollutionmap user=***
 password=***   port=5432
DATA wkb_geometry FROM  (SELECT ogc_fid AS
 oid, wkb_geometry, totpop1 FROM state_tst) AS SUBQUERY using unique oid
PROCESSING CLOSE_CONNECTION=DEFER
CLASSITEM totpop1
OPACITY 100
CLASS
   EXPRESSION ([TOTPOP1] = %V1% AND [TOTPOP1]  %V2%)
   STYLE
  COLOR 255 108 118
  OUTLINECOLOR 255 255 255
   END
END
CLASS
   EXPRESSION ([TOTPOP1] = %V2% AND [TOTPOP1]  %V3%)
   STYLE
  COLOR 254 189 75
  OUTLINECOLOR 255 255 255
   END
END
CLASS
   EXPRESSION ([TOTPOP1] = %V3% AND [TOTPOP1]  %V4%)
   STYLE
  COLOR 254 247 46
  OUTLINECOLOR 255 255 255
   END
END
CLASS
   EXPRESSION ([TOTPOP1] = %V4% AND [TOTPOP1]  %V5%)
   STYLE
  COLOR 39 251 114
  OUTLINECOLOR 255 255 255
   END
END
CLASS
   EXPRESSION ([TOTPOP1] = %V5% AND [TOTPOP1] = %V6%)
   STYLE
  COLOR 108 111 205
  OUTLINECOLOR 255 255 255
   END
END
 END
 END

 Below are the url's through I am trying to generate map

 http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245
 http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245

 http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650V2=33288104V3=66515558V4=99743012V5=132970466V6=166197921
 http://localhost/fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650V2=33288104V3=66515558V4=99743012V5=132970466V6=166197921


 Accessing through above 2 url gives '500 Internal Server Error'.
 No error message in mapserver log.

 Following error message logged in apache error log.
 [warn] [client 127.0.0.1] (OS 109)The pipe has been ended.  : mod_fcgid:
 get overlap result error
 [error] [client 127.0.0.1] Premature end of script headers: mapserv.exe

 And following was logged in appache access log

 GET
 /fcgi-bin/mapserv.exe?map=/var/Map/State.maplayers=statemode=mapV1=60650.45V2=33288104.54V3=66515558.222V4=99743012.123V5=132970466.455V6=166197921.245
 HTTP/1.1 500 533


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] WMS default STYLE handled in an odd manner

2011-11-22 Thread Nielsen, Jonas Lund
Hi List,

I have experienced a problem with the handling of the STYLE parameter in
WMS requests to MapServer.

Default STYLE can be specified in several ways: 
Either you can specify nothing, or empty commas which should be
expanded to default for all layers. Or you can explicitly declare
default. It seems MapServer has a problem when you want this automatic
expansion to default, when at the same time you are asking for another
STYLE different from default.
In my experience, the following examples all work fine on MapServer
6.0.1:
LAYERS=layer1,layer2,layer3STYLES=
LAYERS=layer1,layer2,layer3STYLES=,, 
LAYERS=layer1,layer2,layer3STYLES=default,default,default 
LAYERS=layer1,layer2,layer3STYLES=some_style,default,default 
LAYERS=layer1,layer2,layer3STYLES=some_style,default,  (this
is the really interesting one...)

...but these do not, although I would expect them to:
LAYERS=layer1,layer2,layer3STYLES=some_style,, 
LAYERS=layer1,layer2,layer3STYLES=some_style,,default (in
comparison with the last listed working example, this is also very
interesting...)

The error message that I get:
msWMSLoadGetMapParams(): WMS server error. Invalid style
(some_style,,). Mapserver is expecting an empty string for the STYLES
: STYLES= or STYLES=,,, or using keyword default
STYLES=default,default, ...

So it seems that you cannot declare a style different from default for
one layer and at the same time expect MapServer to automatically expand
empty commas for the rest?

Regards
Jonas Nielsen


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] arround decimal for display label

2011-11-22 Thread Tonton
hello

how to indicate the precision after coma  to write a label  or legend

like the data is 25,75693  and display 27,75 .


T.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] arround decimal for display label

2011-11-22 Thread Lime, Steve D (DNR)
Version 6.0 contains some improvements for formatting labels. Legend entries 
come from text you set, not
dynamic content unless I’m missing something obvious.

Anyhow, if you look at the “TEXT” property documentation in 
http://www.mapserver.org/mapfile/class.html you’ll
see an example that does just what you’re looking for.

Steve


From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Tonton
Sent: Tuesday, November 22, 2011 10:52 AM
To: mapserver-users
Subject: [mapserver-users] arround decimal for display label

hello

how to indicate the precision after coma  to write a label  or legend

like the data is 25,75693  and display 27,75 .


T.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] arround decimal for display label

2011-11-22 Thread Tonton
thanks you i am regarding that so i use SLD descriptor for generating layer
and legend !

maybe i will change soonbut right now i need that :o(

On Tue, Nov 22, 2011 at 6:48 PM, Lime, Steve D (DNR) steve.l...@state.mn.us
 wrote:

  Version 6.0 contains some improvements for formatting labels. Legend
 entries come from text you set, not

 dynamic content unless I’m missing something obvious.

 ** **

 Anyhow, if you look at the “TEXT” property documentation in
 http://www.mapserver.org/mapfile/class.html you’ll

 see an example that does just what you’re looking for.

 ** **

 Steve

 ** **

 ** **

 *From:* mapserver-users-boun...@lists.osgeo.org [mailto:
 mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Tonton
 *Sent:* Tuesday, November 22, 2011 10:52 AM
 *To:* mapserver-users
 *Subject:* [mapserver-users] arround decimal for display label

 ** **

 hello

 how to indicate the precision after coma  to write a label  or legend

 like the data is 25,75693  and display 27,75 .


 T. 

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Re: QGis 'Zoom to best scale' Not Working

2011-11-22 Thread SixDegrees
I'm requesting the layer. Interesting that grouped layers cause problems; we
have an identical mapfile with the groups commented out, so I'll give that a
try when I return to work and see if it has the same problem or not.


Travis Kirstine wrote
 
 Are you requesting the MyGroup layer or MyImage, I'm not sure if
 the group inherits the layer metadata (I'm sure someone on the list
 knows).  I have noticed that when adding grouped layers in QGIS the
 zoom to extent does not work however it will work when individual
 layers are added.
 
 Regards
 
 On 22 November 2011 06:08, SixDegrees lt;paulcarlisle@gt; wrote:
 Sorry, I was wrong in the previous message; the resx and resy settings do
 show up in the capabilities document. They make no difference, however;
 the
 bounding box requested by QGis is still in error.


 SixDegrees wrote

 Thank you. I added wms_resx and wms_resy to my mapfile with reasonable
 values (and some unreasonable ones, just as tests). This makes no
 difference. When I make a GetCapabilities request, the layer's bounding
 box is correct but it does NOT contain the resx or resy settings, as I
 believe it should.

 I don't know if this is a problem in my mapfile or in MapServer. My
 mapfile layer looks like this (file names changed for proprietary
 reasons):

 LAYER
    NAME MyImage
    GROUP MyGroup
    EXTENT 75.80425 35.304 76.01625 35.476
    METADATA
       wms_title MyImage
       wms_group_title MyGroup
       wms_extent 75.80425 35.304 76.01625 35.476
       wms_srs EPSG:4326
       wms_resx 1.0 # Note: these values are for testing only. The
 actual values have
       wms_resy 1.0 # also been tried, with no success. They are
 5.90139233796e-06, -4.85244300668e-06
    END
    PROCESSING SCALE=AUTO
    PROCESSING SCALE_BUCKETS=256
    TYPE RASTER
    DATA MyImage.vrt
    PROJECTION
       +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
    END
 END




 Rahkonen Jukka wrote

 Hi,

 WMS does not advertise by default the native resolution of the data.  I
 have never tried but perhaps adding wms_resx, wms_resy metadata into
 layer metadata would add that information into GetCapabilities
 http://mapserver.org/ogc/wms_server.html.
  I do not know if QGis can utilise that information even if it exists.

 -Jukka Rahkonen-

 SixDegrees wrote:

 I'm not sure if this is a QGis problem or a problem with my
 Mapserver-generated WMS layer. When I load a WMS image in QGis,
 everything
 works as expected except when I select 'Zoom to best scale' I get a
 Mapserver error stating that the bounding box is illegal. And it is -
 the
 bounding box corner points in the getmap request are identical. This
 selections is supposed to zoom in so the pixels displayed are 1:1 or
 100%

 A look at the capabilities request returned by Mapserver and the
 mapfile
 and
 images involved don't show anything obviously wrong. Is it possible
 that
 QGis is sending the wrong request? Or is something missing from either
 the
 capabilities document or the mapfile layer?

 I'm not really sure where to start looking to isolate the problem.
 Note
 that
 if I load images directly instead of through Mapserver WMS I am able to
 zoom
 to scale without any problem, which suggests a problem with Mapserver,
 likely in the mapfile. I am using VRT files as intermediaries between
 the
 Mapfile and the underlying NITF files; it seems that Mapserver should
 be
 using the affine transform contained in the VRT to determine proper
 scaling,
 but I'm not sure if that is sufficient. Are there arguments that need
 to
 be
 placed in the Mapfile metadata to help WMS generation along? Or
 something
 that would cause items in the capabilities document to be left out?

 Using QGis 1.7.0 on Linux.

 --
 View this message in context:
 http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7017776.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




 --
 View this message in context:
 http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7020066.html
 Sent from the Mapserver - User mailing list archive at Nabble.com.
 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

 ___
 mapserver-users mailing list
 mapserver-users@.osgeo
 http://lists.osgeo.org/mailman/listinfo/mapserver-users
 


--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale-Not-Working-tp7017776p7021775.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

[mapserver-users] symbol repetition

2011-11-22 Thread knasia
Hi, 
my task is to draw symbols along the road line (I have exact quantity).
It should looks like in the picture beneath.
http://osgeo-org.1803224.n2.nabble.com/file/n7022589/map.png 
My data is road geometry and symbols quantity.
Do you have an idea how to do this?
KN

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/symbol-repetition-tp7022589p7022589.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Compile Error in mapserver-6.0.1 in mapogr.cpp

2011-11-22 Thread Matt Pettis
Hi,

Trying to compile under Ubuntu 8.04 LTS.  configure script passed, but get
error at bottome during make/compile.  Is there a patch for this, or a
higher version?

Thanks,
Matt


g++ -c -O2 -fPIC -Wall  -DNDEBUG-DHAVE_VSNPRINTF -DNEED_STRLCPY
-DNEED_STRLCAT -DNEED_STRRSTR -DUSE_FASTCGI -DUSE_LIBXML2   
-DUSE_WFS_SVR -DUSE_WMS_SVR   -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION 
-DUSE_OGR   -DUSE_PROJ-DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG
-DUSE_GD_WBMP -DUSE_GD_FT -DGD_HAS_FTEX_XSHOW -DGD_HAS_GDIMAGEGIFPTR
-DGD_HAS_GETBITMAPFONTS -DGD_HAS_GET_TRUE_COLOR_PIXEL -DUSE_ICONV -DUSE_GIF
-DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE   -DDISABLE_CVSID
-I/usr/include/freetype2 -I/usr//include -Irenderers/agg/include  
-I/usr//include   -I/usr/include/gdal -I/usr/include/postgresql 
-I/usr/include -I/usr/include/fastcgi  -I/usr/include/libxml2   mapogr.cpp
-o mapogr.o
mapogr.cpp:3215:46: error: macro MS_INIT_COLOR requires 5 arguments, but
only 4 given
mapogr.cpp:3221:50: error: macro MS_INIT_COLOR requires 5 arguments, but
only 4 given
mapogr.cpp: In function 'int msOGRUpdateStyle(OGRStyleMgr*, mapObj*,
layerObj*, classObj*)':
mapogr.cpp:3053: error: 'struct labelObj' has no member named
'backgroundcolor'
mapogr.cpp:3053: error: 'struct labelObj' has no member named
'backgroundcolor'
mapogr.cpp:3053: error: 'struct labelObj' has no member named
'backgroundcolor'
mapogr.cpp:3053: error: 'struct labelObj' has no member named
'backgroundcolor'
mapogr.cpp:3053: error: 'struct labelObj' has no member named
'backgroundcolor'
mapogr.cpp:3215: error: 'MS_INIT_COLOR' was not declared in this scope
make: *** [mapogr.o] Error 1



--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Compile-Error-in-mapserver-6-0-1-in-mapogr-cpp-tp7023084p7023084.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Re: QGis 'Zoom to best scale' Not Working

2011-11-22 Thread Rahkonen Jukka
Hi,

If you haven't already asked from the QGis mailing list, I would say that the 
next thing to do is to ask what metadata element QGIs is using for zoom to best 
scale. After that we can check if it is included in the Mapserver 
GetCapabilities and how.


-Jukka Rahkonen-

 -Alkuperäinen viesti-
 Lähettäjä: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta SixDegrees
 Lähetetty: 22. marraskuuta 2011 22:15
 Vastaanottaja: mapserver-users@lists.osgeo.org
 Aihe: [mapserver-users] Re: QGis 'Zoom to best scale' Not Working
 
 I'm requesting the layer. Interesting that grouped layers 
 cause problems; we
 have an identical mapfile with the groups commented out, so 
 I'll give that a
 try when I return to work and see if it has the same problem or not.
 
 
 Travis Kirstine wrote
  
  Are you requesting the MyGroup layer or MyImage, I'm not sure if
  the group inherits the layer metadata (I'm sure someone on the list
  knows).  I have noticed that when adding grouped layers in QGIS the
  zoom to extent does not work however it will work when individual
  layers are added.
  
  Regards
  
  On 22 November 2011 06:08, SixDegrees lt;paulcarlisle@gt; wrote:
  Sorry, I was wrong in the previous message; the resx and 
 resy settings do
  show up in the capabilities document. They make no 
 difference, however;
  the
  bounding box requested by QGis is still in error.
 
 
  SixDegrees wrote
 
  Thank you. I added wms_resx and wms_resy to my mapfile 
 with reasonable
  values (and some unreasonable ones, just as tests). This makes no
  difference. When I make a GetCapabilities request, the 
 layer's bounding
  box is correct but it does NOT contain the resx or resy 
 settings, as I
  believe it should.
 
  I don't know if this is a problem in my mapfile or in 
 MapServer. My
  mapfile layer looks like this (file names changed for proprietary
  reasons):
 
  LAYER
     NAME MyImage
     GROUP MyGroup
     EXTENT 75.80425 35.304 76.01625 35.476
     METADATA
        wms_title MyImage
        wms_group_title MyGroup
        wms_extent 75.80425 35.304 76.01625 35.476
        wms_srs EPSG:4326
        wms_resx 1.0 # Note: these values are for 
 testing only. The
  actual values have
        wms_resy 1.0 # also been tried, with no 
 success. They are
  5.90139233796e-06, -4.85244300668e-06
     END
     PROCESSING SCALE=AUTO
     PROCESSING SCALE_BUCKETS=256
     TYPE RASTER
     DATA MyImage.vrt
     PROJECTION
        +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
     END
  END
 
 
 
 
  Rahkonen Jukka wrote
 
  Hi,
 
  WMS does not advertise by default the native resolution 
 of the data.  I
  have never tried but perhaps adding wms_resx, wms_resy 
 metadata into
  layer metadata would add that information into GetCapabilities
  http://mapserver.org/ogc/wms_server.html.
   I do not know if QGis can utilise that information even 
 if it exists.
 
  -Jukka Rahkonen-
 
  SixDegrees wrote:
 
  I'm not sure if this is a QGis problem or a problem with my
  Mapserver-generated WMS layer. When I load a WMS image in QGis,
  everything
  works as expected except when I select 'Zoom to best 
 scale' I get a
  Mapserver error stating that the bounding box is 
 illegal. And it is -
  the
  bounding box corner points in the getmap request are 
 identical. This
  selections is supposed to zoom in so the pixels 
 displayed are 1:1 or
  100%
 
  A look at the capabilities request returned by Mapserver and the
  mapfile
  and
  images involved don't show anything obviously wrong. Is 
 it possible
  that
  QGis is sending the wrong request? Or is something 
 missing from either
  the
  capabilities document or the mapfile layer?
 
  I'm not really sure where to start looking to isolate 
 the problem.
  Note
  that
  if I load images directly instead of through Mapserver 
 WMS I am able to
  zoom
  to scale without any problem, which suggests a problem 
 with Mapserver,
  likely in the mapfile. I am using VRT files as 
 intermediaries between
  the
  Mapfile and the underlying NITF files; it seems that 
 Mapserver should
  be
  using the affine transform contained in the VRT to 
 determine proper
  scaling,
  but I'm not sure if that is sufficient. Are there 
 arguments that need
  to
  be
  placed in the Mapfile metadata to help WMS generation along? Or
  something
  that would cause items in the capabilities document to 
 be left out?
 
  Using QGis 1.7.0 on Linux.
 
  --
  View this message in context:
  
 http://osgeo-org.1803224.n2.nabble.com/QGis-Zoom-to-best-scale
 -Not-Working-tp7017776p7017776.html
  Sent from the Mapserver - User mailing list archive at 
 Nabble.com.
  ___
  mapserver-users mailing list
  mapserver-users@.osgeo
  http://lists.osgeo.org/mailman/listinfo/mapserver-users
  ___
  mapserver-users mailing list
  mapserver-users@.osgeo