Problems with join

Steve Lime steve.lime at DNR.STATE.MN.US
Tue Feb 21 20:44:12 EST 2006


Dennis-Jan: 

The meaningless string is to trick MapServer into doing the query in the first place. A hold over from pre-MapScript days...

> - Does mapserver require a template if I want to use joins?

Yes, joins are a post-query feature (for end display only) and for that reason require the use of query templates. All is not lost... (read on)

> - Is it possible to get the join data without using a template and using  some 
> functions?

Not through MapScript proper- there is no joinObj exposed to MapScript (perhaps there should be). The reason is that the scripting languages supported by MapScript are very well suited database access independent of MapScript. You can certainly take a item value from your result set and use that to construct a query to another datasource. Then those results can be displayed as necessary (or used to create even more queries).

I'm not terribly familiar with p.mapper so I don't know how hard it is to do that sort of thing using that framework. I also thought that template processing was available via MapScript, but perhaps not through p.mapper?

Wish I had better news.

Steve

>>> DJ Broerse <dennisjan at ibuildings.nl> 02/21/06 4:52 AM >>>
Hi list and Steve

List: thanks or the replies.  Now I probably know what the problem is.
Steve: below there is a description of my problem.

I think the bottleneck in my problem are the templates. I use Pmapper as 
a graphical interface and MapServer is the engine.
Pmapper doesn't care about the templates in the mapfile. That's the 
reason why there is a meaningless string after the template key in the 
mapfile (without this meaningless string there are no results)
Pmapper gets his results by using the following functions

$qRes = $this->qLayer->getResult($iRes);

$qShape = $this->qLayer->getShape($qRes->tileindex,$qRes->shapeindex);

$this->tempGridResult .= $this->printGridResultRow($qShape);


So I have another set of questions:
- Does mapserver require a template if I want to use joins?
- Is it possible to get the join data without using a template and using 
some functions?

Thanks in advance,

Dennis-Jan

DJ Broerse wrote:
> I have two dfb files: gbkn-philippine and eigenaren
> The reference is gbkn-philippine.willekeur and eigenaren.aa_linkid
> What I want is if I query the the layer then I like to see the data of 
> eigenaren.dbf .
> I can't figure out what is wrong.
> Maybe I have to use CONNECTION or CONNECTIONTYPE but I don't know what.
> TEMPLATE isn't necessary  because I use a one-to-one relation I think.
>
> I really hope you can help me
>
> Dennis-Jan
>
>  LAYER
>
>    NAME "gbkn-philippine"
>
>    TYPE line
>
>    STATUS ON
>
>    DATA "join/gbkn-philippine"
>
>    MAXSCALE 25100
>
>    METADATA
>
>      "DESCRIPTION" "gbkn-philippine"
>
>    END  # Metadata
>
>    JOIN
>
>     NAME "join1"
>
>     TABLE "gisdata/join/eigenaren.dbf"
>
>     FROM "WILLEKEUR"
>
>     TO "AA_LINKID"
>
>     TYPE ONE-TO-ONE
>
>    END
>
>    CLASS
>
>      Name "gbkn-philippine"
>
>      COLOR 249 49 249
>
>        TEMPLATE queryzichtbaar
>
>      SYMBOL "vet"
>
>      SIZE 2
>
>    END  # Class
>
>  END  # Layer
>   
> Hey Steve


-- 
DJ Broerse dennisjan at ibuildings.nl
Direct: 0118 42 95 68 Mobiel: 06 48 01 03 08
Skype: callto://dennisjan-ibuildings
Ibuildings.nl BV - Information technology
http://www.ibuildings.nl - 0118 42 95 50



More information about the mapserver-users mailing list