[mapserver-users] Mapserver JOIN to html template

Marco Afonso mafonso333 at gmail.com
Thu Mar 10 12:37:29 PST 2016


Hi,

If you use views in PostgreSQL to join the tables, you may not need go use
the Join in mapfile.
Em 10/03/2016 18:48, "Pierre-Étienne Lord" <pe_lord at yahoo.ca> escreveu:

> Hi everybody, it's my first question ever on this list.
>
> <mapserver-users%40lists.osgeo.org>
> Some facts before
>
> I'm running Mapserver 6.2.1  (old vm machine)
> Postgres 9.3.6 with postgis 2.1.7
> Postgres is listening all IP and accept all incoming IP. pg_hba.conf an
> postgresql.conf
> Publishing succesfully multiple layers base on Postgis and everything seem
> to be ok.
>
> I try to make a template presenting ONE-TO-MANY content from PG to PG.(
> http://mapserver.org/mapfile/join.html)
> My ONE part is my geometry and is published in WMS
> My MANY is an associated table.
> My key between my 2 tables is a unique string (21) named geocode
> Both have PK.
>
>
> Here my problem.
>
> On getfeatureinfo, it is suppose to return a html mime type for my
> template. Header, central (MANY) and FOOTER.
> When I call the same dataset in DBF, the getfeatureinfo is returned
> properly.
> When I call the same dataset in postgres, the getfeatureinfo is NOT
> returned properly.
> I think that my connection is well done by connection string because if I
> change table or column name to a not existing one, MapServer raise an error.
>
>
> This example don't work properly.
>
> TEMPLATE "oneToMany.html"
> HEADER "oneToMany_header.html"
> FOOTER "oneToMany_footer.html"
>
> JOIN
>         NAME 'ieqm'
>         CONNECTIONTYPE postgresql
>         CONNECTION "host=XX.XX.XX.XX port=XXXX user=PG password=PGPWD
> dbname=BDX"
>         TABLE 'table_150513"
>         FROM 'geocode'
>         TO 'geocode'
>         TYPE ONE-TO-MANY
>         TEMPLATE 'oneToMany_join.html'
>     END
>
>
>
> This example work properly.
>
> TEMPLATE "oneToMany.html"
> HEADER "oneToMany_header.html"
> FOOTER "oneToMany_footer.html"
>
> JOIN
>         NAME 'ieqm'
>         TABLE "table_150513.dbf"
>         FROM 'geocode'
>         TO 'geocode'
>         TYPE ONE-TO-MANY
>         TEMPLATE 'oneToMany_join.html'
>     END
>
>
> Thanks!
>
> Pierre-Étienne Lord
>
>
> <https://outlook.mrnf.gouv.qc.ca/owa/redir.aspx?SURL=YaZ5UYf2IPMJv7ADsBDnNhbct83j8H_NQZOvg_R1SvvMdStAFEnTCG0AYQBpAGwAdABvADoAcABpAGUAcgByAGUALQBlAHQAaQBlAG4AbgBlAC4AbABvAHIAZABAAG0AZgBmAHAALgBnAG8AdQB2AC4AcQBjAC4AYwBhAA..&URL=mailto%3apierre-etienne.lord%40mffp.gouv.qc.ca>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160310/a8a3b653/attachment.html>


More information about the mapserver-users mailing list