<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hello,</div><div><br></div><div>Excellent web app.  While getting my own project set up in QWC2, I've learned quite a bit of Linux, Apache2 and PostGIS/PostgreSQL in the process.  My background is ESRI and I've been working with their Web AppBuilder for a few years.  During these cold short winter days, I've been spending quite a bit of time with QWC2 and really enjoying the challenge of getting everything set up and working.  Good stuff.</div><div><br></div><div>So I managed to get my own feature search working by adding to SearchProviders.js and following examples provided in the usterSearch functions.  I set up a PostGIS database and figured out how to get search working from my own searchtable.  Very cool, very fast response time, works great on a free-tier Amazon EC2 instance running Ubuntu 18.04.  Brilliant.</div><div><br></div><div>Now on to the next challenge, search by address.  I've found 2 possible ways to go.  One is to set up a search by address within QWC2 using Nominatim.  It seems to work pretty well from the new QGIS 3 locator bar.  Since I haven't got the foggiest idea how to get this working in QWC2, even though Nominatum is very well documented, I decided to set up a working PostGIS Tiger Geocoder using the procedure here (note I'm running Linux Mint 19 and Ubuntu 18.04):</div><div><br></div><div><a href="https://experimentalcraft.wordpress.com/2017/11/01/how-to-make-a-postgis-tiger-geocoder-in-less-than-5-days/">https://experimentalcraft.wordpress.com/2017/11/01/how-to-make-a-postgis-tiger-geocoder-in-less-than-5-days/</a><br></div><div><br></div><div>So I have 2 U.S. states set up in the geocoder database:  Tennessee and Georgia.  If I execute this:</div><div><br></div><div><div><div>SELECT g.rating, ST_AsText(ST_SnapToGrid(g.geomout,0.00000001)) As wktlonlat,</div><div>(addy).address As stno, (addy).streetname As street,</div><div>(addy).streettypeabbrev As styp, (addy).location As city, (addy).stateabbrev As st,(addy).zip</div><div>FROM geocode('1250 Market St, Chattanooga, TN 37401',1) As g;</div></div></div><div><br></div><div>it returns:</div><div><br></div><div><div> rating |            wktlonlat            | stno | street | styp |    city     | st |  zip  </div><div>--------+---------------------------------+------+--------+------+-------------+----+-------</div><div>      2 | POINT(-85.30800056 35.04065209) | 1250 | Market | St   | Chattanooga | TN | 37402</div><div>(1 row)</div></div><div><br></div><div>Beautiful.  And fast.  A free geocoder to use with QWC2 for searching addresses.  Only thing is I have no idea how to set this up from within QWC2.  No examples to follow.  Ideally, you type the address into the search bar, it passes the address to the geocoder database, then parses the search result and places a marker and an address label at the returned location.</div><div><br></div><div>Here's what I've done so far:</div><div><br></div><div>Added a new "address" service to themesConfig.json</div><div><br></div><div>        "searchProviders": ["coordinates", "cha", "address", "layers"],<br></div><div><br></div><div>Added a new addressSearch function to SearchProviders.js</div><div><br></div><div><div>function addressSearch(text, requestId, searchOptions, dispatch) {</div><div>}</div></div><div><br></div><div>And that's pretty much it.  The usterSearch functions and the search.wsgi are set up for an attribute search but not an address search.  search.wsgi uses the connection string in qwc_connect.py</div><div><br></div><div>DB_CONN_STRING="host='localhost' dbname='sanitary' port='5432' user='postgres' password='password'"<br></div><div><br></div><div>So I'm thinking I'll need to write a custom addressSearch.wsgi which would use a different DB_CONN_STRING (since geocoder is a separate database)</div><div><br></div><div>DB_CONN_STRING="host='localhost' dbname='geocoder' port='5432' user='postgres' password='password'"<br></div><div><br></div><div>Then it's on to figuring out the new searchAddress functions in SearchProvider.js to get this to work.</div><div><br></div><div>I'm not asking for a step by step procedure, just some hints to get this working within the QWC2 framework.  Any guidance you can provide would be appreciated.  <br></div><div><br></div><div>Regards,</div><div><br></div><div>Rayner Howard</div><div><br></div></div></div></div></div></div></div></div></div></div>