Configuration example
<config xmlns="http://software.in2p3.fr/lavoisier/config.xsd" version="16"> <view name="parks_wfs"> <info> <category>demo</category> </info> <connector type="HTTPConnector"> <parameter name="url">https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&REQUEST=GetFeature&version=1.1.0&TYPENAME=pvo_patrimoine_voirie.pvoparking</parameter> </connector> <processors> <processor type="TransformProcessor" match="//*"> <parameter name="template" eval="document('demo/wfs.xml')"/> </processor> <processor type="InsertProcessor" match="/parks/park/coordinates[text()]"> <parameter name="nodes" eval="new_attribute('lat', substring-before(text(),' ')) | new_attribute('lng', substring-after(text(),' '))"/> </processor> </processors> </view> <view name="parks"> <info> <category>demo</category> </info> <connector type="HTTPConnector"> <parameter name="url">https://download.data.grandlyon.com/kml/grandlyon/?request=layer&typename=pvo_patrimoine_voirie.pvoparking</parameter> </connector> <serializer type="ZipSerializer"/> <processors> <processor type="TransformProcessor" match="//*"> <parameter name="template" eval="document('demo/kml.xml')"/> </processor> <processor type="InsertProcessor" match="/parks/park/coordinates[text()]"> <parameter name="nodes" eval="new_attribute('lat', substring-after(text(),',')) | new_attribute('lng', substring-before(text(),','))"/> </processor> </processors> <cache type="FileCache"> <trigger type="ViewCreatedTrigger" ignore-during="PT1H"/> <trigger type="ViewNotifiedTrigger"/> </cache> </view> <view name="park"> <info> <category>Main</category> <description>Plan route to a selected parking close to your destination (in Lyon city)</description> </info> <argument name="destination"/> <argument name="distance">400</argument> <variable name="angle" eval="$distance * 360 div 40075000"/> <connector type="HTTPConnector"> <parameter name="url" eval="concat('http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=', translate($destination,' ','+'))"/> </connector> <validator type="PathValidator"> <parameter name="path">/GeocodeResponse/result</parameter> <parameter name="message" eval="concat('Unknown location: ', $destination)"/> </validator> <processors xmlns:math="http://exslt.org/math"> <processor type="ElementToAttributeProcessor" match="/GeocodeResponse/result/geometry/location"/> <processor type="InsertProcessor" match="/GeocodeResponse/result/geometry/location"> <parameter name="nodes" eval="view('parks')"/> </processor> <processor type="InsertProcessor" match="/GeocodeResponse/result/geometry/location/parks/park/coordinates"> <parameter name="nodes" eval="new_attribute('Distance', math:sqrt(math:power(ancestor::location/@lat - @lat, 2) + math:power(ancestor::location/@lng - @lng, 2)))"/> </processor> <processor type="RemoveProcessor" match="/GeocodeResponse/result/geometry/location/parks/park[coordinates/@Distance > $angle]"/> </processors> <pre-renderers> <title>'Car Park Coordinates'</title> <field>/GeocodeResponse/result/geometry/location/@lat</field> <field>/GeocodeResponse/result/geometry/location/@lng</field> <row foreach="/GeocodeResponse/result/geometry/location/parks/park/coordinates"> <column>ancestor::park/name</column> <column label="Latitude">(round(@lat*100000) div 100000)</column> <column label="Longitude">(round(@lng*100000) div 100000)</column> <column unit="degrees">@Distance</column> </row> </pre-renderers> <renderers> <renderer type="JSONRenderer"> <parameter name="texts"> <entry>status</entry><entry>type</entry><entry>formatted_address</entry> <entry>long_name</entry><entry>short_name</entry><entry>name</entry> <entry>location_type</entry><entry>lat</entry><entry>lng</entry><entry>place_id</entry> </parameter> <parameter name="skip"> <entry key="parks">none</entry> </parameter> <parameter name="arrays"> <entry>address_component</entry> <entry>type</entry> <entry>park</entry> </parameter> </renderer> <renderer type="CsvRenderer"> <parameter name="separator">;</parameter> </renderer> <renderer type="DefaultRenderer"> <parameter name="template">html/parking.html</parameter> </renderer> <renderer type="HTMLRenderer"> <parameter name="template">html/parking.html</parameter> </renderer> <renderer type="ChartRenderer"> <parameter name="axis">polar</parameter> </renderer> </renderers> </view> </config>