How to write an address search plugin?

المشرف العام

Administrator
طاقم الإدارة
I am migrating some users from MapInfo to QGIS, and before they sign off on it, they want a very simple address search in the same way that we currently have one working in MapBasic. I;ve been having a look around, but can;t seem to get my head around modifiying the quick find and find by attribute plugins which already exist.

Essentially they currently have the following:A mapbasic routine which presents the user with portions of the address which they can fill in

Such as

field 1: Building name/numberfield 2: Street Namefield 3: Localityfield 4: Townfield 5: PostcodeThe process then queries a specific layer using like statements, returns a list of matching records which when clicked zoom to the relevant address.

They are adamant that using the QGIS query builder is going to be 'too complicated' for these users and want me to simplify the process in QGIS to a similar one to the above.

So we have a vector layer containing addresses available in the project - is it possible to mirror this MapInfo functionality - and if so, can anyone provide me with some guidance or point to a tutorial for doing this type of task.

Edit: 15:22 11/06/2013

To Clarify:The addresses are held in a MapInfo tab file, which is loaded in to the project. All of the fields that would be queried are of type string - there is an additional useful field called searchAddr which has field 2, 1 and 3 concatenated (split by commas). The data also contains the coordinates as integers for each location.

So in terms of code (hopefully, if I use how it works in SQL to explain that will make it clear), we would be doing soemthing like:

Select * from where searchAddr like '%%' and searchAddr like'%%' and searchAddr like '%%' and Town like '%%' and Postcode like '%%'Therefore if the user puts in 42 as the House Number in field 1 and postcode AB12 3CD in field 5 the query would be

Select * from where searchAddr like '%42%' and searchAddr like'%%' and searchAddr like '%%' and Town like '%%' and Postcode like '%AB12 3CD%'

أكثر...
 
أعلى