CartoDB / mobile-carto-libs

Internal dependencies for CARTO Mobile SDK
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

parse style cant get optimized #7

Closed farfromrefug closed 3 years ago

farfromrefug commented 4 years ago

I am looking at ways to optimize a style. I see in your code this function which is suppose to do that.

However it cant really do it because most of the time rules are not "consecutive".

As an example in my generated xml. The same rule appears 13 times but as ou can see in the ruler they are not consecutive! Maybe we could sort the rules first so that they are.

Screen Shot 2020-04-07 at 14 29 36
farfromrefug commented 4 years ago

I also see Filter::Type::ELSEFILTER references in the code. It seems to be doable in XML. Is there a way to do that in mss? So that it will generate ElseFilter ? That could drastically decrease the size/complexity of my style!

mtehver commented 3 years ago

There is no way to express ELSE in CartoCSS.

I recommend using CartoCSS styles directly (without precompiling into XML) with SDK 4.4. CartoCSS styles should now work faster when used directly vs XML styles.