Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce mappyfile to create mapfiles #66

Open
pvgenuchten opened this issue Nov 9, 2023 · 2 comments
Open

introduce mappyfile to create mapfiles #66

pvgenuchten opened this issue Nov 9, 2023 · 2 comments
Labels
enhancement New feature or request Mapfile Issues related to Mapserver styles

Comments

@pvgenuchten
Copy link
Contributor

mappyfile is a python library to facilitate creation of mapfiles

introducing this component may facilitate the development against mapfiles

@GeoSander GeoSander added enhancement New feature or request Mapfile Issues related to Mapserver styles labels Nov 9, 2023
@GeoSander
Copy link
Member

Hi @pvgenuchten,

Thanks for your suggestion. This may be a good idea indeed.

However, using mappyfile in QGIS Bridge will introduce 2 extra dependencies (mappyfile itself and lark on which it depends) and I absolutely hate the (non-existent) dependency management in the QGIS plugin system. I'm also not a fan of "freezing" libraries and shipping them with Bridge (with some Python libs built on top of some C++ code this is not even possible), or even worse: requiring the user to install the dependencies themselves.

Do you have any ideas how to tackle this problem?
Any new developments related to QGIS plugin dependency management I should know about? I've been working on other things mostly during the last year...

Sander

@geographika
Copy link

Hi @GeoSander - author of mappyfile here. I was speaking to @pvgenuchten at the OSGeo codesprint last week in Vienna about this.

mappyfile would provide a few advantages over the current Python code:

  • validation of generated output against Mapfile schemas (using JSONSchema - although another dependency I'm afraid)
  • many different pretty-printing options - quote types, indents etc.
  • easy methods to build a full working Mapfile from several QGIS layers
  • easier path to providing a full QGIS project to Mapfile export in the future

I've also discussed a GeoStyler QGIS plugin with the Terrestris developers at the GeoStyler codesprint this year. This would be a wrapper around the GeoStyler client application (so users would need to have this installed somewhere on their system path). The plugin could then also incorporate other Python modules to provide further GeoStyler support such as the GeoStyler -> Mapfile support currently in bride-style.

I'm not very familiar with the state of QGIS plugins and Python dependencies. I presume only one environment is used which would mean a high risk of version clashes. There is a proposal at qgis/QGIS-Enhancement-Proposals#202 to allow for multiple environments, but this seems to be on-hold.

mappyfile and all dependencies are pure-Python modules which may make things a little easier, and as mappyfile is now an OSGeo Community project all its dependencies are updated in Debian and conda. As far as I'm aware the only other "geo" project using Lark is pygeofilter.

Creating a new mappyfile-geostyler plugin would be my preference (due to reuse of mappyfile, and my familiarity with the mappyfile codebase), and then bridge-style could then provide a wrapper around this project. This may not be your preferred approach, so it probably comes down to if you see the Mapfile bridge-style code being updated to support new GeoStyler features, such as raster style exports, in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Mapfile Issues related to Mapserver styles
Projects
None yet
Development

No branches or pull requests

3 participants