You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change of structure, would you guys be interested to evaluate #22
I have been working with basemaps to generate a particular style that we wanted for the Netherlands. It is a style derived from the "Basisregistratie topografie".
At first I started working from generate_style.py, but the large structure and the big amount of overrides made searching and replacing harder and harder.
So I drank some beer, put my feet on the table and tought; "Wouldn't it be better to use separate style files?"
So I moved all the dicts from generate_style.py to yaml files with a default directory for defaults and a style directory for all the custom styles.
Then I implemented the yaml reading in pyMapFile.py, pretty soon I had everything working.
I also enhanced the -g flag; it now creates/replaces all the .msinc file in one run. I did this because I discovered that running with the -l switch was way slower then generate_style.py
In the process I also added some variables I required, such as ANGLE on a couple of labels, OUTLINE on a couple of labels and I added cycleways and grass to the process as they where missing.
I would like to ask you guys if you would be interested in evaluating my effort. If you think it ain't what you want, let me know. I will isolate my fork.
Hi Milo,
Seems interesting, and the yaml syntax is indeed more user friendly than the python dictionaries.
Currently your setup requires the yaml python module which isn't installed by default and is thus less easy to run, at least on basic unix systems. However, I know that getting "make" and "sed" installed on windows systems can be a pain, so if you managed to get those two out of the loop and do everything through the python file that would be a compensation.
yaml noob question: I'm extensively using this kind of syntax:
I am aware of the fact that yaml introduces a dependency, but my idea is
indeed what you say, to eliminate the requirement for make.
the only thing that is holding me back is that I cannot find a python
alternative for the #IF #END structures (for SED alternatives are available
in python) that are now in effect in the mapfile templates. But I will do
my research and see if I can come up with a solution.
Regarding the reusage of declarations (as in your default_font) example, I
will test this, but I got the feeling it will work allready.
Hi Milo,
Seems interesting, and the yaml syntax is indeed more user friendly than
the python dictionaries.
Currently your setup requires the yaml python module which isn't
installed by default and is thus less easy to run, at least on basic unix
systems. However, I know that getting "make" and "sed" installed on windows
systems can be a pain, so if you managed to get those two out of the loop
and do everything through the python file that would be a compensation.
yaml noob question: I'm extensively using this kind of syntax: ```
default_font = '"sans,arialuni,arabic'" default_bold_font =
"'sansb,arialuni,arabicbold'"
water_font:default_font
cities_font: {
0:default_font,
12:default_bold_font
}
would this also be supported by the yaml files ?
cheers,
thomas
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-20976272
.
Milo,
I don't understand what you mean by the #IF #END structures. The sed processing in the makefile only does some simple string replacements, and removes comments and empty lines (those can be skipped). The sed script works directly on the final mapfile, so there should be no #xxx preprocessor directives left.
No, I am currently just using my syntax to update two styles that I created, but since last week I am enjoying a small vacation. I will get back in touch later.
I went another way and split out the styles as Python modules to be reimported with importlib.import_module(). I tried various forms of exec and eval but this one works with Python 2.7 and upwards: tacatac@b328299
Each style file has a dictionary called after the style, which is used to update the current style, and any other bits required.
Activity
tbonfort commentedon Jul 15, 2013
Hi Milo,
Seems interesting, and the yaml syntax is indeed more user friendly than the python dictionaries.
would this also be supported by the yaml files ?
cheers,
thomas
milovanderlinden commentedon Jul 16, 2013
Hello Thomas,
indeed what you say, to eliminate the requirement for make.
alternative for the #IF #END structures (for SED alternatives are available
in python) that are now in effect in the mapfile templates. But I will do
my research and see if I can come up with a solution.
Regarding the reusage of declarations (as in your default_font) example, I
will test this, but I got the feeling it will work allready.
Op 15 jul. 2013 17:14 schreef "Thomas Bonfort" notifications@github.com
het volgende:
tbonfort commentedon Jul 16, 2013
Milo,
I don't understand what you mean by the #IF #END structures. The sed processing in the makefile only does some simple string replacements, and removes comments and empty lines (those can be skipped). The sed script works directly on the final mapfile, so there should be no #xxx preprocessor directives left.
tbonfort commentedon Jul 29, 2013
Milo,
any update on this one ?
cheers,
thomas
milovanderlinden commentedon Jul 29, 2013
No, I am currently just using my syntax to update two styles that I created, but since last week I am enjoying a small vacation. I will get back in touch later.
tacatac commentedon May 4, 2019
Hope you had a nice vacation ;)
I went another way and split out the styles as Python modules to be reimported with
importlib.import_module(). I tried various forms ofexecandevalbut this one works with Python 2.7 and upwards: tacatac@b328299Each style file has a dictionary called after the style, which is used to update the current style, and any other bits required.
Regards,