Re: [pmapper-users] Oracle connection - advice needed
Brought to you by:
arminburger
From: Gambin D. <Dej...@pu...> - 2006-11-24 11:52:51
|
Armin, Hi again, I have managed to do something that works at this moment. I would like = to share it with you so you can tell me what you think about it. I have modified the printFields function of squery.php like following: 1. I have realised you were using $loop=3D2. I don't know exactly why = you used the number 2 since you never increased/decreased its value, = only set to zero...but... 2. I have used this to modify the first part setting: if (!$this->one2many) { $dbloop =3D $dbresCount; } else { $loop =3D 1; } instead of just: if (!$this->one2many) { $dbloop =3D $dbresCount; } 2. Then I modified/added: ... while($loop > 0) { ##$this->qStr .=3D "pippo anzahl felder:" . = sizeof($this->selFields); // Add shape index to array, used for highlight //$resultindexes[] =3D $qShpIdx; if ($loop =3D=3D 1) { $this->qStr .=3D "], ["; $this->qStr .=3D ($this->qLayerType !=3D 3 ? = $this->printShapeField($qShape) : "\"r\"");=20 } // Print all OTHER COLUMNS from SHAPE ... That's it. Not ideal, but ok for me at this moment. I have to see how = can I support it in attribute query... regards, dejan > -----Original Message----- > From: Gambin Dejan=20 > Sent: Friday, November 24, 2006 10:06 AM > To: 'pma...@li...' > Subject: RE: [pmapper-users] Oracle connection - advice needed >=20 > nquery works as you said, that was my mistake of not=20 > selecting the correct layer after clicking on "Select" button :-(( >=20 > Since I am not familiar with json and javascript generally,=20 > do you think I could do something in squery.php, specifically=20 > in printFields function by creating a qStr for each row of =20 > "many" data similar to qStr for any other row created by=20 > printResultRow? I hope you understand what I mean :-)) >=20 > regards, dejan >=20 > > -----Original Message----- > > From: Armin Burger [mailto:arm...@gm...] > > Sent: Friday, November 24, 2006 9:39 AM > > To: Gambin Dejan; pma...@li... > > Subject: Re: [pmapper-users] Oracle connection - advice needed > >=20 > >=20 > > > Well, it is working for me but let me explain: > > >=20 > > > I have a polygon shape presenting buildings. There is a > > building ID in > > > the dbf file. Oracle database has a table of locations > > inside the buildings. > > > This table has also a building ID and it holds many locations=20 > > > attributes (area, volume, user, purpose, etc.). I have=20 > tried using=20 > > > one-to-many query in pmapper by joining tha shapefile with > > locations > > > table. And it works..(by identify query). I get for example > > the "area"=20 > > > for each location inside the building. The problem is=20 > that pmapper=20 > > > incorrectly displays all the attributes for one building in > > one row instead of breaking the row for each location. > > > But this can be solved I think. > > >=20 > >=20 > > This is what I meant that 'it's not working'. The result=20 > array for one=20 > > feature contains too many attributes. Ok, you could try in=20 > pmjson.js=20 > > for the result display to check for this and add an=20 > additional row if=20 > > the array of the result feature is longer than the one for=20 > the header.=20 > > The problem is that with the current result structure in the json=20 > > string all results from the join are in the same array, you do not=20 > > know > > when one ends and the next starts. =20 > >=20 > > In any case you will have to decide how to display such a result.=20 > > Having one building eg. appearing multiple times with all=20 > the common=20 > > attributes and the zoom button, just because of additional=20 > attributes,=20 > > might not look very intuitive and logical to users and one might at=20 > > first glance see them as separate buildings. > >=20 > >=20 > > > So now I am confused about what you said. I really need=20 > to do this=20 > > > type of join and I will gladly contribute to make it working=20 > > > correctly. For now I am planning to solve the "one row"=20 > displaying=20 > > > problem and maybe support nquery (it is not working of > > course). Also, > > > I didn't try with attribute query yet. > > >=20 > >=20 > > I wonder why nquery or search should not work, they should be=20 > > identical for the display as normal query. > >=20 > > armin > > -- > > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!=20 > > Ideal f=FCr Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > >=20 >=20 |