[Cartoweb-users] edit geometry and insert data with select element

Giovanni Virdis g.virdis at riteco.it
Thu Jun 5 07:54:28 EDT 2008


Hi I have a problem can someone help me?

 

This is my problem

 

I have three table:

 

ppc_funuso 

*	id_funuso --> primary key (numeric)
*	ds_funuso
*	 

ppc_tipesposti

*	id_tipesposti --> primary key (varchar(3))
*	fun_id_funuso --> primary key  and foreign key of ppc_funuso
*	ds_tipesposti

 

ppc_esposti

*	id_esposto --> primary key
*	ds_esposto
*	geometria --> geometry 
*	tpe_id_tipesposti + tpe_fun_id_funuso --> foreign key of
ppc_tipesposti
*	ubicazione
*	n_civico
*	rectal
*	popolazione
*	non_autosuf
*	num_nonautosuf
*	note

 

I have create a layer in my .map file:

 

  LAYER

    NAME "Esposti_PPC"

    STATUS ON

    TYPE POLYGON

    CONNECTIONTYPE POSTGIS

    CONNECTION 'dbname=iwork_ppc user=iwork_ppc password=colapasta
host=10.0.0.3'

    DATA 'geometria from (select geometria, oid, id_esposto, ds_esposto,
ubicazione, n_civico, rectel, popolazione, 

                          non_autosuf, num_nonautosuf, note,
tpe_fun_id_funuso, tpe_id_tipesposti 

                          from ppc_esposti) as foo using unique
"id_esposto" using srid=-1'

    TEMPLATE 'ttt'

    TRANSPARENCY 50

    LABELITEM "ds_esposto"

    CLASS

      NAME "class"

      STYLE

        COLOR 50 50 255

        OUTLINECOLOR 255 50 50

      END

      LABEL

        TYPE TRUETYPE

        FONT "Vera"

        SIZE 7

        COLOR 0 0 0

        POSITION cc

        BACKGROUNDCOLOR 245 235 235

        BACKGROUNDSHADOWCOLOR 55 55 55

        BACKGROUNDSHADOWSIZE 1 1

      END

    END

    LABELMAXSCALE 50000

    METADATA

      'id_attribute_string' 'id_esposto' # query

      'query_returned_attributes' 'ds_esposto, ubicazione, n_civico,
rectel, popolazione, 

                                   non_autosuf, num_nonautosuf, note,
tpe_fun_id_funuso, tpe_id_tipesposti'

      'edit_table' 'ppc_esposti' # PostGIS table

      'edit_geometry_column' 'geometria' # PostGIS geometry column

      'edit_geometry_type' 'polygon' # PostGIS geometry type

      'edit_srid' '-1'

      'edit_attributes'
'id_esposto,ds_esposto|string,ubicazione|string,n_civico|string,rectel|s
tring,popolazione|integer, 

                          non_autosuf|string, num_nonautosuf|integer,
note|string, tpe_fun_id_funuso|integer, tpe_id_tipesposti|string' # list
of the editable fields

      'edit_filter' '' # mapserver filter

    END

  END

 

If is possible when I edit a layer and draw a new geometry in the
relative multirecord to insert the data I want a combobox (select in
html) for insert a value of ppc_funuso and ppc_tipesposti

 

ppc_funuso

 

id_funuso

ds_funuso

0

Strutture abitative private

1

Strutture per l'istruzione 

 

ppc_tipesposti

 

 

id_tipesposti

fun_id_funuso

ds_tipesposti

01

0

Privato

01

1

Nido

02

1

Scuola materna

99

1

Altro

 

 

Example.

 

I draw a new geometry for the selected layer , the system show  the
filed to insert the data of the geometry instead to insert a value 0 and
01,02 etc.. for the field "tpe_fun_id_funuso, tpe_id_tipesposti" I
select the label from select field and the system save in the table the
relative value

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20080605/bf77144a/attachment-0001.html


More information about the Cartoweb-users mailing list