Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created September 14, 2010 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save springmeyer/579264 to your computer and use it in GitHub Desktop.
Save springmeyer/579264 to your computer and use it in GitHub Desktop.
Index: plugins/input/shape/dbffile.hpp
===================================================================
--- plugins/input/shape/dbffile.hpp (revision 2199)
+++ plugins/input/shape/dbffile.hpp (working copy)
@@ -36,6 +36,7 @@
using mapnik::transcoder;
using mapnik::Feature;
+using namespace boost::iostreams;
struct field_descriptor
{
@@ -44,17 +45,16 @@
char type_;
int length_;
int dec_;
- int offset_;
+ stream_offset offset_;
};
-using namespace boost::iostreams;
class dbf_file
{
private:
int num_records_;
int num_fields_;
- int record_length_;
+ stream_offset record_length_;
std::vector<field_descriptor> fields_;
#ifdef SHAPE_MEMORY_MAPPED_FILE
stream<mapped_file_source> file_;
Index: plugins/input/shape/shp_index.hpp
===================================================================
--- plugins/input/shape/shp_index.hpp (revision 2199)
+++ plugins/input/shape/shp_index.hpp (working copy)
@@ -58,7 +58,7 @@
template <typename filterT, typename IStream>
void shp_index<filterT,IStream>::query_node(const filterT& filter,IStream & file,std::vector<int>& ids)
{
- int offset=read_ndr_integer(file);
+ stream_offset offset=read_ndr_integer(file);
box2d<double> node_ext;
read_envelope(file,node_ext);
Index: plugins/input/shape/dbffile.cpp
===================================================================
--- plugins/input/shape/dbffile.cpp (revision 2199)
+++ plugins/input/shape/dbffile.cpp (working copy)
@@ -91,7 +91,7 @@
{
if (index>0 && index<=num_records_)
{
- long pos=(num_fields_<<5)+34+(index-1)*(record_length_+1);
+ stream_offset pos=(num_fields_<<5)+34+(index-1)*(record_length_+1);
file_.seekg(pos,std::ios::beg);
file_.read(record_,record_length_);
}
@@ -179,7 +179,7 @@
assert(num_fields_>0);
num_fields_=(num_fields_-33)/32;
skip(22);
- int offset=0;
+ stream_offset offset=0;
char name[11];
memset(&name,0,11);
fields_.reserve(num_fields_);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment