Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Empty file="" point_symbolizer attribute being passed to Mapnik #159

Open
springmeyer opened this Issue · 11 comments

3 participants

@springmeyer
Owner

Hoping for help from @tmcw and @ajashton on understanding if this is a bug.

This is a followup on mapbox/tilemill#1499.

The issue is that xml like:

<PointSymbolizer transform="scale(0.2);" allow-overlap="true" ignore-placement="true" file="" />

(Full XML is at https://gist.github.com/2839439)

is being output for css like:

  point-allow-overlap: true;
  point-ignore-placement: true;
  [zoom < 13] {point-transform: "scale(0.1);"}
  [zoom > 12] {point-transform: "scale(0.2);"}
 ...

Full carto is at https://gist.github.com/2839387.

My sense is that file="" is wrong - carto should not be setting this unless the user specifically types point-url(). Right?

@springmeyer
Owner

ping @tmcw - can you provide any insight on this? I've not dug into the carto code yet on this, but it seems wrongly odd that file="" could be being created by carto.

@tmcw
Owner

This doesn't compile in my install; is this with a different mapnik-reference? I get a require point-file error upon trying to compile this.

@springmeyer
Owner

yes, the behavior changed at some point as I see from looking back at mapbox/tilemill#1499. I can also confirm that we throw now, so this must be fixed. As per #167 I guess the solution is to remove the required in mapnik-reference (as long as people are okay with the default rendered point, which I think they will be).

@strk

I landed on this ticket while looking for problems with transform="scale(0.2);" in PointSymbolizers.
It looks like such construct is not valid as of Mapnik-2.2.0, but my carto (using mapnik-reference@5.0.7) doesn't complain about it. Is that normal ? My problem is ticketed here: CartoDB/Windshaft-cartodb#93

@tmcw
Owner

If you use old-style string expressions for transforms, they are not validated beyond being valid strings. New-style expression transforms like transform=scale(0.2); are validated.

@strk strk referenced this issue in CartoDB/Windshaft-cartodb
Closed

point-transform: scale not working #93

@strk

@tmcw is there any valid CartoCSS that would break by removing the quotes around the transform value ? In other words, what's the rationale for not always validating that way ?

@tmcw
Owner

Hm, it would be a weird parser trick to re-parse-as-expression in one specific case (where otherwise we never go back to the parsing stage from the ast), and suddenly changing validation standards would break backwards compatibility with some maps.

@strk

Can a string value ever be valid ? Or would removing the "transform" directive completely always yield the same result as keeping it as a string ?

@tmcw
Owner

Can a string value ever be valid

Do you mean invalid?

Or would removing the "transform" directive completely always yield the same result as keeping it as a string ?

What are you asking here?

@strk

I was really asking if using a string ever had any real effect, but figured out by myself: yes, it does.
Actually it turns out that some valid W3C syntaxes can only be specified as a string because the carto validator doesn't accept them (ie: "scale(6)", valid as the value 6 is taken for both X and Y while mapnik-reference has a strict requirement for 2 distinct values for X and Y).

@strk

So, to recap, my problem seems to be that "point-file" is either required or not depending on "strictness" of map loading in Mapnik. When parsing is "strict", mapnik will error out, when it isn't, it will just warn.

Do you think such "strict" flag should make it into "mapnik-reference" @springmeyer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.