@@ -554,7 +554,8 @@ void decode_polygon(mapnik::geometry::geometry<geom_value_type> & geom,
554
554
} // end ns detail
555
555
556
556
GeometryPBF::GeometryPBF (pbf_itr const & geo_iterator)
557
- : geo_iterator_(geo_iterator),
557
+ : geo_itr_(geo_iterator.begin()),
558
+ geo_end_itr_ (geo_iterator.end()),
558
559
x(0 ),
559
560
y(0 ),
560
561
ox(0 ),
@@ -571,9 +572,9 @@ typename GeometryPBF::command GeometryPBF::point_next(value_type & rx, value_typ
571
572
{
572
573
if (length == 0 )
573
574
{
574
- if (geo_iterator_. first != geo_iterator_. second )
575
+ if (geo_itr_ != geo_end_itr_ )
575
576
{
576
- uint32_t cmd_length = static_cast <uint32_t >(*geo_iterator_. first ++);
577
+ uint32_t cmd_length = static_cast <uint32_t >(*geo_itr_ ++);
577
578
cmd = cmd_length & 0x7 ;
578
579
length = cmd_length >> 3 ;
579
580
if (cmd == move_to)
@@ -611,8 +612,8 @@ typename GeometryPBF::command GeometryPBF::point_next(value_type & rx, value_typ
611
612
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
612
613
// "end of buffer exception"
613
614
// While this error message is not verbose a try catch here would slow down processing.
614
- int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
615
- int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
615
+ int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
616
+ int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
616
617
detail::move_cursor (x, y, dx, dy);
617
618
rx = x;
618
619
ry = y;
@@ -625,9 +626,9 @@ typename GeometryPBF::command GeometryPBF::line_next(value_type & rx,
625
626
{
626
627
if (length == 0 )
627
628
{
628
- if (geo_iterator_. first != geo_iterator_. second )
629
+ if (geo_itr_ != geo_end_itr_ )
629
630
{
630
- uint32_t cmd_length = static_cast <uint32_t >(*geo_iterator_. first ++);
631
+ uint32_t cmd_length = static_cast <uint32_t >(*geo_itr_ ++);
631
632
cmd = cmd_length & 0x7 ;
632
633
length = cmd_length >> 3 ;
633
634
if (cmd == move_to)
@@ -642,8 +643,8 @@ typename GeometryPBF::command GeometryPBF::line_next(value_type & rx,
642
643
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
643
644
// "end of buffer exception"
644
645
// While this error message is not verbose a try catch here would slow down processing.
645
- int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
646
- int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
646
+ int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
647
+ int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
647
648
detail::move_cursor (x, y, dx, dy);
648
649
rx = x;
649
650
ry = y;
@@ -680,8 +681,8 @@ typename GeometryPBF::command GeometryPBF::line_next(value_type & rx,
680
681
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
681
682
// "end of buffer exception"
682
683
// While this error message is not verbose a try catch here would slow down processing.
683
- int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
684
- int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
684
+ int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
685
+ int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
685
686
if (skip_lineto_zero && dx == 0 && dy == 0 )
686
687
{
687
688
// We are going to skip this vertex as the point doesn't move call line_next again
@@ -699,9 +700,9 @@ typename GeometryPBF::command GeometryPBF::ring_next(value_type & rx,
699
700
{
700
701
if (length == 0 )
701
702
{
702
- if (geo_iterator_. first != geo_iterator_. second )
703
+ if (geo_itr_ != geo_end_itr_ )
703
704
{
704
- uint32_t cmd_length = static_cast <uint32_t >(*geo_iterator_. first ++);
705
+ uint32_t cmd_length = static_cast <uint32_t >(*geo_itr_ ++);
705
706
cmd = cmd_length & 0x7 ;
706
707
length = cmd_length >> 3 ;
707
708
if (cmd == move_to)
@@ -716,8 +717,8 @@ typename GeometryPBF::command GeometryPBF::ring_next(value_type & rx,
716
717
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
717
718
// "end of buffer exception"
718
719
// While this error message is not verbose a try catch here would slow down processing.
719
- int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
720
- int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
720
+ int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
721
+ int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
721
722
detail::move_cursor (x, y, dx, dy);
722
723
rx = x;
723
724
ry = y;
@@ -759,8 +760,8 @@ typename GeometryPBF::command GeometryPBF::ring_next(value_type & rx,
759
760
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
760
761
// "end of buffer exception"
761
762
// While this error message is not verbose a try catch here would slow down processing.
762
- int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
763
- int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_iterator_. first ++));
763
+ int32_t dx = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
764
+ int32_t dy = protozero::decode_zigzag32 (static_cast <uint32_t >(*geo_itr_ ++));
764
765
if (skip_lineto_zero && dx == 0 && dy == 0 )
765
766
{
766
767
// We are going to skip this vertex as the point doesn't move call ring_next again
0 commit comments