Hi,
I am looking into getting support for WFS 2.0 joins in outputs other than GML 3.2, in particular, limited
to this mail, CSV.
Not sure if you know what happens when a join run. For the sake of the example let’s say we are joining
feature types t1, t2, and t3, t1 is the center of the join (the “main” feature) and t2, t3 have join aliases as “a” and “b”
(which might have been assigned by the user, or created internally in case the user did not assign aliases).
When we run the join against the JDBCDataStore we get back a seemingly “normal” feature collection,
made of simple features, t1 type, except that they have two extra attributes, “a” and “b”, containing respectively
a t2 and a t3 feature, the ones joined with t1 in that tuple.
The GML3.2 output knows how to handle this result, and genates Tuple elements containing the 3 feautures,
all at the same level.
All other output formats generate rather funky results, often just adding a and b columns in the output, and doing
a toString() of the features contained in there.
Now… how do we handle this in CSV? Since CSV is flat, no escaping that,
I’m proposing that we do a simple flattenging based on the aliases, that
is, we end up with the following “table”, where tp is the m-th property of the n-th feature type:
t1p1,t1p2,…,t1pn ,a.t2p1,a.t2p2,…a.t2pn,b.t3p1 ,b.t3p2,…,b.t3pn
That is, we prefix by the aliases every type that is not the main one.
This strategy could work for other output formats as well, but for the time being, the interest is restricted to CSV
(more to come later on GeoJSON, where we can generate a tuple like structure instead).
Feedback welcomed
Cheers
Andrea
···
==
Meet us at the INSPIRE Conference in Lisbon 25-29 May 2015! Visit http://goo.gl/WHKDXT for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.