Exemplo n.º 1
0
Arquivo: wkb.cpp Projeto: bblu/mapnik
 void read_coords(Ring & ring, std::size_t num_points)
 {
     double x,y;
     if (!needSwap_)
     {
         for (std::size_t i = 0; i < num_points; ++i)
         {
             read_double_ndr(wkb_ + pos_, x);
             read_double_ndr(wkb_ + pos_ + 8, y);
             ring.emplace_back(x,y);
             pos_ += 16; // skip XY
             if (Z) pos_ += 8;
             if (M) pos_ += 8;
         }
     }
     else
     {
         for (std::size_t i = 0; i < num_points; ++i)
         {
             read_double_xdr(wkb_ + pos_, x);
             read_double_xdr(wkb_ + pos_ + 8, y);
             ring.emplace_back(x,y);
             pos_ += 16; // skip XY
             if (Z) pos_ += 8;
             if (M) pos_ += 8;
         }
     }
 }
Exemplo n.º 2
0
Arquivo: wkb.cpp Projeto: rjw57/mapnik
 void read_coords_xyz(CoordinateArray& ar)
 {
     if (! needSwap_)
     {
         for (unsigned i = 0; i < ar.size(); ++i)
         {
             read_double_ndr(wkb_ + pos_, ar[i].x);
             read_double_ndr(wkb_ + pos_ + 8, ar[i].y);
             pos_ += 24; // skip XYZ
         }
     }
     else
     {
         for (unsigned i = 0; i < ar.size(); ++i)
         {
             read_double_xdr(wkb_ + pos_, ar[i].x);
             read_double_xdr(wkb_ + pos_ + 8, ar[i].y);
             pos_ += 24; // skip XYZ
         }
     }
 }
Exemplo n.º 3
0
Arquivo: wkb.cpp Projeto: bblu/mapnik
    double read_double()
    {
        double d;
        if (needSwap_)
        {
            read_double_xdr(wkb_ + pos_, d);
        }
        else
        {
            read_double_ndr(wkb_ + pos_, d);
        }
        pos_ += 8;

        return d;
    }