diff --git a/INSTALL b/INSTALL index bfba4b822..b060bc284 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,26 @@ -Installation Instructions -************************* +INSTALLATION INSTRUCTIONS + +Prerequisites +First of all you will have to install 'scons'. See scons user guide on how to get started. + +Mapnik is relying on a number of boost libraries (filesystem, python, regex, spirit etc). You can download the latest release (1.32.0) or grab a CVS snapshot from http://boost.org. You don't need to build anything, just unzip the source into read/write location on your disk. + +The same requirements apply for AGG library (available from http://www.antigrain.com) + +Other dependencies include: +1. libltdl (dynamic linking) +2. libz +3. libpng +4. libjpeg +5. freetype2 +6. postgresql (+postgis) + +Building +Once you satisfy all dependencies you can build mapnik by issuing the following command: + +:/> scons DATASOURCES=postgis PREFIX=/where/to/install install + +This should compile, link and install all relevant libraries/headers in PREFIX. + +By default release versions are built, but you can specify "debug=yes" to build debug versions. At this time only GCC toolkit is supported and you'll have to modify SConstruct/SConscript files if you're planning to use something else. -TODO! diff --git a/README b/README index e69de29bb..762b4b069 100644 --- a/README +++ b/README @@ -0,0 +1 @@ +See INSTALL file for installation instructions diff --git a/datasources/postgis/postgis.cpp b/datasources/postgis/postgis.cpp index c9b7785f6..b782aaf26 100644 --- a/datasources/postgis/postgis.cpp +++ b/datasources/postgis/postgis.cpp @@ -126,6 +126,9 @@ PostgisDatasource::PostgisDatasource(const Parameters& params) case 23: // int4 desc_.add_descriptor(attribute_descriptor(fld_name,Integer,false,length)); break; + case 701: // float8 + desc_.add_descriptor(attribute_descriptor(fld_name,Double,false,length)); + case 1042: // bpchar case 1043: // varchar desc_.add_descriptor(attribute_descriptor(fld_name,String)); break; diff --git a/datasources/postgis/postgisfs.cpp b/datasources/postgis/postgisfs.cpp index d10e7f785..769799aa2 100644 --- a/datasources/postgis/postgisfs.cpp +++ b/datasources/postgis/postgisfs.cpp @@ -30,11 +30,7 @@ PostgisFeatureset::PostgisFeatureset(const ref_ptr& rs, : rs_(rs), num_attrs_(num_attrs), totalGeomSize_(0), - count_(0) -{ - -} - + count_(0) {} Feature* PostgisFeatureset::next() { @@ -42,7 +38,7 @@ Feature* PostgisFeatureset::next() if (rs_->next()) { const char* buf = rs_->getValue(0); - int id = (buf[0]&255) << 24 | (buf[1]&255) << 16 | (buf[2] & 255) << 8 | buf[3] & 255; + int id = int4net(buf); int size=rs_->getFieldLength(1); const char *data=rs_->getValue(1); @@ -59,12 +55,30 @@ Feature* PostgisFeatureset::next() const char* buf=rs_->getValue(start + pos); int field_size = rs_->getFieldLength(start + pos); int oid = rs_->getTypeOID(start + pos); - if (oid==23) + + if (oid==23) //int4 { - int val = (buf[0]&255) << 24 | (buf[1]&255) << 16 | (buf[2] & 255) << 8 | buf[3] & 255; + int val = int4net(buf); feature->add_property(val); } - else if (oid==1043) + else if (oid==21) //int2 + { + int val = int2net(buf); + feature->add_property(val); + } + else if (oid == 700) // float4 + { + float val; + float4net(val,buf); + feature->add_property((double)val); + } + else if (oid == 701) // float8 + { + double val; + float8net(val,buf); + feature->add_property(val); + } + else if (oid==1042 || oid==1043) //bpchar or varchar { feature->add_property(string(buf)); } diff --git a/include/mapnik.hpp b/include/mapnik.hpp index ccb524502..155c890cf 100644 --- a/include/mapnik.hpp +++ b/include/mapnik.hpp @@ -24,6 +24,7 @@ #include #include #include +#include "global.hpp" #include "ptr.hpp" #include "factory.hpp" #include "filter.hpp" @@ -65,12 +66,10 @@ #include "filter_factory.hpp" #include "text_symbolizer.hpp" #include "label_placement.hpp" - #include "feature_layer_desc.hpp" namespace mapnik { - //typedef geometry_type geometry_type; } #endif //MAPNIK_HPP