[mapserver-users] mapsript legend

2011-08-18 Thread Chris Green
Hi all

 

I have a map created via Mapscript under Mapserver 6.0 but I can't find a
way to add a legend. Recent examples are hard to find but I found the
following dating from 2002 which seemed simple enough:

 

 

  $legend = $map-legend;

  $legend-set(width,40);

  $legend-set(height,100);

  $legend-imagecolor-setRGB(240,220,200); # tan

  $legend-outlinecolor-setRGB(1,1,1); # black

  $legend-set(status, MS_EMBED);

  $legend-set(position, MS_UL);

  // SET LEGEND LABEL PROPERTIES

  $lg_label = $legend-label;

  $lg_label-set(font, arial);

  $lg_label-set(type, MS_TRUETYPE);

  $lg_label-set(size, 10);

  $lg_label-set(minsize, 6);

  $lg_label-set(maxsize, 12);

  $lg_label-color-setRGB(100,100,100);

  $legend-set(postlabelcache, MS_TRUE);

  // DRAW LEGEND

  $legendImage=$map-drawLegend();

 

Unfortunately this produces no output. Can anyone give me any clues why?

 

 

Chris

 

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


Re: [mapserver-users] Invalid pdf file from WMS

2011-08-18 Thread thomas bonfort
this seems to be a cairo/pdf issue, as the cairo/png works fine:
http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERVICE=WMSVERSION=1.1.1WIDTH=1728HEIGHT=1324LAYERS=defaultTRANSPARENT=TRUEFORMAT=cairopngBBOX=3409763.750050978,6956187.032331026,3411904.266676571,6957827.104097395SRS=EPSG:2393STYLES=

what cairo version are you using? can you upgrade it?

--
thomas

On Wed, Aug 17, 2011 at 22:46, Rahkonen Jukka jukka.rahko...@mmmtike.fi wrote:
 Hi,

 Amazing. I got this

 (gdb) bt
 #0  0x0013a258 in FT_Done_Face () from /usr/lib/libfreetype.so.6
 #1  0x00f447c3 in ?? () from /usr/lib/libcairo.so.2
 #2  0x00f4ba19 in cairo_font_face_destroy () from /usr/lib/libcairo.so.2
 #3  0x0813a8b4 in ?? ()
 #4  0x0813a9c8 in cleanupCairo ()
 #5  0x080c5aee in ?? ()
 #6  0x0810b406 in ?? ()
 #7  0x0807207d in ?? ()
 #8  0x0805c2f4 in ?? ()
 #9  0x00fefbd6 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
 #10 0x08057881 in ?? ()

 -Jukka-
 
 Lähettäjä: thomas bonfort [thomas.bonf...@gmail.com]
 Lähetetty: 17. elokuuta 2011 22:56
 Vastaanottaja: Rahkonen Jukka
 Kopio: mapserver-users@lists.osgeo.org
 Aihe: Re: [mapserver-users] Invalid pdf file from WMS

 if gdb is installed on the system, you do:

 gdb /path/to/mapserv
 $ run QUERY_STRING='map=...'
 (...program runs and spits out the beginning of the pdf..., then segfaults)
 $ bt

 --
 thomas

 On Wed, Aug 17, 2011 at 21:36, Rahkonen Jukka jukka.rahko...@mmmtike.fi 
 wrote:
 Hi,

 Command with big BBOX does lead into segmantation fault.  Unfortunately I am 
 just an amateur and I have no idea about what is a backtrace and how I could 
 provide it to you. The server is a virtual Linux box (Ubuntu).

 -Jukka Rahkonen-

 thomas bonfort wrote:

 the second one is incomplete, the request seems to be failing.

 can you run the request locally to see if it segfaults, and if so
 provide a backtrace:

 /path/to/mapserver-cgi
 QUERY_STRING='map=/path/to/mapREQUEST=GetMapSERVICE=WMSVERSION=1.1.1WIDTH=864HEIGHT=662LAYERS=defaultTRANSPARENT=TRUEFORMAT=application/x-pdfBBOX=3409763.750050978,6956187.032331026,3411904.266676571,6957827.104097395SRS=EPSG:2393STYLES='

 --
 thomas

 On Wed, Aug 17, 2011 at 15:40, Rahkonen Jukka jukka.rahko...@mmmtike.fi 
 wrote:
 Hi,

 This request from Mapserver 6.0 gives me a nice pdf file:
 http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERVICE=WMSVERSION=1.1.1WIDTH=864HEIGHT=662LAYERS=defaultTRANSPARENT=TRUEFORMAT=application/x-pdfBBOX=3409763.750050978,6956187.032331026,3411904.266676571,6957827.104097395SRS=EPSG:2393STYLES=

 However, if I double the bounding box the resulting pdf cannot be opened by 
 Acrobat reader.
 http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERVICE=WMSVERSION=1.1.1WIDTH=1728HEIGHT=1324LAYERS=defaultTRANSPARENT=TRUEFORMAT=application/x-pdfBBOX=3409763.750050978,6956187.032331026,3411904.266676571,6957827.104097395SRS=EPSG:2393STYLES=

 The latter gives fine image with format=image/png. Any idea about what is 
 going wrong?

 -Jukka Rahkonen-___
 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] Invalid pdf file from WMS

2011-08-18 Thread Rahkonen Jukka
Hi,

I believe I istalled Mapserver by doing something like
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
  sudo apt-get update
  sudo apt-get install cgi-mapserver mapserver-bin

If I can upgrade cairo, it depends on what you mean with can :) I have enough 
rights for the server to do it but I have used very very little Linux and do 
not know how to do it. But I am able to copy provided commands like in the 
successful gdb case.

-Jukka Rahkonen-

thomas bonfort wrote:
 
 this seems to be a cairo/pdf issue, as the cairo/png works fine:
 http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERV
ICE=WMSVERSION=1.1.1WIDTH=1728HEIGHT=1324 
LAYERS=defaultTRANSPARENT=TRUEFORMAT=cairopngBBOX=3409763.
750050978,6956187.032331026,3411904.266676571,6957827.104097395 
SRS=EPSG:2393STYLES=
 
 what cairo version are you using? can you upgrade it?
 
 --
 thomas
 
 On Wed, Aug 17, 2011 at 22:46, Rahkonen Jukka 
 jukka.rahko...@mmmtike.fi wrote:
  Hi,
 
  Amazing. I got this
 
  (gdb) bt
  #0  0x0013a258 in FT_Done_Face () from /usr/lib/libfreetype.so.6
  #1  0x00f447c3 in ?? () from /usr/lib/libcairo.so.2
  #2  0x00f4ba19 in cairo_font_face_destroy () from 
 /usr/lib/libcairo.so.2
  #3  0x0813a8b4 in ?? ()
  #4  0x0813a9c8 in cleanupCairo ()
  #5  0x080c5aee in ?? ()
  #6  0x0810b406 in ?? ()
  #7  0x0807207d in ?? ()
  #8  0x0805c2f4 in ?? ()
  #9  0x00fefbd6 in __libc_start_main () from 
 /lib/tls/i686/cmov/libc.so.6
  #10 0x08057881 in ?? ()
 
  -Jukka-
  
  Lähettäjä: thomas bonfort [thomas.bonf...@gmail.com]
  Lähetetty: 17. elokuuta 2011 22:56
  Vastaanottaja: Rahkonen Jukka
  Kopio: mapserver-users@lists.osgeo.org
  Aihe: Re: [mapserver-users] Invalid pdf file from WMS
 
  if gdb is installed on the system, you do:
 
  gdb /path/to/mapserv
  $ run QUERY_STRING='map=...'
  (...program runs and spits out the beginning of the pdf..., 
 then segfaults)
  $ bt
 
  --
  thomas
 
  On Wed, Aug 17, 2011 at 21:36, Rahkonen Jukka 
 jukka.rahko...@mmmtike.fi wrote:
  Hi,
 
  Command with big BBOX does lead into segmantation fault.  
Unfortunately I am just an amateur and I have no idea about what is  a 
backtrace and how I could provide it to you. The server is 
 a virtual Linux box (Ubuntu).
 
  -Jukka Rahkonen-
 
  thomas bonfort wrote:
 
  the second one is incomplete, the request seems to be failing.
 
  can you run the request locally to see if it segfaults, and if so
  provide a backtrace:
 
  /path/to/mapserver-cgi
  
 QUERY_STRING='map=/path/to/mapREQUEST=GetMapSERVICE=WMSVERS
 ION=1.1.1WIDTH=864HEIGHT=662LAYERS=defaultTRANSPARENT=TRUE
FORMAT=application/x-pdfBBOX= 
3409763.750050978,6956187.032331026,3411904.266676571,6957827.
 104097395SRS=EPSG:2393STYLES='
 
  --
  thomas
 
  On Wed, Aug 17, 2011 at 15:40, Rahkonen Jukka 
 jukka.rahko...@mmmtike.fi wrote:
  Hi,
 
  This request from Mapserver 6.0 gives me a nice pdf file:
  
 http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERV
ICE=WMSVERSION=1.1.1WIDTH=864HEIGHT=662 
LAYERS=defaultTRANSPARENT=TRUEFORMAT=application/x-pdfBBOX
 =3409763.750050978,6956187.032331026,3411904.266676571,6957827
 .104097395SRS=EPSG:2393STYLES=
 
  However, if I double the bounding box the resulting pdf 
 cannot be opened by Acrobat reader.
  
 http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERV
ICE=WMSVERSION=1.1.1WIDTH=1728HEIGHT=1324 
LAYERS=defaultTRANSPARENT=TRUEFORMAT=application/x-pdfBBOX
 =3409763.750050978,6956187.032331026,3411904.266676571,6957827
 .104097395SRS=EPSG:2393STYLES=
 
  The latter gives fine image with format=image/png. Any 
 idea about what is going wrong?
 
  -Jukka Rahkonen-___
  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] using mod_wsgi with mapserver

2011-08-18 Thread Stephan Meißl
Hi Mukesh,

your Python script wsgi-script.wsgi needs to have a method named
application() which needs to accept two parameters and has to return
the response body (see e.g. [1] for details). 

Inside this method you can use MapScript like in the below incomplete
example (see [2] for details):

def application(environ, start_response):
ows_req = mapscript.OWSRequest()
...
mapscript.msIO_installStdoutToBuffer()
dispatch_status = map.OWSDispatch( ows_req )
mapscript.msIO_stripStdoutBufferContentType()
result = mapscript.msIO_getStdoutBufferBytes()
...
return [result]

HTH,
Stephan

[1] http://webpython.codepoint.net/wsgi_application_interface
[2] http://mapserver.org/mapscript/mapscript.html#mapscript-functions


On Wed, 2011-08-17 at 14:59 -0700, Mukesh Subedee wrote: 
 Hi all,
 
 
 I have configured and tested a simple application with mod_wsgi and
 found that its working properly. Now I am trying to use mod_wsgi with
 MapServer. I have configured my Apache virtual host for wsgi as: 
  
 Alias / /home/public_html/wsgi/
 Directory /home/public_html/wsgi
 
 Options ExecCGI Indexes
 DirectoryIndex index.html index.wsgi index.cgi
 
 AddHandler cgi-script .cgi
 
 AddHandler wsgi-script .wsgi
 #AllowOverride None
 
 Order allow,deny
 Allow from all
 /Directory
 
 
 I tried running similarly as python mapscript but could not get the
 result. I could not find any example that uses mod_wsgi with
 mapscript. Anyone have any idea how it can be used? Any working
 example?
 
 
 Thanks,
 ___
 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] WCS GetCoverage responses in multi-part mime format

2011-08-18 Thread Stephan Meißl
Bryan,

from my experience firefox does pretty good with multipart files.
Usually the first part is of type text/xml which is shown in the
browser directly and the second part is opened in an external image
viewer. Unfortunately I don't know a way how to turn multipart of with
WCS 1.1.

However, I do know that in WCS 2.0 you explicitly have to request
multipart files (mediatype=multipart/mixed) which means by default
plain image files are returned. Please note that WCS 2.0 is a fairly new
standard which adopts the new modular specification model of OGC and
some of the extensions are not yet published which might cause some
problems for the time being.

Best regards,
Stephan


On Wed, 2011-08-17 at 17:04 +0200, Bryan Hempen wrote: 
 Hi there!
 
 I am currently setting up a WCS server using MapServer 5.6.5. I am 
 serving hyperspectral images and my goal is to visualize a subset of 
 bands within a BBOX in a webclient. This should work fine if WCS 1.1.0 
 GetCoverage requests would not return results in a multi-part mime 
 format as stated on 
 http://mapserver.org/ogc/wcs_server.html#getcoverage. Browsers can't 
 seem to deal with this type of format.
 
 I can't use WCS 1.0.0 requests because they do not allow for subsetting 
 of bands.
 Since I use MapServer version 5.6.5, WCS 2.0 is not supported, but if a 
 WCS 2.0 (as supported by MapServer 6.x) also returns GetCoverage 
 requests in a multi-part mime format it would be useless for me anyway.
 
 Is there any way to turn off the response of WCS GetCoverage requests in 
 a multi-part mime format in MapServer?
 
 If I upgrade to WCS 2.0, will I still have the same problem?
 
 Or does anyone know how to make a browser visualize the image-part of 
 the reponse? I can't find anything useful on the web.
 
 Thanks for your help,
 Bryan
 
 
 This message and any attachments are intended for the use of the addressee or 
 addressees only. The unauthorised disclosure, 
 
 use, dissemination or copying (either in whole or in part) of its content is 
 not permitted. If you received this message in 
 
 error, please notify the sender and delete it from your system. Emails can be 
 altered and their integrity cannot be guaranteed by   
 
 the sender. 
 
 Please consider the environment before printing this email.
 =
 
 ___
 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] Java Crash

2011-08-18 Thread Stuart . Harlan
I compiled MapServer 6.0.1 on Windows, with threads, and removed the 
components marked unsafe.  I also built the Java Mapscript component, 
targeting the 1.5 JVM.  I can generate a map image, and save it to a file 
using the Java method imageObj.save(filename, map).  However, when I try 
to call imageObj.getBytes, the JVM crashes.  Any ideas?  Thanks.

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


Re: [mapserver-users] Problem GetFeature with geom filter on WFS

2011-08-18 Thread Stéphane Brunner
Hello Steve,

Sorry for the delay. I as on holiday last couple of weeks but the
issue is still a blocker for us.

Your say « PostGIS should be returning an appropriate set of candidate
features » but with our request PostGIS returns only the 100 first
features (a subset of all features) without taking any geographical
aspect into account. MapServer filters them correctly but as we get
only the 100 first results from the DB, we miss many objects and/or
they are not related to the area where we want to apply a geographical
filter. We've done a test on how MapServer handles the 100 first
results and it's working.

We also tested the behavior with a SHP file and it works like a charm,
there is no limitation. For our understanding, there is an issue in
the way mapserver pass the query to PostGIS as there is an
inappropriate LIMIT value in the SQL statement and mapserver doesn't
seem to pass a BBOX in order to prefilter the set in the DB.

Best regards
Stéphane Brunner


2011/7/30 Steve Lime sdl...@gmail.com:
 The filter encoding code only translates certain things into native SQL, the 
 rest is handled in a uniform way within MapServer. Hopefully this will change 
 over time and more processing will be moved to the database but there hasn't 
 been time to do that yet, maybe for 6.2.

 PostGIS should be returning an appropriate set of candidate features for 
 MapServer to perform additional filtering. Shapefiles work the same way. If 
 you look at the SQL executed by Postgres you should see all of the matching 
 features plus a few more.

 Steve

 Sent from my iPad

 On Jul 28, 2011, at 9:18 AM, Stéphane Brunner 
 stephane.brun...@camptocamp.com wrote:

 Hello,

 I log the sql request on spatial filter and I have this:
 select 
 oid,nummer,gemeinde,gueltigkeit,flgrundb,quote,eigentuemer,adresse_lang,encode(ST_AsBinary(ST_Force_2D(geom),'NDR'),'hex')
 as geom,oid from (SELECT oid, t1.geom, t1.nummer, t2.gemeinde,
 t1.gueltigkeit1_txt as gueltigkeit, t2.flgrundb, ((t2.zaehler::text ||
 '/'::text) || t2.nenner::text) AS quote, t2.eigentuemer,
 (((t2.adresse::text || ', '::text) || t2.plz::text) || ' '::text) ||
 t2.ort::text AS adresse_lang FROM av.liegenschaften_liegenschaft_area
 as t1, av.view_gemlis_geomaste_parzelle as t2 WHERE t1.gdid = t2.gdeid
 and t1.nummer = t2.parznr::text) AS foo where geom 
 GeomFromText('POLYGON((62 218000,62 278000,69
 278000,69 218000,62 218000))',-1) limit 100

 I didn't see any postggis filter than I try to do a spatial filter on
 one of the 100 first results
 Than I have a correct result ...

 Than why mapserver doesn't use postgis spatial filter ? Does I miss 
 something ?

 Thank-you in advance
 Stéphane Brunner



 2011/7/26 Stéphane Brunner stephane.brun...@camptocamp.com:
 Hello,

 I just test it with a shape file, and it's working...
 I will investigate a little bit more to know why it's not working with 
 postgres.

 Sincerely
 Stéphane Brunner


 2011/7/25 Steve Lime sdl...@gmail.com:
 Never mind on version, I saw 6.0.0 in the response... ;-) Steve

 On Mon, Jul 25, 2011 at 6:19 AM, Stéphane Brunner
 stephane.brun...@camptocamp.com wrote:

 Hello,

 I have the mapfile [0]. when I done a GetFeature on the nummer [1] I
 have 4 results [2] (with duplicate but it's an other issue).
 When I done a spatial filter [3] I have no results [4] but I should
 have at least one result ...

 Thanks in advance for having a look on this issue.

 Sincerely yours
 Stéphane Brunner

 Following: specified, GetCapabilities [5], describefeaturetype [6].

 mapfile [0]:
 MAP
    NAME map

    EXTENT 62 218000 69 278000

    UNITS METERS
    IMAGETYPE jpeg
    RESOLUTION 72
    DEFRESOLUTION 72
    IMAGECOLOR 255 255 255
    STATUS ON
    FONTSET fonts.conf
    SYMBOLSET symbole.sym
    MAXSIZE 5000

    PROJECTION
        init=epsg:21781
    END

    
    # Used by overlays
    
    OUTPUTFORMAT
        NAME png256
        DRIVER AGG/PNG
        MIMETYPE image/png256
        IMAGEMODE RGBA
        EXTENSION png
        FORMATOPTION INTERLACE=OFF
        FORMATOPTION QUANTIZE_FORCE=ON
        FORMATOPTION QUANTIZE_DITHER=OFF
        FORMATOPTION QUANTIZE_COLORS=256
    END
    OUTPUTFORMAT
        NAME png
        DRIVER AGG/PNG
        MIMETYPE image/png
        IMAGEMODE RGBA
        EXTENSION png
        FORMATOPTION INTERLACE=OFF
        FORMATOPTION QUANTIZE_DITHER=OFF
    END

    WEB
        METADATA
            ows_title map
            ows_srs epsg:21781
            ows_encoding UTF-8
            wms_feature_info_mime_type application/vnd.ogc.gml
            wms_enable_request *
            ows_enable_request *
            gml_include_items all
            gml_featureid id
            wfs_title map
            wfs_srs epsg:21781
        END
        IMAGEPATH '/var/tmp/'
    END

    LEGEND
        IMAGECOLOR 240 240 240
        LABEL
            FONT arial
            ANTIALIAS true
            TYPE truetype
            SIZE 9
            COLOR 0 0 0
  

Re: [mapserver-users] Problem GetFeature with geom filter on WFS

2011-08-18 Thread Rahkonen Jukka
Hi,

I agree that if Mapserver is doing the final filtering then passing 
maxFeatures=100 value for the query selecting the candidates is not right.  
But have you tested what happens if you run your WFS query without maxFeatures? 
It would be good to know if the result set is OK then.

-Jukka Rahkonen-

Stéphane Brunner wrote:
 
 Hello Steve,
 
 Sorry for the delay. I as on holiday last couple of weeks but the
 issue is still a blocker for us.
 
 Your say « PostGIS should be returning an appropriate set of candidate
 features » but with our request PostGIS returns only the 100 first
 features (a subset of all features) without taking any geographical
 aspect into account. MapServer filters them correctly but as we get
 only the 100 first results from the DB, we miss many objects and/or
 they are not related to the area where we want to apply a geographical
 filter. We've done a test on how MapServer handles the 100 first
 results and it's working.
 
 We also tested the behavior with a SHP file and it works like a charm,
 there is no limitation. For our understanding, there is an issue in
 the way mapserver pass the query to PostGIS as there is an
 inappropriate LIMIT value in the SQL statement and mapserver doesn't
 seem to pass a BBOX in order to prefilter the set in the DB.
 
 Best regards
 Stéphane Brunner
 
 
 2011/7/30 Steve Lime sdl...@gmail.com:
  The filter encoding code only translates certain things 
 into native SQL, the rest is handled in a uniform way within 
 MapServer. Hopefully this will change over time and more 
 processing will be moved to the database but there hasn't 
 been time to do that yet, maybe for 6.2.
 
  PostGIS should be returning an appropriate set of candidate 
 features for MapServer to perform additional filtering. 
 Shapefiles work the same way. If you look at the SQL executed 
 by Postgres you should see all of the matching features plus 
 a few more.
 
  Steve
 
  Sent from my iPad
 
  On Jul 28, 2011, at 9:18 AM, Stéphane Brunner 
 stephane.brun...@camptocamp.com wrote:
 
  Hello,
 
  I log the sql request on spatial filter and I have this:
  select 
 oid,nummer,gemeinde,gueltigkeit,flgrundb,quote,ei
 gentuemer,adresse_lang,encode(ST_AsBinary(ST_Force_2D(geom
),'NDR'),'hex')
  as geom,oid from (SELECT oid, t1.geom, t1.nummer, t2.gemeinde,
  t1.gueltigkeit1_txt as gueltigkeit, t2.flgrundb, 
 ((t2.zaehler::text ||
  '/'::text) || t2.nenner::text) AS quote, t2.eigentuemer,
  (((t2.adresse::text || ', '::text) || t2.plz::text) || ' 
 '::text) ||
  t2.ort::text AS adresse_lang FROM 
 av.liegenschaften_liegenschaft_area
  as t1, av.view_gemlis_geomaste_parzelle as t2 WHERE 
 t1.gdid = t2.gdeid
  and t1.nummer = t2.parznr::text) AS foo where geom 
  GeomFromText('POLYGON((62 218000,62 278000,69
  278000,69 218000,62 218000))',-1) limit 100
 
  I didn't see any postggis filter than I try to do a 
 spatial filter on
  one of the 100 first results
  Than I have a correct result ...
 
  Than why mapserver doesn't use postgis spatial filter ? 
 Does I miss something ?
 
  Thank-you in advance
  Stéphane Brunner
 
 
 
  2011/7/26 Stéphane Brunner stephane.brun...@camptocamp.com:
  Hello,
 
  I just test it with a shape file, and it's working...
  I will investigate a little bit more to know why it's not 
 working with postgres.
 
  Sincerely
  Stéphane Brunner
 
 
  2011/7/25 Steve Lime sdl...@gmail.com:
  Never mind on version, I saw 6.0.0 in the response... ;-) Steve
 
  On Mon, Jul 25, 2011 at 6:19 AM, Stéphane Brunner
  stephane.brun...@camptocamp.com wrote:
 
  Hello,
 
  I have the mapfile [0]. when I done a GetFeature on the 
 nummer [1] I
  have 4 results [2] (with duplicate but it's an other issue).
  When I done a spatial filter [3] I have no results [4] 
 but I should
  have at least one result ...
 
  Thanks in advance for having a look on this issue.
 
  Sincerely yours
  Stéphane Brunner
 
  Following: specified, GetCapabilities [5], 
 describefeaturetype [6].
 
  mapfile [0]:
  MAP
     NAME map
 
     EXTENT 62 218000 69 278000
 
     UNITS METERS
     IMAGETYPE jpeg
     RESOLUTION 72
     DEFRESOLUTION 72
     IMAGECOLOR 255 255 255
     STATUS ON
     FONTSET fonts.conf
     SYMBOLSET symbole.sym
     MAXSIZE 5000
 
     PROJECTION
         init=epsg:21781
     END
 
     
     # Used by overlays
     
     OUTPUTFORMAT
         NAME png256
         DRIVER AGG/PNG
         MIMETYPE image/png256
         IMAGEMODE RGBA
         EXTENSION png
         FORMATOPTION INTERLACE=OFF
         FORMATOPTION QUANTIZE_FORCE=ON
         FORMATOPTION QUANTIZE_DITHER=OFF
         FORMATOPTION QUANTIZE_COLORS=256
     END
     OUTPUTFORMAT
         NAME png
         DRIVER AGG/PNG
         MIMETYPE image/png
         IMAGEMODE RGBA
         EXTENSION png
         FORMATOPTION INTERLACE=OFF
         FORMATOPTION QUANTIZE_DITHER=OFF
     END
 
     WEB
         METADATA
             ows_title map
             ows_srs epsg:21781
             

[mapserver-users] Map size question?

2011-08-18 Thread Chris Green
After quite a while thinking I could not produce a legend I have realised
that the legend is actually there, just off the edge of my map.

 

Now I see that although my map file specifies a map size of 640 x 480
pixels, if in single tile mode the map image being produced is actually
1110 x 660 pixels. Alternatively with multiple tiles I get 12 tiles of 250 x
250 pixels which is 1024 x 768 pixels.

 

It seems that the size parameter in the map file is being ignored (even
setting the values to 0 0 or omitting the SIZE parameter altogether makes no
difference). MAXSIZE doesn't seem to help either.

 

I can't find a way to get the image size that I want, can anyone help?

 

 

 

Chris

 

 

 

From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Chris Green
Sent: 18 August 2011 08:02
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] mapsript legend

 

Hi all

 

I have a map created via Mapscript under Mapserver 6.0 but I can't find a
way to add a legend. Recent examples are hard to find but I found the
following dating from 2002 which seemed simple enough:

 

 

  $legend = $map-legend;

  $legend-set(width,40);

  $legend-set(height,100);

  $legend-imagecolor-setRGB(240,220,200); # tan

  $legend-outlinecolor-setRGB(1,1,1); # black

  $legend-set(status, MS_EMBED);

  $legend-set(position, MS_UL);

  // SET LEGEND LABEL PROPERTIES

  $lg_label = $legend-label;

  $lg_label-set(font, arial);

  $lg_label-set(type, MS_TRUETYPE);

  $lg_label-set(size, 10);

  $lg_label-set(minsize, 6);

  $lg_label-set(maxsize, 12);

  $lg_label-color-setRGB(100,100,100);

  $legend-set(postlabelcache, MS_TRUE);

  // DRAW LEGEND

  $legendImage=$map-drawLegend();

 

Unfortunately this produces no output. Can anyone give me any clues why?

 

 

Chris

 

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


RE: [mapserver-users] Map size question?

2011-08-18 Thread Fawcett, David (MPCA)
Chris,

If you are in tile mode, I assume that you probably don't want an embedded 
legend on each tile.

Have you thought about doing a separate call/request/object for the legend?

If you were doing this via CGI, I would recommend doing a separate mode=legend 
request.

David.

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Chris Green
Sent: Thursday, August 18, 2011 12:04 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Map size question?

After quite a while thinking I could not produce a legend I have realised that 
the legend is actually there, just off the edge of my map.

Now I see that although my map file specifies a map size of 640 x 480 pixels, 
if in single tile mode the map image being produced is actually  1110 x 660 
pixels. Alternatively with multiple tiles I get 12 tiles of 250 x 250 pixels 
which is 1024 x 768 pixels.

It seems that the size parameter in the map file is being ignored (even setting 
the values to 0 0 or omitting the SIZE parameter altogether makes no 
difference). MAXSIZE doesn't seem to help either.

I can't find a way to get the image size that I want, can anyone help?



Chris



From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Chris Green
Sent: 18 August 2011 08:02
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] mapsript legend

Hi all

I have a map created via Mapscript under Mapserver 6.0 but I can't find a way 
to add a legend. Recent examples are hard to find but I found the following 
dating from 2002 which seemed simple enough:


  $legend = $map-legend;
  $legend-set(width,40);
  $legend-set(height,100);
  $legend-imagecolor-setRGB(240,220,200); # tan
  $legend-outlinecolor-setRGB(1,1,1); # black
  $legend-set(status, MS_EMBED);
  $legend-set(position, MS_UL);
  // SET LEGEND LABEL PROPERTIES
  $lg_label = $legend-label;
  $lg_label-set(font, arial);
  $lg_label-set(type, MS_TRUETYPE);
  $lg_label-set(size, 10);
  $lg_label-set(minsize, 6);
  $lg_label-set(maxsize, 12);
  $lg_label-color-setRGB(100,100,100);
  $legend-set(postlabelcache, MS_TRUE);
  // DRAW LEGEND
  $legendImage=$map-drawLegend();

Unfortunately this produces no output. Can anyone give me any clues why?


Chris

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


Re: [mapserver-users] Java Crash

2011-08-18 Thread Thiago Tiedtke dos Reis
Hi Stuart,

I don't know if are related problems ... This same problem happens with me,
when I trying to build a extension for Tcl without a little patch.

After the patch, the method getBytes then works fine for me...see:

http://trac.osgeo.org/mapserver/ticket/1533

Good lucky!

Thiago Tiedtke dos Reis



2011/8/18 stuart.har...@modot.mo.gov

 I compiled MapServer 6.0.1 on Windows, with threads, and removed the
 components marked unsafe.  I also built the Java Mapscript component,
 targeting the 1.5 JVM.  I can generate a map image, and save it to a file
 using the Java method imageObj.save(filename, map).  However, when I try
 to call imageObj.getBytes, the JVM crashes.  Any ideas?  Thanks.

 Stuart Harlan
 ___
 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] Problem displaying a NAD83 tile in WGS84 (or via WMS)

2011-08-18 Thread Ed Resnick
I have a MrSID file in NAD83 projection (EPGS 4269) which I want to display via 
WMS in WGS84 projection (EPGS 4326). I cannot get this to work.

I have tried setting the entire map-file's projection to 4269, with the extent 
specified in that projection (in meters), and shp2img shows the image, but 
attempting to view it via WMS (requesting the 4326 projection) does not work, 
and the GetCapabilities response file is completely wrong - the 
LatLonBoundingBox tags actually list the 4269 bounding box in meters. Excerpt:

LatLonBoundingBox minx=555230 miny=5.04658e+006 maxx=556972 
maxy=5.04804e+006 /
BoundingBox SRS=EPSG:4269
minx=555230 miny=5.04658e+006 maxx=556972 
maxy=5.04804e+006 /

The BoundingBox is correct; the LatLonBoundingBox obviously is not.

I have also tried specifying 4326 as the map projection and 4269 as the layer 
projection, with the map's extent in lat/lon and the layer's extent as the 
above value (meters). Not only did this not work, but even shp2img just shows a 
blank image. If I change the map's extent to the value in meters (even though 
its projection is specified as 4326), then shp2img works, but the WMS feed 
still does not; the GetCapabilities still is wrong.

Is MapServer simply buggy or is there a 
solution?___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Invalid pdf file from WMS

2011-08-18 Thread Worth Lutz
I can get php MapScript to segfault drawing PDF maps when the same PNG map
works fine.  I had to crank up the allowed memory and allowed time in PHP to
get my maps to work.  I will submit a bug report and test case when I
understand the problem better.  I am trying to develop a method of creating
a large set of PDF maps dynamically with PHP and and am finally figuring it
out.

Worth Lutz



-Original Message-
From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of thomas bonfort
Sent: Thursday, August 18, 2011 3:11 AM
To: Rahkonen Jukka
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Invalid pdf file from WMS

this seems to be a cairo/pdf issue, as the cairo/png works fine:
http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERVICE=WMSVERSIO
N=1.1.1WIDTH=1728HEIGHT=1324LAYERS=defaultTRANSPARENT=TRUEFORMAT=cairop
ngBBOX=3409763.750050978,6956187.032331026,3411904.266676571,6957827.104097
395SRS=EPSG:2393STYLES=

what cairo version are you using? can you upgrade it?

--
thomas

On Wed, Aug 17, 2011 at 22:46, Rahkonen Jukka jukka.rahko...@mmmtike.fi
wrote:
 Hi,

 Amazing. I got this

 (gdb) bt
 #0  0x0013a258 in FT_Done_Face () from /usr/lib/libfreetype.so.6
 #1  0x00f447c3 in ?? () from /usr/lib/libcairo.so.2
 #2  0x00f4ba19 in cairo_font_face_destroy () from /usr/lib/libcairo.so.2
 #3  0x0813a8b4 in ?? ()
 #4  0x0813a9c8 in cleanupCairo ()
 #5  0x080c5aee in ?? ()
 #6  0x0810b406 in ?? ()
 #7  0x0807207d in ?? ()
 #8  0x0805c2f4 in ?? ()
 #9  0x00fefbd6 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
 #10 0x08057881 in ?? ()

 -Jukka-
 
 Lähettäjä: thomas bonfort [thomas.bonf...@gmail.com]
 Lähetetty: 17. elokuuta 2011 22:56
 Vastaanottaja: Rahkonen Jukka
 Kopio: mapserver-users@lists.osgeo.org
 Aihe: Re: [mapserver-users] Invalid pdf file from WMS

 if gdb is installed on the system, you do:

 gdb /path/to/mapserv
 $ run QUERY_STRING='map=...'
 (...program runs and spits out the beginning of the pdf..., then
segfaults)
 $ bt

 --
 thomas

 On Wed, Aug 17, 2011 at 21:36, Rahkonen Jukka jukka.rahko...@mmmtike.fi
wrote:
 Hi,

 Command with big BBOX does lead into segmantation fault.  Unfortunately I
am just an amateur and I have no idea about what is a backtrace and how I
could provide it to you. The server is a virtual Linux box (Ubuntu).

 -Jukka Rahkonen-

 thomas bonfort wrote:

 the second one is incomplete, the request seems to be failing.

 can you run the request locally to see if it segfaults, and if so
 provide a backtrace:

 /path/to/mapserver-cgi

QUERY_STRING='map=/path/to/mapREQUEST=GetMapSERVICE=WMSVERSION=1.1.1WIDT
H=864HEIGHT=662LAYERS=defaultTRANSPARENT=TRUEFORMAT=application/x-pdfBB
OX=3409763.750050978,6956187.032331026,3411904.266676571,6957827.104097395S
RS=EPSG:2393STYLES='

 --
 thomas

 On Wed, Aug 17, 2011 at 15:40, Rahkonen Jukka jukka.rahko...@mmmtike.fi
wrote:
 Hi,

 This request from Mapserver 6.0 gives me a nice pdf file:

http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERVICE=WMSVERSIO
N=1.1.1WIDTH=864HEIGHT=662LAYERS=defaultTRANSPARENT=TRUEFORMAT=applicat
ion/x-pdfBBOX=3409763.750050978,6956187.032331026,3411904.266676571,6957827
.104097395SRS=EPSG:2393STYLES=

 However, if I double the bounding box the resulting pdf cannot be opened
by Acrobat reader.

http://188.64.1.61/cgi-bin/osm-mapserver_i?REQUEST=GetMapSERVICE=WMSVERSIO
N=1.1.1WIDTH=1728HEIGHT=1324LAYERS=defaultTRANSPARENT=TRUEFORMAT=applic
ation/x-pdfBBOX=3409763.750050978,6956187.032331026,3411904.266676571,69578
27.104097395SRS=EPSG:2393STYLES=

 The latter gives fine image with format=image/png. Any idea about what
is going wrong?

 -Jukka Rahkonen-___
 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
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1392 / Virus Database: 1520/3841 - Release Date: 08/17/11

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


Re: [mapserver-users] Problem displaying a NAD83 tile in WGS84 (or via WMS)

2011-08-18 Thread Rahkonen Jukka
Hi,

Could you give a bit more information? Your use case is the most common that 
exists and all instructions should be at 
http://mapserver.org/ogc/wms_server.html
It would be good to see the gdalinfo report of your image and your mapfile and 
the exact WMS request you were using including the WMS version. At least these 
parts of mapfile are important

MAP level: extent, projection and metadata (wms_srs and wms_inable_request at 
least)
LAYER level projection.

I can see some really odd LatLonBoundingBoxes in my own MS 6.0 WMS service too. 
I will investigate them a bit further. If it is just that the Mapserver is 
creating the GetCapabilities document wrong then the WMS service should still 
be usable.

-Jukka Rahkonen-




 -Alkuperäinen viesti-
 Lähettäjä: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Ed Resnick
 Lähetetty: 19. elokuuta 2011 2:47
 Vastaanottaja: mapserver-users@lists.osgeo.org
 Aihe: [mapserver-users] Problem displaying a NAD83 tile in 
 WGS84 (or via WMS)
 
 I have a MrSID file in NAD83 projection (EPGS 4269) which I 
 want to display via WMS in WGS84 projection (EPGS 4326). I 
 cannot get this to work.
 
 I have tried setting the entire map-file's projection to 
 4269, with the extent specified in that projection (in 
 meters), and shp2img shows the image, but attempting to view 
 it via WMS (requesting the 4326 projection) does not work, 
 and the GetCapabilities response file is completely wrong - 
 the LatLonBoundingBox tags actually list the 4269 bounding 
 box in meters. Excerpt:
 
 LatLonBoundingBox minx=555230 miny=5.04658e+006 
 maxx=556972 maxy=5.04804e+006 /
 BoundingBox SRS=EPSG:4269
 minx=555230 miny=5.04658e+006 
 maxx=556972 maxy=5.04804e+006 /
 
 The BoundingBox is correct; the LatLonBoundingBox obviously is not.
 
 I have also tried specifying 4326 as the map projection and 
 4269 as the layer projection, with the map's extent in 
 lat/lon and the layer's extent as the above value (meters). 
 Not only did this not work, but even shp2img just shows a 
 blank image. If I change the map's extent to the value in 
 meters (even though its projection is specified as 4326), 
 then shp2img works, but the WMS feed still does not; the 
 GetCapabilities still is wrong.
 
 Is MapServer simply buggy or is there a 
 solution?___
 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