[Cartoweb-users] PHP in mapfile

Jacolin Yves yjacolin at free.fr
Wed May 24 07:24:47 EDT 2006


Hi,
Yes ! I missed the autoLayersIndexes = all !

All are ok now, thank you !!

I have some other question linked to this.
First, where in the makemaps.php script the autoLayersIndexes is used ?

And is it possible to create a postgis.php file like this :
LAYER
  NAME $postgis["name"]
  STATUS ON
  TYPE $postgis["type"]
  CONNECTIONTYPE POSTGIS
  CONNECTION 'dbname=edit_db user=postgres password=postgres host=localhost'
  DATA '$postgis["geom"] from (select the_geom, oid, parc_id, name, culture, 
surf, parc_type from edit_poly) as foo'
  TEMPLATE 'ttt'
  LABELITEM "name"
  [..]
  METADATA
[..]
  END
END

And add at the begining of this file, the $postgis array, or to do something 
around this ? Actually I don't know how to send my 'variable' to the script.

My goal is to use my script that retrieve postgis layer and create the 
mapfile. So I can wrote all postgis layers in postgis.php and include it in 
the map.php or just use the autolayers, and this is more funny !

Y.
Le Mercredi 24 Mai 2006 09:33, Yves Bolognini a écrit :
> Hello Yves,
>
> OK I found something.
>
> As I said PHP mapfiles are linked to auto layers. To generate at least
> one true mapfile out of a PHP mapfile, you need to add a
> "autoLayersIndexes" definition in your layers.ini. The minimal
> definition is:
>
> autoLayersIndexes = all
>
> Please also verify that your mapId inside your project is also called
> "script" (it means your path looks like
> "../projects/script/server_conf/script/script.map.php").
>
> Regards,
> Yves
>
> On mar, 2006-05-23 at 17:42 +0200, Jacolin Yves wrote:
> > Hello,
> > Sorry to not posting on the list (the reply button chose only the sender
> > of the mail :-( I will be take care of that.
> >
> > So my project is called "script", the map name (inside the mapfile) is
> > called just 'map'.
> > The includeFile function contained the doublequote (just forget in the
> > mail :-)
> >
> > Regards,
> >
> > Y.
> >
> > Le Mardi 23 Mai 2006 17:28, Yves Bolognini a écrit :
> > > Est-ce que le mapId c'est bien "script" ?
> > > Le mapfile doit impérativement s'appeler <mapId>.map.php.
> > >
> > > De plus, je pense qu'il manque des guillemets autour de postgis.php.
> > >
> > > Merci de répondre sur la mailing list si le problème est résolu.
> > >
> > > Salutations,
> > > Yves
> > >
> > > On mar, 2006-05-23 at 17:09 +0200, Jacolin Yves wrote:
> > > > Hello,
> > > > I got a problem :-)
> > > > I insert this in my script.map.php :
> > > > <?php
> > > >
> > > > includeFile(postgis.php);
> > > >
> > > > ?>
> > > >
> > > > I run php-cgi scripts/makemaps.php
> > > >
> > > > no error message appears but I haven't got my auto.script.all.map
> > > > file ! rights are good :-)
> > > >
> > > > May be I missed something !??
> > > >
> > > > Y.
> > > >
> > > > Le Mardi 23 Mai 2006 16:43, Yves Bolognini a écrit :
> > > > > Hi Yves,
> > > > >
> > > > > PHP mapfiles in CartoWeb are linked to the concept of "auto layers"
> > > > > (see http://cartoweb.org/doc/cw3.2/xhtml/user.layers.html ).
> > > > >
> > > > > To do what you want, you will need to rename your mapfile with
> > > > > extension .map.php instead of .map.
> > > > >
> > > > > Regards,
> > > > > Yves B.
> > > > >
> > > > > On mar, 2006-05-23 at 15:46 +0200, Jacolin Yves wrote:
> > > > > > Hello,
> > > > > >
> > > > > > I would like to create a kind of dynamic mapfile. I mean create a
> > > > > > mapfile from a file tree and to add layers from a postgis DB.
> > > > > >
> > > > > > So one script create the mapfile (and the layers.ini and
> > > > > > outline.ini files) and another one, create a file that contains
> > > > > > LAYER informations from the postgis DB.
> > > > > >
> > > > > > Is it possible to put something like this in the first mapfile :
> > > > > > <?php
> > > > > > include (postgisLayer.php);
> > > > > > ?>
> > > > > > and then create the mapfile final using makemaps.phpat the end of
> > > > > > my script ?
> > > > > >
> > > > > > Y.
> > > > >
> > > > > _______________________________________________
> > > > > Cartoweb-users mailing list
> > > > > Cartoweb-users at lists.maptools.org
> > > > > http://lists.maptools.org/mailman/listinfo/cartoweb-users
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users

-- 
Yves Jacolin
http://yjacolin.gloobe.org
----
Stagaire Conservatoire Régional des Espaces Naturels de la région Centre
http://cahiersnaturalistes.free.fr/cpnrc/
----
- Qu'est-ce que cela peut faire que je lutte pour la mauvaise cause 
puisque je suis de bonne foi?
- Et qu'est-ce que ça peut faire que je sois de mauvaise foi
puisque c'est pour la bonne cause. (Jacques Prévert)

-- 
Yves Jacolin
http://yjacolin.gloobe.org
----
Stagaire Conservatoire Régional des Espaces Naturels de la région Centre
http://cahiersnaturalistes.free.fr/cpnrc/
----
- Qu'est-ce que cela peut faire que je lutte pour la mauvaise cause 
puisque je suis de bonne foi?
- Et qu'est-ce que ça peut faire que je sois de mauvaise foi
puisque c'est pour la bonne cause. (Jacques Prévert)




More information about the Cartoweb-users mailing list