I don't want to bother you more, but... I have set my mapfile with PM_RESULT_DATASUBSTITION, but if I query/search I obtain only one result. I don't see PM_RESULT_DATASUBSTITION in the query code (search.php, query.php and squery.php), so it seems it's rever used during the query phase...
Ok, probably I miss something foundamental of the pmapper logic. I apologize for asking so much... bye, giovanni 2009/12/18 Thomas Raffin <traf...@sirap.fr>: > Hi, > > I mean pmapper will use the "DATA" definition when it needs to draw object > and "PM_RESULT_DATASUBSTITION" definition when it needs to search object > (attributes queries) or show attributes values (results in the table, > iquery, ...). > > So it will draw only one object of your main table witch contains geometry, > but when you will click on 1 object you will get many results (with the same > geometry but different attributes due to the join made in the view). > > G. Allegri a écrit : > > Hi Thomas. it' not clear how DATASUBSTITUTION works. AFAICS it's only > used inside pmap_addResultLayer to retrieve the shapes, so after the > query/select have run. So what you mean with "This way pmapper will > use the DATASUBSTITION when you will search / query objects"? > > thanks again, > giovanni > > 2009/12/17 Thomas Raffin <traf...@sirap.fr>: > > > Hi, > > You should try to define a view that will join the tables (for instance > "SELECT grid.*, rainfall_ts.rainfall FROM grid,rainfall_ts WHERE grid.gid = > rainfall_ts.gid"). > > So you will have 2 ways to use your data in your mapfile : > - DATA "the_geom FROM grid USING UNIQUE gid" --> only 1 object without the > rainfall attribute > - DATA "the_geom FROM your_view USING UNIQUE gid" --> many objects at the > same place with different rainfall values, and surely longer to execute > > What you should do in your mapfile is : > LAYER > METADATA > ..... > PM_RESULT_DATASUBSTITION "the_geom FROM your_view USING UNIQUE gid" > END > DATA "the_geom FROM grid USING UNIQUE gid" > .... > END > > This way pmapper will use the DATASUBSTITION when you will search / query > objects and use DATA when it will draw images. > > > > G. Allegri a écrit : > > Thanks Armin for the quick reply. > The problem is not with the join, my doubt is about how to use it :) > > I have the following structure: > > GRID > ------------------------------------ > | gid | the_geom | > ------------------------------------ > | 1 | MULTYPOLYGON..| > | 2 | MULTYPOLYGON. | > | 3 | MULTYPOLYGON..| > | .... | ..... | > > > RAINFALL_TS > ------------------------------------ > | gid | rainfall | > ------------------------------------ > | 1 | 5 | > | 1 | 10.4 | > | 1 | 1.3 | > | .... | ..... | > > >From the docs it's not clear to me how to query RAINFALL_TS to > retrieve tha unique "gid" values to select/highlight the cells from > GRID... > > I've read: > http://svn.pmapper.net/trac/wiki/FaqConfiguration#Joinstoexternaldatabasetables > http://svn.pmapper.net/trac/wiki/DocManualsearch > > both seem to refer on the reverse need: retrieve attributes from > joined tables, while I need to retrieve the unique gids from them. > > Am I missing something? > I'm sorry if I'm asking stupid questions... > giovanni > > > > > 2009/12/16 Armin Burger <armin.bur...@gmail.com>: > > > On 16/12/2009 20:04, G. Allegri wrote: > > > Hello list. > Before spending too much time on this, I would like to know if the > trunk beta supports this thing: > > I have a big postgis table with a time series (TS) associated with a > polygonal grid layer. For each polygon/cell I have multiple rows in > the TS table. Let's say I have the list od daily rainfall. > I need to let the user query the TS table to see if there is ANY cell > where the daily rainfall have exceeded a certain threshold. > (The truth is that I have many TS tables, coming from different > simulations, and one single vector layer...) > > So, the user should be able to do a Search for Rainfall values higher > then X, and receive all the cells where it happens. > > The actual code seems to offer many ways to deal with multiple joins, > but nothing seems to respond to my need. Am I wrong? Is this already > available or should I code it? > > > There is no special support for joins in Postgis layers in p.mapper, just > use the functionality of the database for all sorts of joins and be aware of > the special settings for this in the DATA parameter map file. I usually use > DB views that do all the join definitions instead of defining the join in > the map file. If the search does exactly what you want I cannot say, but you > can define the full SQL statement in the search definition. Just check the > docs and samples. > > armin > > > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > pmapper-users mailing list > pmapper-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pmapper-users > > > > > > > > > > > ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users