[ka-Map-users] Mapscript Okay in MapServer, Breaks kaMap

C.C. Miller ccmiller at purdue.edu
Wed Sep 5 11:47:55 EDT 2007


Zak, thanks. I responded to this on July 13th but I don't see it in  
the archives. Reply reproduced here:

Here's the relevant section of the .map file as it sits statically on  
disk:
#--------------------------------------------
LAYER ###
  GROUP 'Vulcan Grids'
  NAME '10k Grid'
  TEMPLATE 'County_query.html'
CONNECTIONTYPE POSTGIS
CONNECTION "host=localhost dbname=test user=xxxx password=xxxx  
port=5432"
DATA "the_geom from (select the_geom,i,j,icell,jcell,val,log(val) as  
lgval from vulcan.k10m inner join vulcan.baj_area_2002 on  
(k10m.i=baj_area_2002.icell) and (k10m.j=baj_area_2002.jcell) where  
val>0) as foo using unique the_geom"
  STATUS on
  TYPE Polygon
  TRANSPARENCY 50
  TOLERANCE 5
  TOLERANCEUNITS pixels
  LABELITEM 'lgval'


METADATA ###

   WMS_SRS  "epsg:4326"
   WMS_TITLE "WMSTitel"
   WMS_FEATURE_INFO_MIME_TYPE "text/html"
   "queryable" "false"
   "searchfield" "lgval"
   "fields" "lgval:Value"

END ###metadata

END ###layer
#--------------------------------------------

And then the piece of mapscript that alters it...

#--------------------------------------------
$queryFull = 'the_geom from (select the_geom,i,j,icell,jcell,val,log 
(val) as lgval from vulcan.k10m inner join vulcan.'.$qtable.' on  
(k10m.i='.$qtable.'.icell) and (k10m.j='.$qtable.'.jcell) where  
val>0) as foo using unique the_geom';

$map_path="/unix/style/path/to/kaMapFiles/";
$map = ms_newMapObj($map_path."vulcanDuo.map");
$map->setSize($isize, $jsize); //override image size
$layer=$map->getLayerByName("10k Grid");
$layer->set("data",$queryFull);
$layer->set("transparency",80);

//new class
$cl1 = ms_newClassObj($layer);
$cl1->set('name', 'V Class');
$cl1->setExpression('([lgval] >= 0)');
//new style
$st1 = ms_newStyleObj($cl1);
$st1->set('angle','');
$st1->set('symbol','0');
//make pretty colors
$st1->color->setRGB(66,127,178);
$st1->outlinecolor->setRGB(3,3,3);
$st1->set('antialias', 'true');
$st1->set('width', '1');
#--------------------------------------------

And nothing else, so far as I can tell, is relevant.


On Jul 13, 2007, at 1:36 PM, Zak James wrote:

> ka-Map makes some changes to the state of mapfiles as they are loaded
> so it is possible those modifications aren't mixing well with your
> own. Can you post what changes you're trying to apply?
>
> zak
>
> On 7/13/07, C.C. Miller <ccmiller at purdue.edu> wrote:
>> I have no problem changing .map file elements on the fly with php  
>> mapscript,
>> including CLASS and STYLE tags and even the DATA query of a  
>> postgis db.
>> MapServer will make the proper adjustments to the .map file and  
>> spit out an
>> image that is changed as such. I'm also able to render a proper- 
>> looking
>> image with shp2img on a copy of the mapfile, also changed as such  
>> (that is,
>> I have the mapscript-generated .map saving out as a file that I  
>> then use as
>> an input parameter to shp2img). My problem comes when I do this  
>> from within
>> kaMap, where the only layer that won't be rendered into the tile  
>> cache is
>> the one I'm changing with Mapscript. The tiles get generated, of  
>> course, but
>> they're blank.
>>
>> Can anybody think off-hand what I'm doing wrong or how to get  
>> around this so
>> that on-the-fly alterations to the .map file will be adhered to by  
>> kaMap and
>> rendered into the cache?
>>
>> Thanks,
>> Chris
>>
>>
>> C.C. Miller
>> GIS Librarian
>> Assistant Professor of Library Science
>> Purdue University Libraries
>>
>> feed://www4.lib.purdue.edu/gis/rss.php
>>
>> ccmiller at purdue.edu
>> 765.496.9474
>> AIM=cecmcgee
>> Skype=cecmcgee
>> Jabber=ccmiller at purdue.edu
>>
>> 2215E EAS (CIVL)
>> Earth & Atmospheric Sciences Library (EAS)
>> Civil Engineering Building (CIVL)
>> 550 Stadium Mall Drive
>> West Lafayette, IN 47907-2051
>>
>>
>> _______________________________________________
>> ka-Map-users mailing list
>> ka-Map-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>
>>
>
>
> -- 
> Zak James
> Applications and Software Development
> DM Solutions Group Inc.
> http://www.dmsolutions.ca
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users



More information about the ka-Map-users mailing list