[QGIS-Developer] Generic use of QgsLocator and friends?

Richard Duivenvoorde rdmailings at duif.net
Wed Oct 11 23:54:06 PDT 2017


Hi Nyall,

First a big Thanks for looking and answering!
I was wondering why nobody was so excited as I was :-)

I agree/can live with most of your clarifications.
Some remarks:

- about the networkaccesmanager-like class (cc'ing to Boundless). I
think that IF we create this, we should do it in 3.0.
But Boundless, let me know if you need help/incentives...
Now for every QgsLocator I have to bring in the NetworkAccessManagerClass?
A QgsLocator Base class (which would for example have these object-type
to scale mapping (ADDRESS=750 etc), or the 'set a label' functionality
would also be in this common classes. If anybody else is interested in
this, please let's discuss and do it.

- about the osm short strings, see in the earlier picture:
http://pix.toile-libre.org/upload/original/1507554555.png
Even in very wide screens, it looks like the result is always using 50%
of the width of the result window. And I'm trying to show the type of
object found and put it in brackets behind the result (eg: address or
road). And in the Nominatim Geocoder result you just siee:
Riouwstraat, Haarlem North Holland, ...
The information I have put in the QgsLocatorResult.displayString
contains more info. As said it looks like the result is always using 50%
of the width of the result window

- about the crashes, is info below helpfull? Else I'll start a session
with gdb. Crux is that I used the offical plugin reloader to reload the
plugin, and clicked on an old result. It is probably the problem that
the cpp world is not aware of the fact that the python world has been
reloaded, and is trying to call some non excisting python signal now or
so? Myself I can 'fix' this by cleaning up the results in the unload of
the plugin (if I can do that via the api...)

Regards,

Richard Duivenvoorde

QGIS died on signal 11[New LWP 2082]
[New LWP 2083]
[New LWP 2084]
[New LWP 2085]
[New LWP 2086]
[New LWP 2087]
[New LWP 2090]
[New LWP 2091]
[New LWP 2092]
[New LWP 2093]
[New LWP 2094]
[New LWP 2329]
[New LWP 2330]
[New LWP 2331]
[New LWP 2332]
[New LWP 2333]
[New LWP 2334]
[New LWP 2335]
[New LWP 2337]
[New LWP 2338]
[New LWP 2339]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f3fbade403a in __GI___waitpid (pid=2343, stat_loc=0x7ffdffb1d194,
options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
29	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
[Current thread is 1 (Thread 0x7f3fc87d1380 (LWP 2081))]
#0  0x00007f3fbade403a in __GI___waitpid (pid=2343,
stat_loc=0x7ffdffb1d194, options=0) at
../sysdeps/unix/sysv/linux/waitpid.c:29
        resultvar = 18446744073709551104
        sc_cancel_oldtype = 0
#1  0x000055d59c111f7a in qgisCrash (signal=11) at
/home/richard/dev/qgis/git/qgis/src/app/main.cpp:323
        status = 32765
        pidstr =
"--pid=2081\000\300?\177\000\000\200\203ҝ\325U\000\000\224z\253\300?\177\000"
        gdbpid = 2343
        exename =
"/home/richard/bin/qgis_all/master/debug/bin/qgis\000ѱ\377\r\000\000\000\350ϱ\377\375\177\000\000\360ϱ\377\375\177\000\000\001.w\235\325U\000\000\001\000\000\000\000\000\000\000Ђ;\243\325U\000\000\240>\271\235\325U\000\000\377\377\377\377\000\000\000\000p縝\325U\000\000\300?\177\000\000\000k\021\236\325U\000\000\000.w\235\325U\000\000\060.w\235\325U\000\000\031\225\343\273?\177\000\000\000\000\000\000\000\000\000\000\230 at g\273?\177\000\000Hѱ\377\375\177\000\000\000;\f\273?\177\000\000\030\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\220"...
        len = 48
#2  <signal handler called>
No locals.
#3  0x0000000000000000 in ?? ()
No symbol table info available.
#4  0x00007f3fc6ef31d3 in QgsLocatorWidget::acceptCurrentEntry
(this=0x55d59e05c030) at
/home/richard/dev/qgis/git/qgis/src/gui/locator/qgslocatorwidget.cpp:331
        index = {r = 18, c = 0, i = 94375961540352, m = 0x55d59e0630d0}
        result = {filter = 0x55d59ec8d650, displayString = {static null
= {<No data fields>}, d = 0x7f3f00005830}, description = {static null =
{<No data fields>}, d = 0x7f3fbbf23360 <QArrayData::shared_null>},
userData = {d = {data = {c = 48 '0', uc = 48 '0', s = -32464, sc = 48
'0', us = 33072, i = 33072, u = 33072, l = 139908559700272, ul =
139908559700272, b = 48, d = 6.9124012907033485e-310, f =
4.63437428e-41, real = 6.9124012907033485e-310, ll = 139908559700272,
ull = 139908559700272, o = 0x7f3f00008130, ptr = 0x7f3f00008130, shared
= 0x7f3f00008130}, type = 8, is_shared = 0, is_null = 0}}, icon = {d =
0x0}, score = 0.5}
#5  0x00007f3fc6ef5501 in
QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>,
void, void (QgsLocatorWidget::*)()>::call(void (QgsLocatorWidget::*)(),
QgsLocatorWidget*, void**) (f=(void
(QgsLocatorWidget::*)(QgsLocatorWidget * const)) 0x7f3fc6ef30c2
<QgsLocatorWidget::acceptCurrentEntry()>, o=0x55d59e05c030,
arg=0x7ffdffb1dae0) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:136
No locals.
#6  0x00007f3fc6ef526d in QtPrivate::FunctionPointer<void
(QgsLocatorWidget::*)()>::call<QtPrivate::List<>, void>(void
(QgsLocatorWidget::*)(), QgsLocatorWidget*, void**) (f=(void
(QgsLocatorWidget::*)(QgsLocatorWidget * const)) 0x7f3fc6ef30c2
<QgsLocatorWidget::acceptCurrentEntry()>, o=0x55d59e05c030,
arg=0x7ffdffb1dae0) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:169
No locals.
#7  0x00007f3fc6ef5095 in QtPrivate::QSlotObject<void
(QgsLocatorWidget::*)(), QtPrivate::List<>, void>::impl(int,
QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1,
this_=0x55d59d98f5e0, r=0x55d59e05c030, a=0x7ffdffb1dae0, ret=0x0) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:120
No locals.
#8  0x00007f3fbbe6497f in QMetaObject::activate(QObject*, int, int,
void**) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#9  0x00007f3fc0cddd95 in QAbstractItemView::activated(QModelIndex
const&) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#10 0x00007f3fc0d25e87 in QTreeView::mouseDoubleClickEvent(QMouseEvent*)
() from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#11 0x00007f3fc0ad96cf in QWidget::event(QEvent*) () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#12 0x00007f3fc0bb82ce in QFrame::event(QEvent*) () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#13 0x00007f3fc0ce9c3b in QAbstractItemView::viewportEvent(QEvent*) ()
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#14 0x00007f3fc0d27d0c in QTreeView::viewportEvent(QEvent*) () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#15 0x00007f3fbbe35a4c in
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#16 0x00007f3fc0a98445 in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#17 0x00007f3fc0aa028f in QApplication::notify(QObject*, QEvent*) ()
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#18 0x00007f3fc4c30a6b in QgsApplication::notify (this=0x7ffdffb1ec30,
receiver=0x55d59e05d7c0, event=0x7ffdffb1e2f0) at
/home/richard/dev/qgis/git/qgis/src/core/qgsapplication.cpp:315
        done = true
        __FUNCTION__ = "notify"
#19 0x00007f3fbbe35d68 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#20 0x00007f3fc0a9f262 in QApplicationPrivate::sendMouseEvent(QWidget*,
QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)
() from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#21 0x00007f3fc0af393b in ?? () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#22 0x00007f3fc0af5faa in ?? () from
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#23 0x00007f3fc0a9846c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#24 0x00007f3fc0a9fd34 in QApplication::notify(QObject*, QEvent*) ()
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#25 0x00007f3fc4c30a6b in QgsApplication::notify (this=0x7ffdffb1ec30,
receiver=0x55d5a31889c0, event=0x7ffdffb1e830) at
/home/richard/dev/qgis/git/qgis/src/core/qgsapplication.cpp:315
        done = true
        __FUNCTION__ = "notify"
#26 0x00007f3fbbe35d68 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#27 0x00007f3fbc7800e0 in
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)
() from /lib/x86_64-linux-gnu/libQt5Gui.so.5
No symbol table info available.
#28 0x00007f3fbc781a25 in
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)
() from /lib/x86_64-linux-gnu/libQt5Gui.so.5
No symbol table info available.
#29 0x00007f3fbc759cab in
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /lib/x86_64-linux-gnu/libQt5Gui.so.5
No symbol table info available.
#30 0x00007f3f9f45c5a0 in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
No symbol table info available.
#31 0x00007f3fb8b09f67 in g_main_context_dispatch () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#32 0x00007f3fb8b0a1a0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#33 0x00007f3fb8b0a22c in g_main_context_iteration () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#34 0x00007f3fbbe8e3ff in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#35 0x00007f3fbbe33dba in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#36 0x00007f3fbbe3cd24 in QCoreApplication::exec() () from
/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#37 0x000055d59c117bc9 in main (argc=1, argv=0x7ffdffb1ffb8) at
/home/richard/dev/qgis/git/qgis/src/app/main.cpp:1345
        profile = 0x55d59d7384e0
        presetStyle = {static null = {<No data fields>}, d = 0x55d59d966600}
        rootProfileFolder = {static null = {<No data fields>}, d =
0x55d59d784ab0}
        myLocaleOverrideFlag = false
        qgistor = <incomplete type>
        w = 600
        mySplashPath = {static null = {<No data fields>}, d =
0x7f3fc52f01c0 <QgsApplication::splashPath()::{lambda()#1}::operator()()
const::qstring_literal>}
        h = 300
        mypSplash = 0x55d59d97fd30
        qgis = 0x55d59db93ea0
        retval = -5112256
        manager = {<QObject> = {<No data fields>}, static
staticMetaObject = {d = {superdata = 0x7f3fbc2e5a00
<QObject::staticMetaObject>, stringdata = 0x7f3fc53e3680
<qt_meta_stringdata_QgsUserProfileManager>, data = 0x7f3fc53e3700
<qt_meta_data_QgsUserProfileManager>, static_metacall = 0x7f3fc5283a70
<QgsUserProfileManager::qt_static_metacall(QObject*, QMetaObject::Call,
int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}},
mWatchProfiles = false, mWatcher = std::unique_ptr<QFileSystemWatcher>
containing 0x0, mRootProfilePath = {static null = {<No data fields>}, d
= 0x55d59d784ab0}, mUserProfile = std::unique_ptr<QgsUserProfile>
containing 0x0, mSettings = std::unique_ptr<QSettings> containing
0x55d59d7847a0}
        profileFolder = {static null = {<No data fields>}, d =
0x55d59d784e10}
        mySettings = {<QObject> = {<No data fields>}, static
staticMetaObject = {d = {superdata = 0x7f3fbc2e5a00
<QObject::staticMetaObject>, stringdata = 0x7f3fc53d4900
<qt_meta_stringdata_QgsSettings>, data = 0x7f3fc53d4940
<qt_meta_data_QgsSettings>, static_metacall = 0x7f3fc526f9a8
<QgsSettings::qt_static_metacall(QObject*, QMetaObject::Call, int,
void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, static
sGlobalSettingsPath = {static null = {<No data fields>}, d =
0x55d59d98d0f0}, mUserSettings = 0x55d59d944f70, mGlobalSettings =
0x55d59d874120, mUsingGlobalArray = false}
        systemEnvVars = {d = 0x55d59d86ad90}
        activeStyleName = {static null = {<No data fields>}, d =
0x55d59d9973c0}
        i18nPath = {static null = {<No data fields>}, d = 0x55d59dbbd2c0}
        myUserLocale = {static null = {<No data fields>}, d =
0x55d59d997360}
        qttor = <incomplete type>
        myApp = {<QApplication> = {<No data fields>}, static
staticMetaObject = {d = {superdata = 0x7f3fc1159020
<QApplication::staticMetaObject>, stringdata = 0x7f3fc53c3920
<qt_meta_stringdata_QgsApplication>, data = 0x7f3fc53c3a80
<qt_meta_data_QgsApplication>, static_metacall = 0x7f3fc52582d6
<QgsApplication::qt_static_metacall(QObject*, QMetaObject::Call, int,
void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, static
QGIS_ORGANIZATION_NAME = 0x7f3fc52ef7c8 "QGIS", static
QGIS_ORGANIZATION_DOMAIN = 0x7f3fc52ef7cd "qgis.org", static
QGIS_APPLICATION_NAME = 0x7f3fc52ef7d6 "QGIS3", static
mFileOpenEventReceiver29900 = 0x55d59db93ea0, static
mFileOpenEventList29900 = {<QList<QString>> =
{<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static
shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> =
{static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0,
begin = 0, end = 0, array = {0x0}}, d = 0x7f3fbbf25960
<QListData::shared_null>}, d = 0x7f3fbbf25960
<QListData::shared_null>}}, <No data fields>}, static mUIThemeName29900
= {static null = {<No data fields>}, d = 0x7f3fbbf23360
<QArrayData::shared_null>}, static mPrefixPath29900 = {static null =
<same as static member of an already seen type>, d = 0x55d59d976ca0},
static mPluginPath29900 = {static null = <same as static member of an
already seen type>, d = 0x55d59d973600}, static mPkgDataPath29900 =
{static null = <same as static member of an already seen type>, d =
0x55d59d98d360}, static mLibraryPath29900 = {static null = <same as
static member of an already seen type>, d = 0x55d59d973820}, static
mLibexecPath29900 = {static null = <same as static member of an already
seen type>, d = 0x55d59d9738b0}, static mThemeName29900 = {static null =
<same as static member of an already seen type>, d = 0x7f3fc52efd60
<QgsApplication::setUITheme(QString const&)::{lambda()#2}::operator()()
const::qstring_literal>}, static mDefaultSvgPaths29900 =
{<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data
fields>}, {p = {static shared_null = {ref = {atomic = {_q_value =
{<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No
data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d =
0x55d59d86adc0}, d = 0x55d59d86adc0}}, <No data fields>}, static
mSystemEnvVars29900 = {d = 0x55d59d86ad90}, static mConfigPath29900 =
{static null = {<No data fields>}, d = 0x55d59d98d220}, static
mRunningFromBuildDir29900 = false, static mBuildSourcePath29900 =
{static null = <same as static member of an already seen type>, d =
0x7f3fbbf23360 <QArrayData::shared_null>}, static mBuildOutputPath29900
= {static null = <same as static member of an already seen type>, d =
0x7f3fbbf23360 <QArrayData::shared_null>}, static mGdalSkipList29900 =
{<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data
fields>}, {p = {static shared_null = {ref = {atomic = {_q_value =
{<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No
data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d =
0x7f3fbbf25960 <QListData::shared_null>}, d = 0x7f3fbbf25960
<QListData::shared_null>}}, <No data fields>}, static mMaxThreads29900 =
4, static mAuthDbDirPath29900 = {static null = {<No data fields>}, d =
0x55d59d98d220}, static sUserName = {static null = <same as static
member of an already seen type>, d = 0x55d59d8dab20}, static
sUserFullName = {static null = <same as static member of an already seen
type>, d = 0x55d59df6b870}, static sPlatformName = {static null = <same
as static member of an already seen type>, d = 0x55d59d7860a0},
mIconCache = {d = 0x55d59d871fe0}, mDataItemProviderRegistry =
0x55d59e4dbbf0, mApplicationMembers = 0x55d59d866e20, static
sApplicationMembers = 0x0}
        customizationsettings = 0x55d59d944f90
        useCustomVars = false
        myPixmap = <incomplete type>
        __FUNCTION__ = "main"
        mySnapshotFileName = {static null = {<No data fields>}, d =
0x7f3fbbf23360 <QArrayData::shared_null>}
        configLocalStorageLocation = {static null = {<No data fields>},
d = 0x55d59d784930}
        profileName = {static null = {<No data fields>}, d = 0x55d59d7860d0}
        mySnapshotWidth = 800
        mySnapshotHeight = 600
        myHideSplash = false
        mySkipVersionCheck = false
        myRestoreDefaultWindowState = false
        myRestorePlugins = true
        myCustomization = true
        dxfOutputFile = {static null = {<No data fields>}, d =
0x7f3fbbf23360 <QArrayData::shared_null>}
        dxfSymbologyMode = QgsDxfExport::SymbolLayerSymbology
        dxfScale = 50000
        dxfEncoding = {static null = {<No data fields>}, d =
0x55d59c11f580 <main::{lambda()#1}::operator()() const::qstring_literal>}
        dxfPreset = {static null = {<No data fields>}, d =
0x7f3fbbf23360 <QArrayData::shared_null>}
        dxfExtent = {mXmin = 0, mYmin = 0, mXmax = 0, mYmax = 0}
        myInitialExtent = {static null = {<No data fields>}, d =
0x55d59c11f5c0 <main::{lambda()#2}::operator()() const::qstring_literal>}
        myTranslationCode = {static null = {<No data fields>}, d =
0x55d59d998dd0}
        configpath = {static null = {<No data fields>}, d =
0x7f3fbbf23360 <QArrayData::shared_null>}
        authdbdirectory = {static null = {<No data fields>}, d =
0x7f3fbbf23360 <QArrayData::shared_null>}
        pythonfile = {static null = {<No data fields>}, d =
0x7f3fbbf23360 <QArrayData::shared_null>}
        customizationfile = {static null = {<No data fields>}, d =
0x7f3fbbf23360 <QArrayData::shared_null>}
        globalsettingsfile = {static null = {<No data fields>}, d =
0x55d59d98d0f0}
        args = {<QList<QString>> = {<QListSpecialMethods<QString>> =
{<No data fields>}, {p = {static shared_null = {ref = {atomic =
{_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i
= -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array =
{0x0}}, d = 0x55d59d738250}, d = 0x55d59d738250}}, <No data fields>}
        myUseGuiFlag = true
        settings = {<QObject> = {<No data fields>}, static
staticMetaObject = {d = {superdata = 0x7f3fbc2e5a00
<QObject::staticMetaObject>, stringdata = 0x7f3fc53d4900
<qt_meta_stringdata_QgsSettings>, data = 0x7f3fc53d4940
<qt_meta_data_QgsSettings>, static_metacall = 0x7f3fc526f9a8
<QgsSettings::qt_static_metacall(QObject*, QMetaObject::Call, int,
void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, static
sGlobalSettingsPath = {static null = {<No data fields>}, d =
0x55d59d98d0f0}, mUserSettings = 0x55d59d737e30, mGlobalSettings = 0x0,
mUsingGlobalArray = false}
gdb returned 0



On 12-10-17 07:42, Nyall Dawson wrote:
> Hi Richard,
> 
> On 9 October 2017 at 23:10, Richard Duivenvoorde <rdmailings at duif.net> wrote:
>>
>> (sorry for long email and lot of questions...
>> tldr; I think qlocator is UBERCOOL!!!! and want to use if for everything)
>> for a screenie, see:
>> http://pix.toile-libre.org/upload/original/1507554555.png
> 
> Awesome... that's what we like to see!
> 
> 
>> # QUESTION: should we create base (geocoder)classes for the
>> GeocoderLocator and GeocoderFilter (in cpp or python):
>> - I created a baseclass for my 2 geocoders, thinking it would be
>> helpfull to have something like 'mapToResult', but after some initial
>> tests I think it is maybe only usefull to define some scale presets
>> (like in current version of this plugin)
>> - these baseclasses could be python or cpp...
> 
> I'd say not yet. I think in future we'll need these, but at the moment
> I don't believe we know enough about what we require from such a base
> class. I'd rather we let things "settle" and then see what the common
> functionality is across the various geocoder implementations.
> 
>> # QUESTION: IF a service does not have a suggest-service (like
>> Nominatim) adding a space ' ' at the end to force a search
>> - Nominatim is not supposed to be used as a suggest service (see [0]) in
>> contrast to the PDOK geocoder), so I decided to do the actual
>> GET-request as soon as the user added a space in the end to let us know
>> a searchstring was ended. This is just an idea, if others have better
>> idea's just let us know
> 
> I'm not sure how to handle this situation. Right now I can't think of
> a nicer approach than what you've taken.
> 
> 
>> # QUESTION: should we have a (cpp/python?) NetworkAccessManager(factory)
>> somewhere?
>> - I took Boundless networkaccessmanager.py to do the HTTP requests. The
>> advantage of this class is that it mimics http2 lib interface, BUT
>> actually uses the Qt/QgsNetworking classings...
>> I think we (as in QGIS) should have such a class in core (be it cpp or
>> python)
> 
> No objections here... but I'll let boundless take the lead here, if
> they think it's suitable for inclusion in master/the stable API.
> 
>> # QUESTION: having different geocoder locators running:
>> synchron/blocking or asynchron/non-blocking networking?
>> Because of the fast suggest service of I used the blocking way, but I'm
>> not sure what the preferred way is here. Also it is not fully clear to
>> me what to do with running requests (if you type very fast....)
> 
> The locator should handle this situation fine. What happens is that:
> 
> 1. as a search string is entered, that string is passed to every
> filter's "fetchResults" method, each of which runs in a different
> thread.
> 2. results are added to the list as soon as a filter reports each one
> - it doesn't wait until the individual filter is finished, or any
> other filters are finished.
> 
> So a slow filter will not block the results coming back from a fast filter.
> 
> However - when a new string is entered (or a few extra characters
> added to the string), the locator won't fire up a new search until all
> the filters have finished the last request. So an individual filter
> will only EVER have a single request happening at a time. This does
> mean that filters which are slow to return can potential delay new
> searches from occurring. To avoid this, well behaved filters should
> use the passed QgsFeedback and check for cancelation (or attach to
> it's canceled signal) and abort a running request as soon as possible.
> 
>> # QUESTION: is a normal plugin the right thing to do?
>> - in the implementation you actually have to do 2 things:
>> 1) register and deregister the LocatorFilter
>> 2) create and implement the actual QgsLocatorFilter
>> It is easy to do this as a plugin too (as you can see). I'm ok with
>> every country implementing its QLocator (do we need a 'term/word' for
>> it?) and add it as plugin
> 
> Yep, I think that's the best approach. Then users can install whatever
> search plugins they find useful for their own particular workflow.
> 
>> # QUESTION: should a Filter already have a NetworkAccessManager and an iface
>> - if implemented as a plugin, you have the iface to actually get a
>> handle to the mapcanvas etc etc. (you need it so check crs or let themap
>> zoom/pan) I was wondering if a QgsLocator should not actually be able to
>> get to the mapcanvas (directly, or via current QgsProject)
>> Same with an actual NetworkAccessManager...
> 
> I think your approach is fine here (using iface to get the canvas).
> Locator filters are purely a core class, so can't rely on gui widgets
> like the canvas.
> 
>> # QUESTION: why only 3 chars for prefix? (better make this configurable?)
>> - I think it would be best if a user can decide him/herself to which
>> locators to use, and thus decide what prefixes to use for them. In my
>> case I would do: p (for pdok), f (for features), o (for osm/nomanitim)
>> and g (for google). Others are not so interesting to e...
>> I think only having the possibility to use 3 character prefixes is not
>> very usefull?
> 
> Ok - so the rationale here is that we DON'T want plugins to "steal"
> all the best key combinations and prevent us from using these for
> future core locator uses. E.g. if we allow a plugin to use the "o"
> shortcut for OSM search, we'll never be able to take that back and use
> "o" for "open file" (or something else). That's why I took the
> somewhat harsh approach of restricting plugins to a minimum 3
> character shortcut. I think in future (as we see greater use of
> locator and have a better idea of how it's being used) we could
> potentially grant widely used 3rd party plugins access to the
> whitelist to avoid this restriction.
> 
> But for now, I'd rather play it safe and keep this restriction in place.
> 
> Of course, we could also potentially allow users to configure the
> shortcuts (Qt Creator does this) so they can do whatever the want.
> 
>> #    would be cool to be able to have a object-type to scale mapping for
>> all geocoders, so  you determine for every object type on which z-level
>> (exact) you want to come... I tried to do that by doing:
>>     ADDRESS = 750
>>     STREET = 1500
>>     ZIP = 3000
>>     PLACE = 30000
>>     CITY = 120000
>>     ISLAND = 250000
>>     COUNTRY = 4000000
>> But not sure if this is the best way.
> 
> That's a good idea! We could use the feature bounding box for
> non-point features, and then fall back to some predefined scales like
> this for point results.
> 
>> # QUESTION: why short result texts with osm (missing the 'types' of the
>> object)
>> - the results (of osm) seem to be cut of rather short?
> 
> I don't understand... have you got an example?
> 
> 
>> # QUESTION: should the BaseGeocoderLocator set a point or label? As Option?
>> - Alesandro's geocoder plugin (for 2.x) put's a point/label in the map.
>> I was wondering if this should maybe be an (optional) thing in a base
>> class too? Maybe adding all properties that you receive from the geocoder
> 
> We could also flash the point/line/polygon match geometry... I've no
> strong opinions here yet.
> 
> 
>> # QUESTION: during loading/reloading of the plugin I had a LOT of crashes:
>> ^[QGIS died on signal 11[New LWP 26919]
>> [New LWP 26920]
>> [New LWP 26921]
>> etc
>> Not sure if this is my install, or has something to do with this plugin,
>> or the combi of network-threads and application threads...
>> Please confirm.
> 
> Run a debug build, and get a backtrace. Then we'll talk ;)
> 
> Nyall
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 



More information about the QGIS-Developer mailing list