Comments (2)
D'oh, sorry that you're hitting this. I can offer some context.
In #583, I changed AttributePair
to identify the key by a short
rather than a std::string
. This had the effect of limiting us to 64K unique keys, which is probably plenty.
In #618, I further changed it to use at most 9 bits:
tilemaker/include/attribute_store.h
Line 49 in eab08d1
That limits us to at most 512 unique keys.
Except... this has the same bug as #672 did: it's using a signed type. Instead of short : 9
, it should be unsigned short : 9
. As it stands, the usable range is -256..255
, not 0..511
, so you can actually only squeeze in 256 keys before hitting issues.
So probably there are at least two things that ought to be done:
- Use
unsigned short : 9
so we get the full range. - Consider making
AttributeKeyStore
assert if it would return an index that would be out-of-bounds (so that future people who hit this issue get a useful error, not a segfault)
And then possibly:
- Permit more than 512 keys to be used, at the expense of increasing the size of
AttributePair
. Maybe in your scenario that's not needed?
from tilemaker.
@cldellow Nice. My first thought was that it was an overflow, given the unexpected number, but the bounds (-245) just didn't make sense to me. Too big for 8 bit, too small for 16 bit. The daft part is that when looking at the definition short keyIndex : 9;
I did wonder about the syntax (I'm not a C/C++ guy, should have googled it though).
Just to verify this...
- Because, I know the ID of the element, and that the tag value is
branch
, which means the tag key will beusage
and the keyIndex = -245 - The keyIndex requested was 267 (based on the two's complement
- Boom, the tag at index 267 is "usage"
- Also works for the next attribute which was
maxspeed
with a index of -244
Feeling pretty daft that I didn't work that one out 🤦
So, with regards to this:
- I've just rebuilt tilemaker changing keyIndex to an unsigned short, and it looks up the indexes without a worry, even processing the stupid amount of attributes for the entirety of Germany
- That would be ideal, probably better if somebody other than I does that...
- "512 attributes ought to be enough for anyone"... Jokes aside, I'll leave that one up to people better at this me. 512 is plenty for my use, I'm not planning on having as many as want to abstract many of the attributes I'm chucking on to the tiles.
from tilemaker.
Related Issues (20)
- CI is broken
- Support writing MultiPoint into vector tiles HOT 1
- Ocean and land area is missing HOT 13
- Possible issue with multipoint processing HOT 4
- How to avoid duplicate processing of OSM object
- Cross-Platform Inconsistency in Attribute Handling with Identical Configs on Ubuntu and macOS HOT 6
- mbtiles file bigger than bare folders? HOT 3
- no outcome after run make sudo make install on ubuntu HOT 2
- No housenumber
- Ocean Tiles Incomplete
- Keep OSM feature type in the final mbtiles file HOT 6
- Sea area is missing, not a blue color HOT 2
- When will the next version be released?
- Grid Coordinate Lines on Map HOT 2
- Random Core Dump
- Fails to build with Boost 1.86.0 HOT 1
- Feature: Add global lua function to list all tags HOT 1
- Feature: Add BUILD_DEBUG argument when building Docker image
- Feature: Add --quiet option to tilemaker executable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tilemaker.