Re: [mapserver-users] Displaying query result on the same page?

2009-04-20 Thread kreshna_icehe...@yahoo.com

Thank you, Steve.

It seems frames and/or AJAX are the only way to display query result on the 
same page when using CGI MapServer, am I correct?

-Kresh


--- On Sun, 4/19/09, Steve Lime steve.l...@dnr.state.mn.us wrote:

 From: Steve Lime steve.l...@dnr.state.mn.us
 Subject: Re: [mapserver-users] Displaying query result on the same page?
 To: mapserver-users@lists.osgeo.org, kreshna_icehe...@yahoo.com
 Date: Sunday, April 19, 2009, 1:48 AM
 For frames you just set the form
 target to the frame of interest. You're code is quite
 close.
 
 Still another option is to use AJAX/AJAST. You issue the
 query via an XMLHttpRequest and get the
 results back in a javascript string or object that you can
 direct the contents of to a container (e.g. div)
 on your page. 
 
 Steve
 
  kreshna_icehe...@yahoo.com
 kreshna_icehe...@yahoo.com
 04/18/09 10:37 AM 
 
 I hope this newbie question doesn't bother you.
 
 See, I want to display query result on my map page, but if
 I use query mode, the query result replaces the whole page.
 
 As workaround, I redirect the query result to a pop-up page
 using the following JavaScript:
 
         function toFrame() {
            if
 (document.mapserv.mode.value ==
  query || document.mapserv.mode.value ==
  nquery) {
              
 document.mapserv.target = _blank;
            } else {
              
 document.mapserv.target = _self;
            }
         }
 
 However, I'd also like to display the query result as part
 of the page (for example, on the lower right of the page),
 without replacing the entire page with the query result.
 
 Is there any way to do such thing using CGI MapServer? Or
 is PHP MapScript the only way to do it?
 
 I'm thinking about using HTML frames, but I'm still at loss
 to redirect the query result to a particular frame.
 
 Many thanks,
 -Kresh
 
 
 
 
       
 ___
 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] MapServer with RHEL5

2009-04-20 Thread Russell McOrmond


  Replying to my own message with further information.  I believe the 
problem we had is very different than the problem that Andreas Eichner 
observed.  Our problem becomes a different thing to check for if you 
notice odd core dumps.


  I also have a request for the mapserver developers so that if someone 
else has a similar problem in the future that mapserver will output 
errors that indicate the problem, rather than core dump.


On Sat, 18 Apr 2009, Russell McOrmond wrote:


I had a problem with GD-2.0.35's configure script not detecting
iconv correctly (see old thread:
http://n2.nabble.com/Confirmation-of-status-of-UTF8-support,-and-where-transcoding-to-Latin-1-may-be-happening.-td1973930.html
The stubs that caused the problem are at
http://cvs.php.net/viewvc.cgi/gd/libgd/src/gdkanji.c?view=markup#l27 ),
so I am compiling 2.0.36RC1.   If I load that version of GD instead of
the 2.0.35 used by the systems people, and otherwise use their binaries
and libraries, I do not get the core dump.


  This morning I used the little test I wrote in the past to check for the 
broken gd.


#include stdio.h
#include /path-to-libiconvs/include/iconv.h
int main() {
 iconv_t cd;
 cd = iconv_open(UTF-8, UTF-16);
 printf(iconv_open returns %d\n\n, (int)cd);
 iconv_close(cd);
 return 0;
}

gcc -L/mapserv/lib/ -lgd -liconv -o gdbroke gdbroke.c

  In the above the iconv.h has to be the one from libiconv, and not the 
one that comes with glibc.  It is only when you use the iconv.h from 
libiconv that this gd bug is tweaked.


  If I run the above with the libgd created by our systems folks, I get:

$ ./gdbroke
iconv_open returns -1

If I run against the gd 2.0.36RC1 I compiled, or with iconv.h so that I 
use the glibc version of iconv, I get:


$ ./gdbroke
iconv_open returns 146702344

(or some other number that isn't -1)

  I have joined the gd-devel mailing list and have asked when 2.0.36 will 
be released, which has this odd issue already resolved.



the strings it was trying to compare were NULL.  I'm also wondering if
it would be worthwhile to have code that in this case would exit
gracefully with an error message rather than core dumping?


  In mapstring.c the common thing to do when iconv_open() returns -1, or 
any other error, is to do an msSetError() and then return NULL from the 
function.


  The problem appears to be that this return code is not checked, and in 
many cases the value is assumed to be a pointer to a string.  If that NULL 
is then used in a manipulation (say, a strdup()) then the program will 
core dump.  We never get to see the error string as the core dump happens 
before the error string is written to the error log.


  There are a number of ways to resolve this.  One is to always return a 
valid string (such as strdup() ) from the function and set a global 
error number instead.  That way functions that don't check the error code 
will simply be manipulating a valid empty string, rather than a null.


  The other is to ensure that any call to a mapstring.c string function 
checks the return code for NULL.  I suspect this will be much more work.


  Thanks.

--
 Russell McOrmond, Internet Consultant: http://www.flora.ca/
 Please help us tell the Canadian Parliament to protect our property
 rights as owners of Information Technology. Sign the petition!
 http://digital-copyright.ca/petition/ict/ http://KillBillC61.ca

 The government, lobbied by legacy copyright holders and hardware
  manufacturers, can pry control over my camcorder, computer,
  home theatre, or portable media player from my cold dead hands!
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Dem classification

2009-04-20 Thread Jeff McKenna




Is there any other options to classify
my dem's colors?


One option is to use MapServer's colorrange ability: 
http://www.mapserver.org/development/rfc/ms-rfc-6.html


-jeff



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


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


Re: [mapserver-users] Painting outside a polygon.

2009-04-20 Thread Christy Nieman

Hi,

You can set the IMAGECOLOR parameter for the map (see 
http://mapserver.org/mapfile/map.html), which sets the background colour 
for the map.  Then your coloured polygons would be drawn on top of the 
background colour.


Regards,
--
Christy Nieman
GIS Technician
DM Solutions Group, Inc.
Email: cnie...@dmsolutions.ca
Web: http://dmsolutions.ca
Web: http://research.dmsolutions.ca

Ernesto Barrera wrote:



Hi there,

I'm dealing with a layer containing polygon data for a given country 
(shapefile).

Color inside the polygon can be easily set via COLOR style parameter.
I'm just looking for a way to apply color to the outside of the 
polygon (i.e.:, paint the surrounding sea in solid blue)


Is there such a method inside Mapserver?
Is there a way to 'reverse' the shapefile to indicate that the wanted 
feature is not inside the boudaries but the complementary area?


Thanks in advance,


PD.: My single layer is like this

LAYER
 NAMEmycountry
 DATA mycountry.shp
 TYPE POLYGON
 STATUS ON
   CLASS
 NAME   boundaries
 STYLE
   COLOR255 0 0   # country area shown in red
 END
   END
END



___
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] Painting outside a polygon.

2009-04-20 Thread Fawcett, David
I am not sure if this meets your case or not.  

If you simply want to set the background color of the map to blue, you
can set IMAGECOLOR 0 0 255 at the map level. (of course, you may want to
pick a nicer shade of blue...)

http://mapserver.org/mapfile/map.html

This will put a blue background behind in the areas not covered by your
polygons.  

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ernesto
Barrera
Sent: Monday, April 20, 2009 8:42 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Painting outside a polygon.




Hi there,

I'm dealing with a layer containing polygon data for a given country 
(shapefile).
Color inside the polygon can be easily set via COLOR style parameter.
I'm just looking for a way to apply color to the outside of the polygon 
(i.e.:, paint the surrounding sea in solid blue)

Is there such a method inside Mapserver?
Is there a way to 'reverse' the shapefile to indicate that the wanted 
feature is not inside the boudaries but the complementary area?

Thanks in advance,


PD.: My single layer is like this

LAYER
  NAMEmycountry
  DATA mycountry.shp
  TYPE POLYGON
  STATUS ON
CLASS
  NAME   boundaries
  STYLE
COLOR255 0 0   # country area shown in red
  END
END
END



___
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] Dem classification

2009-04-20 Thread Dylan Beaudette
You could always apply the elevation classification in a standard GIS
like GRASS, and then save the color-mapped image and use that instead
of the original DEM.

Cheers,

Dylan

On Mon, Apr 20, 2009 at 3:30 AM, leonidas leonidas_lia...@yahoo.gr wrote:

 How can I generate a colormap for my raster (geotiff) dem in a mapfile. I
 have found a way but it's to difficult to generate so much classes and find
 the appropriate colors one by one.
 So my layer in mapfile look like this:
 LAYER
  NAME DEM
  TYPE raster
  STATUS default


  DATA E:\leonidas\dem.tif

  PROCESSING SCALE=-10,2000
  PROCESSING SCALE_BUCKETS=2000



    PROJECTION
    'proj=tmerc'
    'lat_0=0'
    'lon_0=24'
    'k=0.9996'
    'x_0=50'
    'y_0=0'
    'ellps=GRS80'
    'towgs84=-199.87,74.79,246.62,0,0,0,0'
    'units=m'
    'no_defs'
    ''
  END


 CLASSITEM [pixel]

    CLASS NAME '-1,5 - -1 m'  EXPRESSION ( [pixel] = -1.5 AND [pixel]  -1
 )COLOR 26 117 132 END
    CLASS NAME '-1 - -0,5 m'  EXPRESSION ( [pixel] = -1 AND [pixel]  -0.5
 )COLOR 28 126 133 END
    CLASS NAME '-0,5 - 0 m'   EXPRESSION ( [pixel] = -0.5 AND [pixel]  0 )
 COLOR 29 135 134 END
    CLASS NAME ' 0 -  0,5 m'  EXPRESSION ( [pixel] = 0 AND [pixel]  0.5 )
 COLOR 31 144 135 END
    CLASS NAME ' 0,5 - 1 m'   EXPRESSION ( [pixel] = 0.5 AND [pixel]  1 )
 COLOR 33 152 136 END
    CLASS NAME ' 1 - 1,5 m'   EXPRESSION ( [pixel] = 1 AND [pixel]  1.5 )
 COLOR 35 158 137 END
    CLASS NAME ' 1,5 - 2 m'   EXPRESSION ( [pixel] = 1.5 AND [pixel]  2 )
 COLOR 38 163 128 END
    CLASS NAME ' 2 - 2,5 m'   EXPRESSION ( [pixel] = 2 AND [pixel]  2.5 )
 COLOR 44 170 116 END
    CLASS NAME ' 2,5 - 3 m'   EXPRESSION ( [pixel] = 2.5 AND [pixel]  3 )
 COLOR 49 176 104 END
    CLASS NAME ' 3 - 3,5 m'   EXPRESSION ( [pixel] = 3 AND [pixel]  3.5 )
 COLOR 54 183 92 END
    CLASS NAME ' 3,5 - 4 m'   EXPRESSION ( [pixel] = 3.5 AND [pixel]  4 )
 COLOR 60 190 80 END
    CLASS NAME ' 4 - 4,5 m'   EXPRESSION ( [pixel] = 4 AND [pixel]  4.5 )
 COLOR 66 196 68 END
    CLASS NAME ' 4,5 - 5 m'   EXPRESSION ( [pixel] = 4.5 AND [pixel]  5 )
 COLOR 72 203 56 END
    CLASS NAME ' 5 - 6 m'     EXPRESSION ( [pixel] = 5 AND [pixel]  6 )
 COLOR 77 209 44 END
    CLASS NAME ' 6 - 7 m'     EXPRESSION ( [pixel] = 6 AND [pixel]  7 )
 COLOR 83 216 31 END
    CLASS NAME ' 7 - 8 m'     EXPRESSION ( [pixel] = 7 AND [pixel]  8 )
 COLOR 88 222 20 END
    CLASS NAME ' 8 - 9 m'     EXPRESSION ( [pixel] = 8 AND [pixel]  9 )
 COLOR 94 229 8 END
 END # of layer grid1

 I have to do that until 2000m height. Is there any other options to classify
 my dem's colors?
 Thank you, Leonidas
 --
 View this message in context: 
 http://n2.nabble.com/Dem-classification-tp2662869p2662869.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] Displaying query result on the same page?

2009-04-20 Thread Steve Lime
You can probably do it with query/browse templates but the other methods are 
more efficient and provide a better user experience and are easier to configure.

Steve

 On 4/20/2009 at 1:07 AM, in message
860869.57172...@web110602.mail.gq1.yahoo.com, kreshna_icehe...@yahoo.com
kreshna_icehe...@yahoo.com wrote:

 Thank you, Steve.
 
 It seems frames and/or AJAX are the only way to display query result on the 
 same page when using CGI MapServer, am I correct?
 
 -Kresh
 
 
 --- On Sun, 4/19/09, Steve Lime steve.l...@dnr.state.mn.us wrote:
 
 From: Steve Lime steve.l...@dnr.state.mn.us
 Subject: Re: [mapserver-users] Displaying query result on the same page?
 To: mapserver-users@lists.osgeo.org, kreshna_icehe...@yahoo.com 
 Date: Sunday, April 19, 2009, 1:48 AM
 For frames you just set the form
 target to the frame of interest. You're code is quite
 close.
 
 Still another option is to use AJAX/AJAST. You issue the
 query via an XMLHttpRequest and get the
 results back in a javascript string or object that you can
 direct the contents of to a container (e.g. div)
 on your page. 
 
 Steve
 
  kreshna_icehe...@yahoo.com
 kreshna_icehe...@yahoo.com
 04/18/09 10:37 AM 
 
 I hope this newbie question doesn't bother you.
 
 See, I want to display query result on my map page, but if
 I use query mode, the query result replaces the whole page.
 
 As workaround, I redirect the query result to a pop-up page
 using the following JavaScript:
 
 function toFrame() {
if
 (document.mapserv.mode.value ==
  query || document.mapserv.mode.value ==
  nquery) {
  
 document.mapserv.target = _blank;
} else {
  
 document.mapserv.target = _self;
}
 }
 
 However, I'd also like to display the query result as part
 of the page (for example, on the lower right of the page),
 without replacing the entire page with the query result.
 
 Is there any way to do such thing using CGI MapServer? Or
 is PHP MapScript the only way to do it?
 
 I'm thinking about using HTML frames, but I'm still at loss
 to redirect the query result to a particular frame.
 
 Many thanks,
 -Kresh
 
 
 
 
   
 ___
 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] Mapserver

2009-04-20 Thread Jose Antonio Arce

Hi there!

I need your help.

I have installed Mapserver.  I got Ubuntu server running.

In the command line /usr/lib/cgi-bin/mapserv works fine.  But when I try
to run from browser http://server/cgi-bin/mapserv.  It doesn't work.

What can I do to fix this situation.

Thanks,

Jose Arce
from Costa Rica



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


Re: [mapserver-users] Mapserver

2009-04-20 Thread Steve Lime
You'll have to be a bit more specific about It doesn't work., could be a 
number of things.

Steve

 On 4/20/2009 at 3:31 PM, in message 49ecdbbb.9040...@gmail.com, Jose 
 Antonio
Arce joseantonioa...@gmail.com wrote:
 Hi there!
 
 I need your help.
 
 I have installed Mapserver.  I got Ubuntu server running.
 
 In the command line /usr/lib/cgi-bin/mapserv works fine.  But when I try
 to run from browser http://server/cgi-bin/mapserv.  It doesn't work.
 
 What can I do to fix this situation.
 
 Thanks,
 
 Jose Arce
 from Costa Rica
 
 
 
 ___
 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] Painting outside a polygon.

2009-04-20 Thread Trent Erickson


If you are looking to make one specific feature inside a shapefile with 
multiple features clear or transparent you can use the FILTER parameter 
within the LAYER definition. In addition to setting the IMAGECOLOR at 
the map level to the same color as your layer it may give you the 
results you desire.


Following are two examples of using the FILTER parameter to make one 
part of a shapefile layer disappear. It uses a field in the attributes 
called shapeid you could use any field in your shapefile.


# the following will make feature with shapeid 12345 transparent and 
leave the rest of the shapefile with default color rules
FILTER ( [shapeid] != 12345 ) 

# the following variation would use the shapeid= parameter provided in 
the URL of cgi mapserver

FILTER ( [shapeid] != %shapeid% )

-Trent

Ernesto Barrera wrote:



Hi there,

I'm dealing with a layer containing polygon data for a given country 
(shapefile).

Color inside the polygon can be easily set via COLOR style parameter.
I'm just looking for a way to apply color to the outside of the 
polygon (i.e.:, paint the surrounding sea in solid blue)


Is there such a method inside Mapserver?
Is there a way to 'reverse' the shapefile to indicate that the wanted 
feature is not inside the boudaries but the complementary area?


Thanks in advance,


PD.: My single layer is like this

LAYER
 NAMEmycountry
 DATA mycountry.shp
 TYPE POLYGON
 STATUS ON
   CLASS
 NAME   boundaries
 STYLE
   COLOR255 0 0   # country area shown in red
 END
   END
END



___
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] GET parameter in MapServer query

2009-04-20 Thread Hugo Estrada
I am looking for an answer to this same question.

On Fri, Apr 17, 2009 at 4:46 AM, A387 adri.ko...@gmail.com wrote:


 Hi all,

 This is my first post in the mapserver mailinglist.
 I'm having problems with querying Oracle Spatial. For example, this is my
 current query:
 DATA GEOM FROM (SELECT * FROM WIJK_2008 WHERE datum LIKE '%-08') USING
 SRID 28992

 What I want now, is that if I access my file by the following URL, is that
 the LIKE values will be changed by the parameters given in the URL.

 Current:
 http://localhost/cgi-bin/mapserv.exe?map=../../apps/wijk/htdocs/wijk_2008_gen.maplayer=wijkgrenzenmode=mapprogram=../cgi-bin/mapserv.exe

 What I want:

 http://localhost/cgi-bin/mapserv.exe?map=../../apps/wijk/htdocs/wijk_2008_gen.maplayer=wijkgrenzenmode=mapprogram=../cgi-bin/mapserv.exeyear=2008
 .

 Could you give me a heads up, about if this is possible and how to make my
 mapfile dynamically?
 --
 View this message in context:
 http://n2.nabble.com/GET-parameter-in-MapServer-query-tp2644877p2644877.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


[mapserver-users] Re: Return single feature tiles for VE?

2009-04-20 Thread Hugo Estrada
Answering myself: You use variable substitution in FILTER as in

FILTER %foo%

and put the value of foo at the end of the get string.

http://n2.nabble.com/Variable-Substitution-td1987248.html#a1987248


On Mon, Apr 20, 2009 at 4:09 PM, Hugo Estrada hestr...@imapdata.com wrote:

 Hi, there,

 I have successfully created tiles for political districts of Canada for
 Virtual Earth. Now what I need is to be able to get a single district. How
 would I do this?


 I have tried using the CGI variables qitem and qstring, but it doesn't seem
 to do anything.

 Am I missing something?

 Thanks in advance,

 Hugo

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