----------------------------------------
> Date: Tue, 30 Sep 2014 00:35:48 +0100
> From: matthewha...@zoho.com
> To: viking-devel@lists.sourceforge.net
> Subject: [Viking-devel] Acquire via datasource with search terms and babel 
> filters
>
>
> Hi,
>
> I was looking in to getting Viking to load OSM POIs into waypoints via the
> File->Acquire-> options. It can already be done reasonably well with the
> current datasources.xml set up, but doesn't allow the option of a user
> specified search term.
>
> I've created a branch called datasource-search at
>
> https://github.com/yourealwaysbe/viking.git
>
> which adds an S to the url_format_code where S represents "search term". If
> an S appears in the url_format_code, it will flash up a text box asking the
> user to enter a term.

This looks good.

I was thinking about adding a 'Query Layer' so you could save such OverPass QL 
queries or even possibly run SQL queries against an OSM Database (notionally 
your own).

Of course using the datasource code is simpler.

Indeed 'S' could represent any user runtime specified String, so calling it 
'Search term' (in the code) is possibly a little too specific.

One may want to use ...node["%s"]... to not limit it to just amenities - then 
you could enter shop=convenience or whatever.

Possibly the UI string displayed could be made XML property too, defaulting to 
'Search term' if nothing is specified, however that is not that important.

It would be good if in the new dialog the text entry widget is given the focus, 
rather than the OK button, thus you start typing straight away. The enter key 
can be made to invoke the accept method. See a_prompt_for_goto_string() in 
vikgoto.c

Also it might be useful to save the last used text (for the Viking session), so 
you can run the query again. Again similar to last_goto_str in vikgoto.c

> Further, as part of this, i've added another property
>
> babel_filter_args
>
> where the user can specify in datasources.xml some command line arguments to
> pass to gpsbabel to refine the output. I have a reason for wanting to do
> this, but will spare you a rambling explanation unless you'd like to hear it
> :)

I'd like to hear it!

You don't use it in the example below.

I don't understand the "%5$s", surely just "%s" is sufficient.

> As an example, you might try adding to your ~/.viking/datasources.xml
>
> <objects>
> <object class="VikWebtoolDatasource">
> <property name="label">OpenStreetAmenity</property>
> <property name="url_format_code">BLTRS</property>
> <property name="file_type">osm</property>
> <property 
> name="url">http://overpass-api.de/api/interpreter?data=[bbox:%s,%s,%s,%s];node[amenity="%5$s"];out%%20center;</property>
> </object>
> </object>
>
> to give you an option to acquire all amenities on OSM of a certain kind
> currently on screen. E.g. enter "cafe" as the search term for all cafes,
> "pubs" for all pubs, and so on. (It's for an improved version of this that
> babel_filter_args comes in to play.)

Note it's just "pub" to get pubs.

In the UK around 10% of pubs are mapped as ways.

> Let me know what you think,

> Best,
>
> Matt
>
>
> ------------------------------------------------------------------------------
> Slashdot TV. Videos for Nerds. Stuff that Matters.
> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
> _______________________________________________
> Viking-devel mailing list
> Viking-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/viking-devel
> Viking home page: http://viking.sf.net/
                                          
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to