Hey Tom, Don't use regex. You are in for a world of pain if you go that way, and not the kind of pain you feel good about after. I will have a better method for you soon.
- Nathan On Thu, 16 Apr 2015 at 20:20 Tom Chadwin <[email protected]> wrote: > I'm implementing rule-based rendering in qgis2leaf. I know I can get the > filterExpressions with: > > > qgis.utils.iface.mapCanvas().layers().rendererV2().rootRule().children().filterExpression() > > However, filterExpressions are in "SQL-like" syntax. I need to transform > these into JavaScript: > > QGIS: "name" LIKE '%a%' > JS: feature.properties.name.indexOf('a') != -1 > > At the moment, I am facing a whole load of messy regexps to cover all > possible expressions (probably impossible). Is there more granular access > to > the filterExpression than retrieving the whole string? That could allow me > to build the JS programmatically, which could be possible. > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Python-granular-access-to-rules-in-rule-based-renderer-tp5201632.html > Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. > _______________________________________________ > Qgis-developer mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-developer >
_______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
