-
Notifications
You must be signed in to change notification settings - Fork 130
"Property text-name required for defining text styles." error when numeric filter changes by order of magnitude #411
Comments
Closing for now. |
I'm not experienced with npm. I ran this in an openstreetmap-carto directory with the appropriate change, and got this error:
That means it hasn't been fixed, right? |
@rory It (probably) has been fixed in master, but there was no new release yet. So if you use the NPM version the bug is still there. To test and confirm this you would have to clone this repository and invoke bin/carto from there. |
I have checked out the carto master and did a |
Thanks for taking the time to verify it. I could reproduce it. Not sure if it is a bug as such with the very small way pixels, but there should definitely be another error message. |
For my documentation: So far I have traced the bug to the addRules function (https://github.com/mapbox/carto/blob/master/lib/carto/renderer.js#L245). The definitions of the test case in both cases are nearly (superficially) identical (except for specificity):
The output is considerably different. Error case:
Reference case:
|
This was a tough one for me to fix. The fix itself is very easy, a regular expression was used to decide if a filter value should be parsed as number or not. It turned out that this expression did not match all possibilities. But getting there took a bit of time. Anyway: should be fixed and probably also covers some other odd cases. |
… for strings that begin with a number, but shouldn't be treated as one
… for strings that begin with a number, but shouldn't be treated as one
This is a very strange error, that can be demonstrated by the openstreetmap-carto style. This happens with carto v0.9.5 from ubuntu's
node-carto
apt package, and v0.15.5 installed withnpm install
Clone the openstreetmap-carto style, and checkout commit 7b8998c089b448dd73e54cd05c2321c99d529b95 - At the time of writing this is the current master.
Carto converts this to Mapnik XML without a problem:
Change line 4 of
placenames.mss
. In commit 7b8998c it is:Change it to this. We are multiplying the
way_pixels
numeric filter by 1e-9:Carto will convert this project without a problem.
But if you add an extra zero into the
way_pixels
's filter, i.e. line 4 is now, as if we had multiplied the original by 1e-10:Then you get the following error:
The text was updated successfully, but these errors were encountered: