Hi, This is something I find useful to share with others. Thanks to Zoltan, I have been able to solve my issue with following:
I have polygon shape file representing land parcels. Each parcel has its number defined in associated dbf file. Besides, there is data stored in MySQL table representing (among the other useful data) parcel owners. The relationship between the shape data and MySQL data is obviously one-to-many, as one parcel can have more than one owners. To show the correct result table I have slightly modified printFields function (long time ago) and Zoltan made similar modification recently (and published the patch on the list at October, 17th). So this works correctly. My next issue was to enable search by attribute stored in MySQL table, for example by parcel owner. Due to limitations in joining external database tables to layers using PEAR (http://svn.pmapper.net/trac/wiki/DocManual?version=77#JoiningDatabasetablestolayers, "limitations" part) I couldn't done it easily. So, thanks to Zoltan suggestions, I did the following: 1. I have imported my parcel shape file into PostGIS 2. I have imported parcel owners data from MySQL to PostGIS 3. Instead of using PEAR, I have defined my layer source data as: CONNECTIONTYPE POSTGIS CONNECTION "dbname=db_name user=db_username password=db_password" DATA "the_geom from (select parcel.gid, parcel.the_geom, parcel.number, owners.owner_name from parcel join owners on parcel.number = owners.number) as subquery using unique gid srid=31275" The interesting part is "gid". Because the rows belonging to the same parcel have the same gid ("using unique gid" in query) the result table is showing the same owner for all rows. So I modified the query (thanks to Zoltan again :-) like this: DATA "the_geom from (select (parcel.gid*10000+owners.id) as guid, parcel.the_geom, parcel.number, owners.owner_name from parcel join owners on parcel.number = owners.number) as subquery using unique guid srid=31275" Thus, it is using new gid ("guid") that is unique for each parcel-owner pair and the result table is now showing correct data. The multiplicator value (10000) can be some other value (I choosed this one because I have less than 10000 parcels so uniqueness is guaranteed) That's all. regards, dejan ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users