[mapserver-users] Help about MapServer Join ONE-TO-MANY

iomeneandrei aborruso at tin.it
Sun Mar 27 06:56:03 EDT 2011


Dear all,
I'm not able to use templates with MapServer Join ONE-TO-MANY and ITEMQUERY.

I have this kind of CGI query:
http://localhost/cgi-bin/mapserv.exe?map=/servr/map.map&mode=ITEMQUERY&QLAYER=Test&QITEM=COD_PUNTO&QSTRING=COD_3142

This query runs ok and I have the right result. Then I added a JOIN
ONE-TO-ONE to my "Test" layer, and I'm able to query again the layer and
retrieve values from the joined table and render them in my tamplate. I have
used [joinname_columnname] syntax.

I'm not able to have any result if I change the relations to ONE-TO-MANY. I
must use this kind of relation because this is the right one for my data. 
I have read that I must define another template when I define a ONE-TO-MANY,
and this - I think - will render the many results of the join (something
usefull to collect a loop of results). Is it right?

What's the relations between these two templates? Is it automatic, and the
ONE-TO-MANY template is processed and rendered after the layer template? 

This is definition of my layer:

LAYER
    NAME 'Test'
    TYPE POINT
    TEMPLATE "test_t.html"
    DATA './test_quad.shp'
      METADATA
        'qstring_validation_pattern' '.'
      END
    STATUS OFF
    JOIN
      NAME "test"
      TEMPLATE "./loop.html"
      TABLE "./DB_QUADO.dbf"
      FROM "ID"
      TO "IDUTE"
      TYPE ONE-TO-MANY
    END
  END

This is my Layer:
ID: Real (18.0)
COD_PUNTO: String (50.0)  

This is my joined table:
IDUTE: Real (18.0)
VAL: String (254.0)

I would like to have as itemquery result all the records of the joined table
related to my layer table.

This is my layer template:
ID: [ID]

VAL: [test_VAL]


This is my ONE-TO-MANY template:
[test_VAL]


As you see I do not know wher I must insert the call to joined column, and I
have inserted it in both template. Anyway I'm not able to retrieve the value
of VAL column of joined table.

What's wrong in my configuration? What's wrong in my understandig of
ONE-TO-MANY relation?

I'm using MapServer version 5.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG
OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS
SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE

Thank you very much,

Andrea

-----
Andrea Borruso

----------------------------------------------------
email: aborruso at tin.it
website: http://blog.spaziogis.it
my 2.0 life: http://aborruso.spaziogis.it
feed: http://feeds2.feedburner.com/Tanto
38° 7' 48" N, 13° 21' 9" E
----------------------------------------------------
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Help-about-MapServer-Join-ONE-TO-MANY-tp6212126p6212126.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list