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

Upgrade mapfile parser #33

Merged
merged 20 commits into from
May 5, 2021
Merged

Upgrade mapfile parser #33

merged 20 commits into from
May 5, 2021

Conversation

mholthausen
Copy link
Member

@mholthausen mholthausen commented Apr 14, 2021

With this PR

  • the DATA block of a mapfile is removed, because it is irrelevant for the style and the content could lead to misinterpretation of the whole document,
  • a check of color values to hexadecimal format is added. Previously, values were converted that were already given as hex values,
  • implements various minor code improvements,
  • no more style symbolizers are created due to empty mapfile STYLE blocks,
  • the MAXSCALEDENOM/MINSCALEDENOM value at the particular class will always be used, even if a different value is present at the layer,
  • no visibility property set if OUTLINECOLOR is present
  • sets haloColor and haloWidth from OUTLINECOLOR and OUTLINEWIDTH for LABEL
  • replaces the name of SYMBOLS with the linked filename if SYMBOLS are defined within the Mapfile and not framed by a SYMBOLSET
  • prevents counting single numbers of a lineObject as a block which led to a wrong amount of blocks related to END keys
  • integrates support for geostyler-style version 4.0.1 and updates dependencies
  • adds node version 14 to TRAVIS CI pipeline

I request a final review of the changes made here by this PR

src/MapfileStyleParser.ts Outdated Show resolved Hide resolved
src/Useful.spec.ts Outdated Show resolved Hide resolved
@jansule
Copy link
Contributor

jansule commented Apr 14, 2021

Never mind. I just noticed the DRAFT flag

@mholthausen
Copy link
Member Author

Thanks @jansule! Even though it is still DRAFT, any advice is greatly appreciated!

@geographika
Copy link

Sorry for gatecrashing this ticket, but it might be something of interest.
There are JSON schemas for all Mapfile elements at https://github.com/geographika/mappyfile/tree/master/mappyfile/schemas might be useful for validation.
This schema will (at some point) be proposed as an official schema via an RFC for MapServer.

@mholthausen mholthausen marked this pull request as ready for review April 21, 2021 14:04
@mholthausen mholthausen requested a review from jansule April 22, 2021 07:14
Copy link
Contributor

@jansule jansule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @mholthausen! Just some minor nitpicks you might want to address.
I would also love to get some feedback from @b4l, @ger-benjamin or @faselm.

jest.config.js Outdated Show resolved Hide resolved
src/MapfileStyleParser.ts Outdated Show resolved Hide resolved
src/MapfileStyleParser.ts Outdated Show resolved Hide resolved
src/mapfile2js/parse/resolveSymbolset.ts Outdated Show resolved Hide resolved
src/mapfile2js/parse/resolveSymbolset.ts Show resolved Hide resolved
tsconfig-eslint.json Outdated Show resolved Hide resolved
@b4l
Copy link
Contributor

b4l commented Apr 23, 2021

Sorry for gatecrashing this ticket, but it might be something of interest.
There are JSON schemas for all Mapfile elements at https://github.com/geographika/mappyfile/tree/master/mappyfile/schemas might be useful for validation.
This schema will (at some point) be proposed as an official schema via an RFC for MapServer.

Also might want to switch to a more advanced parsing step leveraging a proper grammar/schema than the current mediocre line based one.

@mholthausen
Copy link
Member Author

Thanks for the reviews! When all uncertainties are solved, the changes can be merged.

@mholthausen
Copy link
Member Author

Sorry for gatecrashing this ticket, but it might be something of interest.
There are JSON schemas for all Mapfile elements at https://github.com/geographika/mappyfile/tree/master/mappyfile/schemas might be useful for validation.
This schema will (at some point) be proposed as an official schema via an RFC for MapServer.

Also might want to switch to a more advanced parsing step leveraging a proper grammar/schema than the current mediocre line based one.

Sorry for gatecrashing this ticket, but it might be something of interest.
There are JSON schemas for all Mapfile elements at https://github.com/geographika/mappyfile/tree/master/mappyfile/schemas might be useful for validation.
This schema will (at some point) be proposed as an official schema via an RFC for MapServer.

Also might want to switch to a more advanced parsing step leveraging a proper grammar/schema than the current mediocre line based one.

That's a good consideration! A discussion should be continued on this in the Issues or GitHub Discussions. These changes exceed the requirements of this PR.

@marcjansen
Copy link
Contributor

I am +1 on merging, and we should probably make dedicated issues out of:

@marcjansen
Copy link
Contributor

marcjansen commented May 4, 2021

Hey @mholthausen, @geographika & @b4l maybe you want to join the monthly meeting today? Than we can have a chat about this. Drop us an email at reports@geostyler.org, then you'll get invited

Copy link
Contributor

@jansule jansule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@jansule jansule merged commit aa665c6 into geostyler:master May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants