Giter Club home page Giter Club logo

Comments (4)

grafi-tt avatar grafi-tt commented on May 13, 2024

Probably your settings of maxzoom and basezoom are problematic.
Your value 18 is greater than 16, however, Tilemaker assumes a zoomlevel is less than or equals to 16. (Tilemaker assigns 16bits to each of x and y coordinates.)
If you change the value to 15 or so, I expect the first solution gives the correct result.
Could you try it?

Even though, the second solution would not gives the correct result.
This is because multiple identical objects are copied into generatedIndex[newIndex], in the following part of tilemaker.cpp.

            // otherwise, we need to run through the z14 list, and assign each way
            // to a tile at our zoom level
            for (auto it = tileIndex.begin(); it!= tileIndex.end(); ++it) {
                uint index = it->first;
                uint tilex = (index >> 16  ) / pow(2, baseZoom-zoom);
                uint tiley = (index & 65535) / pow(2, baseZoom-zoom);
                uint newIndex = (tilex << 16) + tiley;
                unordered_set<OutputObject> ooset = it->second;
                for (auto jt = ooset.begin(); jt != ooset.end(); ++jt) {
                    generatedIndex[newIndex].insert(*jt);
                }
            }

I guess we can fix this by applying sort() and uniq() (then we need the = operator again, and the < operator is also required).

from tilemaker.

ThibaudM avatar ThibaudM commented on May 13, 2024

In fact, I already fixed the problem for zoom level > 16 with tilemaker.
For my problem, I found a solution by modifying the == operator of OutputObject like this:

bool operator==(const vector_tile::Tile_Value& x, const vector_tile::Tile_Value& y) {
        if(x.has_string_value() && y.has_string_value())
                return x.string_value() == y.string_value();
        if(x.has_float_value() && y.has_float_value())
                return x.float_value() == y.float_value();
        if(x.has_double_value() && y.has_double_value())
                return x.double_value() == y.double_value();
        if(x.has_uint_value() && y.has_uint_value())
                return x.uint_value() == y.uint_value();
        if(x.has_sint_value() && y.has_sint_value())
                return x.sint_value() == y.sint_value();
        if(x.has_bool_value() && y.has_bool_value())
                return x.bool_value() == y.bool_value();
        return false;
}
bool operator!=(const vector_tile::Tile_Value& x, const vector_tile::Tile_Value& y) {
        return !(x == y);
}

bool operator==(const OutputObject& x, const OutputObject& y) {

        std::map<string, vector_tile::Tile_Value>::iterator it;

        if ((x.layer != y.layer) || (x.objectID != y.objectID) || (x.geomType != y.geomType) || (x.attributes.size() != y.attributes.size()))
       return false;

        for (auto i = x.attributes.begin(); i != x.attributes.end(); ++i) {
                if( !y.attributes.count(i->first) || y.attributes.at(i->first) != i->second)
                        return false ;
        }

        return true;
}

from tilemaker.

systemed avatar systemed commented on May 13, 2024

Could you test with the latest version and let me know if this is still an issue?

from tilemaker.

ThibaudM avatar ThibaudM commented on May 13, 2024

The last version works, thank you

from tilemaker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.