[QGIS-Developer] PYQGIS - OpenGL in QgsPluginLayer
Martin Dobias
wonder.sk at gmail.com
Wed Mar 3 09:38:29 PST 2021
Hi Eric
On Wed, Mar 3, 2021 at 5:48 PM Eric Younkin - NOAA Federal <
eric.g.younkin at noaa.gov> wrote:
> Thanks for the quick reply. This is for NOAA nautical chart symbology,
> following the s57/s52 spec. You can see the symbology in the online viewer
> here <https://www.nauticalcharts.noaa.gov/ENCOnline/enconline.html>. It
> is basically a very complex spec that we generated for display in a
> wxPython widget a long time ago using GDAL 1.x commands. S57 is already an
> existing OGR driver, although I do not know what exactly that driver does.
> I do know that it does not somehow generate the symbology of the data for
> you to then render.
>
> The vector data would be a combination of area/line/point features, and I
> don't think it would be a fit for the Mesh layer.
>
> We'd like to make this symbology available in QGIS, so that users can drag
> in a s57 file and view the chart. You can use one of our WMS services, but
> having the file support would be useful. Ideally in a plugin layer, so
> that I can also use it in our other apps that use PYQGIS QgsMapCanvas
> widgets.
>
Thanks for more background. In this case the mesh layer indeed is not
useful. I have not worked with S57 before, but if there is OGR driver
available, it should be relatively easy to load and style the data without
a plugin layer. You do not need to rely on styling provided by OGR (if
provided at all). It looks like you only need to load the data as a bunch
of vector layers using OGR (one for each object type) and then apply
styling to those individual layers. Styling of vector layers in QGIS is
fairly strong, with features like rule-based rendering, data-defined
properties and geometry generators you can handle even very complex styles.
After preparing individual styles for vector layers, you can save them to
.qml files, and then your plugin would have just a simple task of taking
the input file(s), load layers and apply saved styles.
I would resort to writing a custom plugin layer only when when all other
options fail - it is more complex, and generally the user experience is not
great.
Regards
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20210303/c8e06f62/attachment.html>
More information about the QGIS-Developer
mailing list