remove tabs
This commit is contained in:
parent
819a67fd42
commit
5a1842aad1
40 changed files with 702 additions and 696 deletions
|
@ -27,10 +27,10 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
gdal_src = Split(
|
gdal_src = Split(
|
||||||
"""
|
"""
|
||||||
gdal_datasource.cpp
|
gdal_datasource.cpp
|
||||||
gdal_featureset.cpp
|
gdal_featureset.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = [env['PLUGINS']['gdal']['lib']]
|
libraries = [env['PLUGINS']['gdal']['lib']]
|
||||||
|
|
|
@ -28,10 +28,10 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
geos_src = Split(
|
geos_src = Split(
|
||||||
"""
|
"""
|
||||||
geos_datasource.cpp
|
geos_datasource.cpp
|
||||||
geos_featureset.cpp
|
geos_featureset.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = [env['PLUGINS']['geos']['lib']]
|
libraries = [env['PLUGINS']['geos']['lib']]
|
||||||
|
|
|
@ -27,10 +27,10 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
kismet_src = Split(
|
kismet_src = Split(
|
||||||
"""
|
"""
|
||||||
kismet_datasource.cpp
|
kismet_datasource.cpp
|
||||||
kismet_featureset.cpp
|
kismet_featureset.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = []
|
libraries = []
|
||||||
|
|
|
@ -27,13 +27,13 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
occi_src = Split(
|
occi_src = Split(
|
||||||
"""
|
"""
|
||||||
occi_types.cpp
|
occi_types.cpp
|
||||||
occi_datasource.cpp
|
occi_datasource.cpp
|
||||||
occi_featureset.cpp
|
occi_featureset.cpp
|
||||||
spatial_classesm.cpp
|
spatial_classesm.cpp
|
||||||
spatial_classeso.cpp
|
spatial_classeso.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = [ 'occi', 'ociei' ]
|
libraries = [ 'occi', 'ociei' ]
|
||||||
|
|
|
@ -189,7 +189,7 @@ feature_ptr occi_featureset::next()
|
||||||
std::clog << "OCCI Plugin: unknown datatype (type_oid=" << type_oid << ")" << std::endl;
|
std::clog << "OCCI Plugin: unknown datatype (type_oid=" << type_oid << ")" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
++count_;
|
++count_;
|
||||||
|
|
|
@ -28,12 +28,12 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
ogr_src = Split(
|
ogr_src = Split(
|
||||||
"""
|
"""
|
||||||
ogr_converter.cpp
|
ogr_converter.cpp
|
||||||
ogr_datasource.cpp
|
ogr_datasource.cpp
|
||||||
ogr_featureset.cpp
|
ogr_featureset.cpp
|
||||||
ogr_index_featureset.cpp
|
ogr_index_featureset.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = [env['PLUGINS']['ogr']['lib']]
|
libraries = [env['PLUGINS']['ogr']['lib']]
|
||||||
|
|
|
@ -300,7 +300,7 @@ featureset_ptr ogr_datasource::features(query const& q) const
|
||||||
{
|
{
|
||||||
s <<",\""<<*pos<<"\"";
|
s <<",\""<<*pos<<"\"";
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
s << " from " << layerName_ ;
|
s << " from " << layerName_ ;
|
||||||
|
|
||||||
// execute existing SQL
|
// execute existing SQL
|
||||||
|
@ -353,8 +353,8 @@ featureset_ptr ogr_datasource::features_at_point(coord2d const& pt) const
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OGRPoint point;
|
OGRPoint point;
|
||||||
point.setX (pt.x);
|
point.setX (pt.x);
|
||||||
point.setY (pt.y);
|
point.setY (pt.y);
|
||||||
|
|
||||||
return featureset_ptr(new ogr_featureset (*dataset_,
|
return featureset_ptr(new ogr_featureset (*dataset_,
|
||||||
*layer_,
|
*layer_,
|
||||||
|
|
|
@ -3,7 +3,7 @@ LDFLAGS = `xml2-config --libs` -L/usr/local/lib
|
||||||
LDFLAGS5 = `xml2-config --libs` -L/usr/local/lib -lmapnik
|
LDFLAGS5 = `xml2-config --libs` -L/usr/local/lib -lmapnik
|
||||||
OBJ = test.o osm.o osmparser.o
|
OBJ = test.o osm.o osmparser.o
|
||||||
test: $(OBJ)
|
test: $(OBJ)
|
||||||
g++ -o test $(OBJ) $(LDFLAGS)
|
g++ -o test $(OBJ) $(LDFLAGS)
|
||||||
render: render.o
|
render: render.o
|
||||||
g++ -o render render.o $(LDFLAGS5)
|
g++ -o render render.o $(LDFLAGS5)
|
||||||
|
|
||||||
|
|
|
@ -27,14 +27,14 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
osm_src = Split(
|
osm_src = Split(
|
||||||
"""
|
"""
|
||||||
osmparser.cpp
|
osmparser.cpp
|
||||||
osm.cpp
|
osm.cpp
|
||||||
osm_datasource.cpp
|
osm_datasource.cpp
|
||||||
osm_featureset.cpp
|
osm_featureset.cpp
|
||||||
dataset_deliverer.cpp
|
dataset_deliverer.cpp
|
||||||
basiccurl.cpp
|
basiccurl.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = [ 'xml2' ]
|
libraries = [ 'xml2' ]
|
||||||
|
|
|
@ -2,44 +2,44 @@
|
||||||
|
|
||||||
CURL_LOAD_DATA *grab_http_response(const char *url)
|
CURL_LOAD_DATA *grab_http_response(const char *url)
|
||||||
{
|
{
|
||||||
CURL_LOAD_DATA *data;
|
CURL_LOAD_DATA *data;
|
||||||
|
|
||||||
CURL *curl = curl_easy_init();
|
CURL *curl = curl_easy_init();
|
||||||
|
|
||||||
if(curl)
|
if(curl)
|
||||||
{
|
{
|
||||||
data = do_grab(curl,url);
|
data = do_grab(curl,url);
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURL_LOAD_DATA *do_grab(CURL *curl,const char *url)
|
CURL_LOAD_DATA *do_grab(CURL *curl,const char *url)
|
||||||
{
|
{
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
CURL_LOAD_DATA *data = (CURL_LOAD_DATA *)malloc(sizeof(CURL_LOAD_DATA));
|
CURL_LOAD_DATA *data = (CURL_LOAD_DATA *)malloc(sizeof(CURL_LOAD_DATA));
|
||||||
data->data = NULL;
|
data->data = NULL;
|
||||||
data->nbytes = 0;
|
data->nbytes = 0;
|
||||||
|
|
||||||
curl_easy_setopt(curl,CURLOPT_URL,url);
|
curl_easy_setopt(curl,CURLOPT_URL,url);
|
||||||
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,response_callback);
|
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,response_callback);
|
||||||
curl_easy_setopt(curl,CURLOPT_WRITEDATA,data);
|
curl_easy_setopt(curl,CURLOPT_WRITEDATA,data);
|
||||||
|
|
||||||
res=curl_easy_perform(curl);
|
res=curl_easy_perform(curl);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t response_callback(void *ptr,size_t size,size_t nmemb, void *d)
|
size_t response_callback(void *ptr,size_t size,size_t nmemb, void *d)
|
||||||
{
|
{
|
||||||
size_t rsize=size*nmemb;
|
size_t rsize=size*nmemb;
|
||||||
CURL_LOAD_DATA *data=(CURL_LOAD_DATA *)d;
|
CURL_LOAD_DATA *data=(CURL_LOAD_DATA *)d;
|
||||||
// fprintf(stderr,"rsize is %d\n", rsize);
|
// fprintf(stderr,"rsize is %d\n", rsize);
|
||||||
data->data=(char *)realloc(data->data,(data->nbytes+rsize)
|
data->data=(char *)realloc(data->data,(data->nbytes+rsize)
|
||||||
*sizeof(char));
|
*sizeof(char));
|
||||||
memcpy(&(data->data[data->nbytes]),ptr,rsize);
|
memcpy(&(data->data[data->nbytes]),ptr,rsize);
|
||||||
data->nbytes += rsize;
|
data->nbytes += rsize;
|
||||||
// fprintf(stderr,"data->nbytes is %d\n", data->nbytes);
|
// fprintf(stderr,"data->nbytes is %d\n", data->nbytes);
|
||||||
return rsize;
|
return rsize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *data;
|
char *data;
|
||||||
int nbytes;
|
int nbytes;
|
||||||
} CURL_LOAD_DATA;
|
} CURL_LOAD_DATA;
|
||||||
|
|
||||||
CURL_LOAD_DATA *grab_http_response(const char *url);
|
CURL_LOAD_DATA *grab_http_response(const char *url);
|
||||||
|
|
|
@ -7,50 +7,50 @@ std::string dataset_deliverer::last_bbox = "";
|
||||||
std::string dataset_deliverer::last_filename = "";
|
std::string dataset_deliverer::last_filename = "";
|
||||||
|
|
||||||
osm_dataset* dataset_deliverer::load_from_file(const string& file,
|
osm_dataset* dataset_deliverer::load_from_file(const string& file,
|
||||||
const string& parser)
|
const string& parser)
|
||||||
{
|
{
|
||||||
// Only actually load from file if we haven't done so already
|
// Only actually load from file if we haven't done so already
|
||||||
if(dataset == NULL)
|
if(dataset == NULL)
|
||||||
{
|
{
|
||||||
dataset = new osm_dataset;
|
dataset = new osm_dataset;
|
||||||
if(dataset->load(file.c_str(),parser)==false)
|
if(dataset->load(file.c_str(),parser)==false)
|
||||||
return NULL;
|
return NULL;
|
||||||
atexit(dataset_deliverer::release);
|
atexit(dataset_deliverer::release);
|
||||||
last_filename = file;
|
last_filename = file;
|
||||||
}
|
}
|
||||||
else if(file != last_filename)
|
else if(file != last_filename)
|
||||||
{
|
{
|
||||||
dataset = new osm_dataset;
|
dataset = new osm_dataset;
|
||||||
if(dataset->load(file.c_str(),parser)==false)
|
if(dataset->load(file.c_str(),parser)==false)
|
||||||
return NULL;
|
return NULL;
|
||||||
last_filename = file;
|
last_filename = file;
|
||||||
}
|
}
|
||||||
return dataset;
|
return dataset;
|
||||||
}
|
}
|
||||||
|
|
||||||
osm_dataset* dataset_deliverer::load_from_url
|
osm_dataset* dataset_deliverer::load_from_url
|
||||||
(const string& url,const string& bbox,const string& parser)
|
(const string& url,const string& bbox,const string& parser)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(dataset==NULL)
|
if(dataset==NULL)
|
||||||
{
|
{
|
||||||
dataset = new osm_dataset;
|
dataset = new osm_dataset;
|
||||||
if(dataset->load_from_url(url.c_str(),bbox,parser)==false)
|
if(dataset->load_from_url(url.c_str(),bbox,parser)==false)
|
||||||
return NULL;
|
return NULL;
|
||||||
atexit(dataset_deliverer::release);
|
atexit(dataset_deliverer::release);
|
||||||
last_bbox = bbox;
|
last_bbox = bbox;
|
||||||
}
|
}
|
||||||
else if (bbox != last_bbox)
|
else if (bbox != last_bbox)
|
||||||
{
|
{
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<<"BBOXES ARE DIFFERENT: " << last_bbox<<","<<bbox<<endl;
|
cerr<<"BBOXES ARE DIFFERENT: " << last_bbox<<","<<bbox<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Reload the dataset
|
// Reload the dataset
|
||||||
dataset->clear();
|
dataset->clear();
|
||||||
if(dataset->load_from_url(url.c_str(),bbox,parser)==false)
|
if(dataset->load_from_url(url.c_str(),bbox,parser)==false)
|
||||||
return NULL;
|
return NULL;
|
||||||
last_bbox = bbox;
|
last_bbox = bbox;
|
||||||
}
|
}
|
||||||
return dataset;
|
return dataset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,16 @@ using std::vector;
|
||||||
|
|
||||||
struct ScreenPos
|
struct ScreenPos
|
||||||
{
|
{
|
||||||
int x,y;
|
int x,y;
|
||||||
ScreenPos() { x=y=0; }
|
ScreenPos() { x=y=0; }
|
||||||
ScreenPos(int x,int y) { this->x=x; this->y=y; }
|
ScreenPos(int x,int y) { this->x=x; this->y=y; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EarthPoint
|
struct EarthPoint
|
||||||
{
|
{
|
||||||
double x,y;
|
double x,y;
|
||||||
EarthPoint() { x=y=0.0; }
|
EarthPoint() { x=y=0.0; }
|
||||||
EarthPoint(double x,double y) { this->x=x; this->y=y; }
|
EarthPoint(double x,double y) { this->x=x; this->y=y; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class GoogleProjection
|
class GoogleProjection
|
||||||
|
@ -29,69 +29,69 @@ class GoogleProjection
|
||||||
vector<double> Bc,Cc,zc,Ac;
|
vector<double> Bc,Cc,zc,Ac;
|
||||||
int levels;
|
int levels;
|
||||||
|
|
||||||
double minmax (double a,double b, double c)
|
double minmax (double a,double b, double c)
|
||||||
{
|
{
|
||||||
a = max(a,b);
|
a = max(a,b);
|
||||||
a = min(a,c);
|
a = min(a,c);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GoogleProjection(int levels=18)
|
GoogleProjection(int levels=18)
|
||||||
{
|
{
|
||||||
this->levels=levels;
|
this->levels=levels;
|
||||||
double c = 256;
|
double c = 256;
|
||||||
double e;
|
double e;
|
||||||
for (int d=0; d<levels; d++)
|
for (int d=0; d<levels; d++)
|
||||||
{
|
{
|
||||||
e = c/2;
|
e = c/2;
|
||||||
Bc.push_back(c/360.0);
|
Bc.push_back(c/360.0);
|
||||||
Cc.push_back(c/(2 * M_PI));
|
Cc.push_back(c/(2 * M_PI));
|
||||||
zc.push_back(e);
|
zc.push_back(e);
|
||||||
Ac.push_back(c);
|
Ac.push_back(c);
|
||||||
c *= 2;
|
c *= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenPos fromLLToPixel(double lon,double lat,int zoom)
|
ScreenPos fromLLToPixel(double lon,double lat,int zoom)
|
||||||
{
|
{
|
||||||
double d = zc[zoom];
|
double d = zc[zoom];
|
||||||
double e = round(d + lon * Bc[zoom]);
|
double e = round(d + lon * Bc[zoom]);
|
||||||
double f = minmax(sin((M_PI/180.0) * lat),-0.9999,0.9999);
|
double f = minmax(sin((M_PI/180.0) * lat),-0.9999,0.9999);
|
||||||
double g = round(d + 0.5*log((1+f)/(1-f))*-Cc[zoom]);
|
double g = round(d + 0.5*log((1+f)/(1-f))*-Cc[zoom]);
|
||||||
return ScreenPos(e,g);
|
return ScreenPos(e,g);
|
||||||
}
|
}
|
||||||
|
|
||||||
EarthPoint fromPixelToLL(int x,int y,int zoom)
|
EarthPoint fromPixelToLL(int x,int y,int zoom)
|
||||||
{
|
{
|
||||||
double e = zc[zoom];
|
double e = zc[zoom];
|
||||||
double f = (x - e)/Bc[zoom];
|
double f = (x - e)/Bc[zoom];
|
||||||
double g = (y - e)/-Cc[zoom];
|
double g = (y - e)/-Cc[zoom];
|
||||||
double h = (180.0/M_PI) * ( 2 * atan(exp(g)) - 0.5 * M_PI);
|
double h = (180.0/M_PI) * ( 2 * atan(exp(g)) - 0.5 * M_PI);
|
||||||
return EarthPoint(f,h);
|
return EarthPoint(f,h);
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert to the zoom independent Google system; TBH I don't really
|
// convert to the zoom independent Google system; TBH I don't really
|
||||||
// understand what it represents....
|
// understand what it represents....
|
||||||
static EarthPoint fromLLToGoog(double lon,double lat)
|
static EarthPoint fromLLToGoog(double lon,double lat)
|
||||||
{
|
{
|
||||||
double a = log(tan((90+lat)*M_PI / 360))/(M_PI / 180);
|
double a = log(tan((90+lat)*M_PI / 360))/(M_PI / 180);
|
||||||
double custLat = a * 20037508.34 / 180;
|
double custLat = a * 20037508.34 / 180;
|
||||||
double custLon=lon;
|
double custLon=lon;
|
||||||
custLon = custLon * 20037508.34 / 180;
|
custLon = custLon * 20037508.34 / 180;
|
||||||
return EarthPoint(custLon,custLat);
|
return EarthPoint(custLon,custLat);
|
||||||
}
|
}
|
||||||
|
|
||||||
// other way round
|
// other way round
|
||||||
static EarthPoint fromGoogToLL(double x,double y)
|
static EarthPoint fromGoogToLL(double x,double y)
|
||||||
{
|
{
|
||||||
double lat_deg,lon_deg;
|
double lat_deg,lon_deg;
|
||||||
lat_deg = (y / 20037508.34) * 180;
|
lat_deg = (y / 20037508.34) * 180;
|
||||||
lon_deg = (x / 20037508.34) * 180;
|
lon_deg = (x / 20037508.34) * 180;
|
||||||
lat_deg = 180/M_PI *
|
lat_deg = 180/M_PI *
|
||||||
(2 * atan(exp(lat_deg * M_PI / 180)) - M_PI / 2);
|
(2 * atan(exp(lat_deg * M_PI / 180)) - M_PI / 2);
|
||||||
return EarthPoint(lon_deg,lat_deg);
|
return EarthPoint(lon_deg,lat_deg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GOOGLEPROJECTION_H
|
#endif // GOOGLEPROJECTION_H
|
||||||
|
|
|
@ -132,23 +132,23 @@ void MapSource::generateMaps()
|
||||||
bottomRight.x /= 256;
|
bottomRight.x /= 256;
|
||||||
bottomRight.y /= 256;
|
bottomRight.y /= 256;
|
||||||
|
|
||||||
int x_fetch_freq, y_fetch_freq, x_fetches, y_fetches;
|
int x_fetch_freq, y_fetch_freq, x_fetches, y_fetches;
|
||||||
|
|
||||||
if(multirqst)
|
if(multirqst)
|
||||||
{
|
{
|
||||||
// Gives a value approx equal to 0.1 lat/lon in southern UK
|
// Gives a value approx equal to 0.1 lat/lon in southern UK
|
||||||
x_fetch_freq = (int)(pow(2.0,zoom_start-11));
|
x_fetch_freq = (int)(pow(2.0,zoom_start-11));
|
||||||
y_fetch_freq = (int)(pow(2.0,zoom_start-11));
|
y_fetch_freq = (int)(pow(2.0,zoom_start-11));
|
||||||
x_fetches = ((bottomRight.x-topLeft.x) / x_fetch_freq)+1,
|
x_fetches = ((bottomRight.x-topLeft.x) / x_fetch_freq)+1,
|
||||||
y_fetches = ((bottomRight.y-topLeft.y) / y_fetch_freq)+1;
|
y_fetches = ((bottomRight.y-topLeft.y) / y_fetch_freq)+1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x_fetch_freq = bottomRight.x - topLeft.x;
|
x_fetch_freq = bottomRight.x - topLeft.x;
|
||||||
y_fetch_freq = bottomRight.y - topLeft.y;
|
y_fetch_freq = bottomRight.y - topLeft.y;
|
||||||
x_fetches = 1;
|
x_fetches = 1;
|
||||||
y_fetches = 1;
|
y_fetches = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr,"topLeft: %d %d\n",topLeft.x,topLeft.y);
|
fprintf(stderr,"topLeft: %d %d\n",topLeft.x,topLeft.y);
|
||||||
fprintf(stderr,"bottomRight: %d %d\n",bottomRight.x,bottomRight.y);
|
fprintf(stderr,"bottomRight: %d %d\n",bottomRight.x,bottomRight.y);
|
||||||
|
@ -170,7 +170,7 @@ void MapSource::generateMaps()
|
||||||
*256, zoom_start),
|
*256, zoom_start),
|
||||||
bottomR_LL =
|
bottomR_LL =
|
||||||
proj.fromPixelToLL( ((topLeft.x+xfetch*x_fetch_freq)+
|
proj.fromPixelToLL( ((topLeft.x+xfetch*x_fetch_freq)+
|
||||||
x_fetch_freq)*256,
|
x_fetch_freq)*256,
|
||||||
((topLeft.y+yfetch*y_fetch_freq)
|
((topLeft.y+yfetch*y_fetch_freq)
|
||||||
+y_fetch_freq)*256, zoom_start),
|
+y_fetch_freq)*256, zoom_start),
|
||||||
topL_LL =
|
topL_LL =
|
||||||
|
@ -179,10 +179,10 @@ void MapSource::generateMaps()
|
||||||
(topLeft.y+yfetch*y_fetch_freq)
|
(topLeft.y+yfetch*y_fetch_freq)
|
||||||
*256, zoom_start);
|
*256, zoom_start);
|
||||||
|
|
||||||
double w1 = min(bottomL_LL.x-0.01,topL_LL.x-0.01),
|
double w1 = min(bottomL_LL.x-0.01,topL_LL.x-0.01),
|
||||||
s1 = min(bottomL_LL.y-0.01,bottomR_LL.y-0.01),
|
s1 = min(bottomL_LL.y-0.01,bottomR_LL.y-0.01),
|
||||||
e1 = max(bottomR_LL.x+0.01,topR_LL.x+0.01),
|
e1 = max(bottomR_LL.x+0.01,topR_LL.x+0.01),
|
||||||
n1 = max(topL_LL.y+0.01,topR_LL.y+0.01);
|
n1 = max(topL_LL.y+0.01,topR_LL.y+0.01);
|
||||||
|
|
||||||
parameters p;
|
parameters p;
|
||||||
if(getSource()=="api")
|
if(getSource()=="api")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
CXXFLAGS = `xml2-config --cflags` -I/usr/local/include/mapnik -I/usr/include/boost -I/usr/include/freetype2 -I/home/nick/mapnik-osm/agg/include -fPIC -g
|
CXXFLAGS = `xml2-config --cflags` -I/usr/local/include/mapnik -I/usr/include/boost -I/usr/include/freetype2 -I/home/nick/mapnik-osm/agg/include -fPIC -g
|
||||||
MAPNIK_OSM_OBJ = osmparser.o osm.o osm_datasource.o osm_featureset.o
|
MAPNIK_OSM_OBJ = osmparser.o osm.o osm_datasource.o osm_featureset.o
|
||||||
osm.input: $(MAPNIK_OSM_OBJ)
|
osm.input: $(MAPNIK_OSM_OBJ)
|
||||||
g++ -shared -o osm.input $(MAPNIK_OSM_OBJ)
|
g++ -shared -o osm.input $(MAPNIK_OSM_OBJ)
|
||||||
|
|
|
@ -15,86 +15,86 @@ polygon_types osm_way::ptypes;
|
||||||
|
|
||||||
bool osm_dataset::load(const char* filename,const std::string& parser)
|
bool osm_dataset::load(const char* filename,const std::string& parser)
|
||||||
{
|
{
|
||||||
if (parser=="libxml2")
|
if (parser=="libxml2")
|
||||||
{
|
{
|
||||||
return osmparser::parse(this,filename);
|
return osmparser::parse(this,filename);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool osm_dataset::load_from_url(const std::string& url,
|
bool osm_dataset::load_from_url(const std::string& url,
|
||||||
const std::string& bbox,
|
const std::string& bbox,
|
||||||
const std::string& parser)
|
const std::string& parser)
|
||||||
{
|
{
|
||||||
if(parser=="libxml2")
|
if(parser=="libxml2")
|
||||||
{
|
{
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<<"osm_dataset::load_from_url: url=" << url <<
|
cerr<<"osm_dataset::load_from_url: url=" << url <<
|
||||||
" bbox="<<bbox<<endl;
|
" bbox="<<bbox<<endl;
|
||||||
#endif
|
#endif
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
// use curl to grab the data
|
// use curl to grab the data
|
||||||
// fetch all the data we want - probably from osmxpai
|
// fetch all the data we want - probably from osmxpai
|
||||||
|
|
||||||
str << url << "?bbox=" << bbox;
|
str << url << "?bbox=" << bbox;
|
||||||
|
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr << "FULL URL : " << str.str() << endl;
|
cerr << "FULL URL : " << str.str() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CURL_LOAD_DATA *resp = grab_http_response(str.str().c_str());
|
CURL_LOAD_DATA *resp = grab_http_response(str.str().c_str());
|
||||||
if(resp!=NULL)
|
if(resp!=NULL)
|
||||||
{
|
{
|
||||||
char *blx = new char[resp->nbytes+1];
|
char *blx = new char[resp->nbytes+1];
|
||||||
memcpy(blx,resp->data,resp->nbytes);
|
memcpy(blx,resp->data,resp->nbytes);
|
||||||
blx[resp->nbytes] = '\0';
|
blx[resp->nbytes] = '\0';
|
||||||
|
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<< " CURL RESPONSE: " << blx << endl;
|
cerr<< " CURL RESPONSE: " << blx << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delete[] blx;
|
delete[] blx;
|
||||||
bool success= osmparser::parse(this,resp->data,resp->nbytes);
|
bool success= osmparser::parse(this,resp->data,resp->nbytes);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
osm_dataset::~osm_dataset()
|
osm_dataset::~osm_dataset()
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void osm_dataset::clear()
|
void osm_dataset::clear()
|
||||||
{
|
{
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<<"osm_dataset::clear()"<<endl;
|
cerr<<"osm_dataset::clear()"<<endl;
|
||||||
cerr<<"deleting ways"<<endl;
|
cerr<<"deleting ways"<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(unsigned int count=0; count<ways.size(); count++)
|
for(unsigned int count=0; count<ways.size(); count++)
|
||||||
{
|
{
|
||||||
delete ways[count];
|
delete ways[count];
|
||||||
ways[count]=NULL;
|
ways[count]=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<<"deleting nodes"<<endl;
|
cerr<<"deleting nodes"<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(unsigned int count=0; count<nodes.size(); count++)
|
for(unsigned int count=0; count<nodes.size(); count++)
|
||||||
{
|
{
|
||||||
delete nodes[count];
|
delete nodes[count];
|
||||||
nodes[count]=NULL;
|
nodes[count]=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<<"Clearing ways/nodes"<<endl;
|
cerr<<"Clearing ways/nodes"<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ways.clear();
|
ways.clear();
|
||||||
nodes.clear();
|
nodes.clear();
|
||||||
|
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<<"Done"<<endl;
|
cerr<<"Done"<<endl;
|
||||||
|
@ -103,161 +103,161 @@ void osm_dataset::clear()
|
||||||
|
|
||||||
std::string osm_dataset::to_string()
|
std::string osm_dataset::to_string()
|
||||||
{
|
{
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|
||||||
for(unsigned int count=0; count<nodes.size(); count++)
|
for(unsigned int count=0; count<nodes.size(); count++)
|
||||||
{
|
{
|
||||||
result += nodes[count]->to_string();
|
result += nodes[count]->to_string();
|
||||||
}
|
}
|
||||||
for(unsigned int count=0; count<ways.size(); count++)
|
for(unsigned int count=0; count<ways.size(); count++)
|
||||||
{
|
{
|
||||||
result += ways[count]->to_string();
|
result += ways[count]->to_string();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds osm_dataset::get_bounds()
|
bounds osm_dataset::get_bounds()
|
||||||
{
|
{
|
||||||
bounds b (-180,-90,180,90);
|
bounds b (-180,-90,180,90);
|
||||||
for(unsigned int count=0; count<nodes.size();count++)
|
for(unsigned int count=0; count<nodes.size();count++)
|
||||||
{
|
{
|
||||||
if(nodes[count]->lon > b.w)
|
if(nodes[count]->lon > b.w)
|
||||||
b.w=nodes[count]->lon;
|
b.w=nodes[count]->lon;
|
||||||
if(nodes[count]->lon < b.e)
|
if(nodes[count]->lon < b.e)
|
||||||
b.e=nodes[count]->lon;
|
b.e=nodes[count]->lon;
|
||||||
if(nodes[count]->lat > b.s)
|
if(nodes[count]->lat > b.s)
|
||||||
b.s=nodes[count]->lat;
|
b.s=nodes[count]->lat;
|
||||||
if(nodes[count]->lat < b.n)
|
if(nodes[count]->lat < b.n)
|
||||||
b.n=nodes[count]->lat;
|
b.n=nodes[count]->lat;
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
osm_node *osm_dataset::next_node()
|
osm_node *osm_dataset::next_node()
|
||||||
{
|
{
|
||||||
if(node_i!=nodes.end())
|
if(node_i!=nodes.end())
|
||||||
{
|
{
|
||||||
return *(node_i++);
|
return *(node_i++);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
osm_way *osm_dataset::next_way()
|
osm_way *osm_dataset::next_way()
|
||||||
{
|
{
|
||||||
if(way_i!=ways.end())
|
if(way_i!=ways.end())
|
||||||
{
|
{
|
||||||
return *(way_i++);
|
return *(way_i++);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
osm_item *osm_dataset::next_item()
|
osm_item *osm_dataset::next_item()
|
||||||
{
|
{
|
||||||
osm_item *item=NULL;
|
osm_item *item=NULL;
|
||||||
if(next_item_mode==Node)
|
if(next_item_mode==Node)
|
||||||
{
|
{
|
||||||
item = next_node();
|
item = next_node();
|
||||||
if(item==NULL)
|
if(item==NULL)
|
||||||
{
|
{
|
||||||
next_item_mode=Way;
|
next_item_mode=Way;
|
||||||
rewind_ways();
|
rewind_ways();
|
||||||
item = next_way();
|
item = next_way();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item = next_way();
|
item = next_way();
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<std::string> osm_dataset::get_keys()
|
std::set<std::string> osm_dataset::get_keys()
|
||||||
{
|
{
|
||||||
std::set<std::string> keys;
|
std::set<std::string> keys;
|
||||||
for(unsigned int count=0; count<nodes.size(); count++)
|
for(unsigned int count=0; count<nodes.size(); count++)
|
||||||
{
|
{
|
||||||
for(std::map<std::string,std::string>::iterator i=
|
for(std::map<std::string,std::string>::iterator i=
|
||||||
nodes[count]->keyvals.begin(); i!=nodes[count]->keyvals.end(); i++)
|
nodes[count]->keyvals.begin(); i!=nodes[count]->keyvals.end(); i++)
|
||||||
{
|
{
|
||||||
keys.insert(i->first);
|
keys.insert(i->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(unsigned int count=0; count<ways.size(); count++)
|
for(unsigned int count=0; count<ways.size(); count++)
|
||||||
{
|
{
|
||||||
for(std::map<std::string,std::string>::iterator i=
|
for(std::map<std::string,std::string>::iterator i=
|
||||||
ways[count]->keyvals.begin(); i!=ways[count]->keyvals.end(); i++)
|
ways[count]->keyvals.begin(); i!=ways[count]->keyvals.end(); i++)
|
||||||
{
|
{
|
||||||
keys.insert(i->first);
|
keys.insert(i->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string osm_item::to_string()
|
std::string osm_item::to_string()
|
||||||
{
|
{
|
||||||
std::ostringstream strm;
|
std::ostringstream strm;
|
||||||
strm << "id=" << id << std::endl << "Keyvals: " << std::endl;
|
strm << "id=" << id << std::endl << "Keyvals: " << std::endl;
|
||||||
for(std::map<std::string,std::string>::iterator i=keyvals.begin();
|
for(std::map<std::string,std::string>::iterator i=keyvals.begin();
|
||||||
i!=keyvals.end(); i++)
|
i!=keyvals.end(); i++)
|
||||||
{
|
{
|
||||||
strm << "Key " << i->first << " Value " << i->second << std::endl;
|
strm << "Key " << i->first << " Value " << i->second << std::endl;
|
||||||
}
|
}
|
||||||
return strm.str();
|
return strm.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string osm_node::to_string()
|
std::string osm_node::to_string()
|
||||||
{
|
{
|
||||||
std::ostringstream strm;
|
std::ostringstream strm;
|
||||||
strm << "Node: "<< osm_item::to_string() <<
|
strm << "Node: "<< osm_item::to_string() <<
|
||||||
" Lat=" << lat <<" lon=" <<lon << std::endl;
|
" Lat=" << lat <<" lon=" <<lon << std::endl;
|
||||||
return strm.str();
|
return strm.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string osm_way::to_string()
|
std::string osm_way::to_string()
|
||||||
{
|
{
|
||||||
std::ostringstream strm;
|
std::ostringstream strm;
|
||||||
strm << "Way: " << osm_item::to_string() << "Nodes in way:";
|
strm << "Way: " << osm_item::to_string() << "Nodes in way:";
|
||||||
|
|
||||||
for(unsigned int count=0; count<nodes.size(); count++)
|
for(unsigned int count=0; count<nodes.size(); count++)
|
||||||
{
|
{
|
||||||
if(nodes[count]!=NULL)
|
if(nodes[count]!=NULL)
|
||||||
{
|
{
|
||||||
strm << nodes[count]->id << " ";
|
strm << nodes[count]->id << " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
strm << std::endl;
|
strm << std::endl;
|
||||||
return strm.str();
|
return strm.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds osm_way::get_bounds()
|
bounds osm_way::get_bounds()
|
||||||
{
|
{
|
||||||
bounds b (-180,-90,180,90);
|
bounds b (-180,-90,180,90);
|
||||||
for(unsigned int count=0; count<nodes.size();count++)
|
for(unsigned int count=0; count<nodes.size();count++)
|
||||||
{
|
{
|
||||||
if(nodes[count]->lon > b.w)
|
if(nodes[count]->lon > b.w)
|
||||||
b.w=nodes[count]->lon;
|
b.w=nodes[count]->lon;
|
||||||
if(nodes[count]->lon < b.e)
|
if(nodes[count]->lon < b.e)
|
||||||
b.e=nodes[count]->lon;
|
b.e=nodes[count]->lon;
|
||||||
if(nodes[count]->lat > b.s)
|
if(nodes[count]->lat > b.s)
|
||||||
b.s=nodes[count]->lat;
|
b.s=nodes[count]->lat;
|
||||||
if(nodes[count]->lat < b.n)
|
if(nodes[count]->lat < b.n)
|
||||||
b.n=nodes[count]->lat;
|
b.n=nodes[count]->lat;
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool osm_way::is_polygon()
|
bool osm_way::is_polygon()
|
||||||
{
|
{
|
||||||
for(unsigned int count=0; count<ptypes.ptypes.size(); count++)
|
for(unsigned int count=0; count<ptypes.ptypes.size(); count++)
|
||||||
{
|
{
|
||||||
if(keyvals.find(ptypes.ptypes[count].first) != keyvals.end() &&
|
if(keyvals.find(ptypes.ptypes[count].first) != keyvals.end() &&
|
||||||
keyvals[ptypes.ptypes[count].first] == ptypes.ptypes[count].second)
|
keyvals[ptypes.ptypes[count].first] == ptypes.ptypes[count].second)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
ptypes.push_back(std::pair<std::string,std::string>("natural","heath"));
|
ptypes.push_back(std::pair<std::string,std::string>("natural","heath"));
|
||||||
ptypes.push_back(std::pair<std::string,std::string>("natural","marsh"));
|
ptypes.push_back(std::pair<std::string,std::string>("natural","marsh"));
|
||||||
ptypes.push_back(std::pair<std::string,std::string>("military",
|
ptypes.push_back(std::pair<std::string,std::string>("military",
|
||||||
"danger_area"));
|
"danger_area"));
|
||||||
ptypes.push_back(std::pair<std::string,std::string>
|
ptypes.push_back(std::pair<std::string,std::string>
|
||||||
("landuse","forest"));
|
("landuse","forest"));
|
||||||
ptypes.push_back(std::pair<std::string,std::string>
|
ptypes.push_back(std::pair<std::string,std::string>
|
||||||
|
|
|
@ -71,7 +71,7 @@ void osm_datasource::bind() const
|
||||||
{
|
{
|
||||||
// otherwise if we supplied a url and a bounding box, load from the url
|
// otherwise if we supplied a url and a bounding box, load from the url
|
||||||
#ifdef MAPNIK_DEBUG
|
#ifdef MAPNIK_DEBUG
|
||||||
cerr<<"loading_from_url: url="<<url << " bbox="<<bbox<<endl;
|
cerr<<"loading_from_url: url="<<url << " bbox="<<bbox<<endl;
|
||||||
#endif
|
#endif
|
||||||
if((osm_data_=dataset_deliverer::load_from_url
|
if((osm_data_=dataset_deliverer::load_from_url
|
||||||
(url,bbox,parser))==NULL)
|
(url,bbox,parser))==NULL)
|
||||||
|
|
|
@ -45,22 +45,22 @@ class osm_datasource : public datasource
|
||||||
osm_datasource(const parameters ¶ms, bool bind=true);
|
osm_datasource(const parameters ¶ms, bool bind=true);
|
||||||
virtual ~osm_datasource();
|
virtual ~osm_datasource();
|
||||||
|
|
||||||
// these must be overridden
|
// these must be overridden
|
||||||
int type() const;
|
int type() const;
|
||||||
featureset_ptr features(const query& q) const;
|
featureset_ptr features(const query& q) const;
|
||||||
featureset_ptr features_at_point(coord2d const& pt) const;
|
featureset_ptr features_at_point(coord2d const& pt) const;
|
||||||
box2d<double> envelope() const;
|
box2d<double> envelope() const;
|
||||||
layer_descriptor get_descriptor() const;
|
layer_descriptor get_descriptor() const;
|
||||||
static std::string name();
|
static std::string name();
|
||||||
void bind() const;
|
void bind() const;
|
||||||
private:
|
private:
|
||||||
osm_datasource(const osm_datasource&);
|
osm_datasource(const osm_datasource&);
|
||||||
osm_datasource& operator=(const osm_datasource&);
|
osm_datasource& operator=(const osm_datasource&);
|
||||||
private:
|
private:
|
||||||
mutable box2d<double> extent_;
|
mutable box2d<double> extent_;
|
||||||
mutable osm_dataset * osm_data_;
|
mutable osm_dataset * osm_data_;
|
||||||
int type_;
|
int type_;
|
||||||
mutable layer_descriptor desc_;
|
mutable layer_descriptor desc_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //OSM_DATASOURCE_HPP
|
#endif //OSM_DATASOURCE_HPP
|
||||||
|
|
|
@ -47,8 +47,8 @@ class osm_featureset : public Featureset
|
||||||
mutable box2d<double> feature_ext_;
|
mutable box2d<double> feature_ext_;
|
||||||
mutable int total_geom_size;
|
mutable int total_geom_size;
|
||||||
mutable int count_;
|
mutable int count_;
|
||||||
osm_dataset *dataset_;
|
osm_dataset *dataset_;
|
||||||
std::set<std::string> attribute_names_;
|
std::set<std::string> attribute_names_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
osm_featureset(const filterT& filter,
|
osm_featureset(const filterT& filter,
|
||||||
|
|
|
@ -18,140 +18,140 @@ using std::endl;
|
||||||
|
|
||||||
void osmparser::processNode(xmlTextReaderPtr reader)
|
void osmparser::processNode(xmlTextReaderPtr reader)
|
||||||
{
|
{
|
||||||
xmlChar *name = xmlTextReaderName(reader);
|
xmlChar *name = xmlTextReaderName(reader);
|
||||||
if(name==NULL)
|
if(name==NULL)
|
||||||
name=xmlStrdup(BAD_CAST "--");
|
name=xmlStrdup(BAD_CAST "--");
|
||||||
|
|
||||||
switch(xmlTextReaderNodeType(reader))
|
switch(xmlTextReaderNodeType(reader))
|
||||||
{
|
{
|
||||||
case XML_READER_TYPE_ELEMENT:
|
case XML_READER_TYPE_ELEMENT:
|
||||||
startElement(reader,name);
|
startElement(reader,name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XML_READER_TYPE_END_ELEMENT:
|
case XML_READER_TYPE_END_ELEMENT:
|
||||||
endElement(name);
|
endElement(name);
|
||||||
}
|
}
|
||||||
xmlFree(name);
|
xmlFree(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void osmparser::startElement(xmlTextReaderPtr reader, const xmlChar *name)
|
void osmparser::startElement(xmlTextReaderPtr reader, const xmlChar *name)
|
||||||
{
|
{
|
||||||
std::string tags;
|
std::string tags;
|
||||||
xmlChar *xid, *xlat, *xlon, *xk, *xv;
|
xmlChar *xid, *xlat, *xlon, *xk, *xv;
|
||||||
|
|
||||||
if(xmlStrEqual(name,BAD_CAST "node"))
|
if(xmlStrEqual(name,BAD_CAST "node"))
|
||||||
{
|
{
|
||||||
curID = 0;
|
curID = 0;
|
||||||
in_node = true;
|
in_node = true;
|
||||||
osm_node *node=new osm_node;
|
osm_node *node=new osm_node;
|
||||||
xlat=xmlTextReaderGetAttribute(reader,BAD_CAST "lat");
|
xlat=xmlTextReaderGetAttribute(reader,BAD_CAST "lat");
|
||||||
xlon=xmlTextReaderGetAttribute(reader,BAD_CAST "lon");
|
xlon=xmlTextReaderGetAttribute(reader,BAD_CAST "lon");
|
||||||
xid=xmlTextReaderGetAttribute(reader,BAD_CAST "id");
|
xid=xmlTextReaderGetAttribute(reader,BAD_CAST "id");
|
||||||
assert(xlat);
|
assert(xlat);
|
||||||
assert(xlon);
|
assert(xlon);
|
||||||
assert(xid);
|
assert(xid);
|
||||||
node->lat=atof((char*)xlat);
|
node->lat=atof((char*)xlat);
|
||||||
node->lon=atof((char*)xlon);
|
node->lon=atof((char*)xlon);
|
||||||
node->id = atol((char*)xid);
|
node->id = atol((char*)xid);
|
||||||
cur_item = node;
|
cur_item = node;
|
||||||
tmp_node_store[node->id] = node;
|
tmp_node_store[node->id] = node;
|
||||||
xmlFree(xid);
|
xmlFree(xid);
|
||||||
xmlFree(xlon);
|
xmlFree(xlon);
|
||||||
xmlFree(xlat);
|
xmlFree(xlat);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(name,BAD_CAST "way"))
|
else if (xmlStrEqual(name,BAD_CAST "way"))
|
||||||
{
|
{
|
||||||
curID=0;
|
curID=0;
|
||||||
in_way = true;
|
in_way = true;
|
||||||
osm_way *way=new osm_way;
|
osm_way *way=new osm_way;
|
||||||
xid=xmlTextReaderGetAttribute(reader,BAD_CAST "id");
|
xid=xmlTextReaderGetAttribute(reader,BAD_CAST "id");
|
||||||
assert(xid);
|
assert(xid);
|
||||||
way->id = atol((char*)xid);
|
way->id = atol((char*)xid);
|
||||||
cur_item = way;
|
cur_item = way;
|
||||||
// Prevent ways with no name being assigned a name of "0"
|
// Prevent ways with no name being assigned a name of "0"
|
||||||
cur_item->keyvals["name"] = "";
|
cur_item->keyvals["name"] = "";
|
||||||
|
|
||||||
// HACK: allows comparison with "" in the XML file. Otherwise it
|
// HACK: allows comparison with "" in the XML file. Otherwise it
|
||||||
// doesn't work. Only do for the most crucial tags for Freemap's
|
// doesn't work. Only do for the most crucial tags for Freemap's
|
||||||
// purposes. TODO investigate why this is
|
// purposes. TODO investigate why this is
|
||||||
cur_item->keyvals["width"] = "";
|
cur_item->keyvals["width"] = "";
|
||||||
cur_item->keyvals["horse"] = "";
|
cur_item->keyvals["horse"] = "";
|
||||||
cur_item->keyvals["foot"] = "";
|
cur_item->keyvals["foot"] = "";
|
||||||
cur_item->keyvals["bicycle"] = "";
|
cur_item->keyvals["bicycle"] = "";
|
||||||
xmlFree(xid);
|
xmlFree(xid);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(name,BAD_CAST "nd"))
|
else if (xmlStrEqual(name,BAD_CAST "nd"))
|
||||||
{
|
{
|
||||||
xid=xmlTextReaderGetAttribute(reader,BAD_CAST "ref");
|
xid=xmlTextReaderGetAttribute(reader,BAD_CAST "ref");
|
||||||
assert(xid);
|
assert(xid);
|
||||||
long ndid = atol((char*)xid);
|
long ndid = atol((char*)xid);
|
||||||
if(tmp_node_store.find(ndid)!=tmp_node_store.end())
|
if(tmp_node_store.find(ndid)!=tmp_node_store.end())
|
||||||
{
|
{
|
||||||
(static_cast<osm_way*>(cur_item))->nodes.push_back
|
(static_cast<osm_way*>(cur_item))->nodes.push_back
|
||||||
(tmp_node_store[ndid]);
|
(tmp_node_store[ndid]);
|
||||||
}
|
}
|
||||||
xmlFree(xid);
|
xmlFree(xid);
|
||||||
}
|
}
|
||||||
else if (xmlStrEqual(name,BAD_CAST "tag"))
|
else if (xmlStrEqual(name,BAD_CAST "tag"))
|
||||||
{
|
{
|
||||||
std::string key="", value="";
|
std::string key="", value="";
|
||||||
xk = xmlTextReaderGetAttribute(reader,BAD_CAST "k");
|
xk = xmlTextReaderGetAttribute(reader,BAD_CAST "k");
|
||||||
xv = xmlTextReaderGetAttribute(reader,BAD_CAST "v");
|
xv = xmlTextReaderGetAttribute(reader,BAD_CAST "v");
|
||||||
assert(xk);
|
assert(xk);
|
||||||
assert(xv);
|
assert(xv);
|
||||||
cur_item->keyvals[(char*)xk] = (char*)xv;
|
cur_item->keyvals[(char*)xk] = (char*)xv;
|
||||||
xmlFree(xk);
|
xmlFree(xk);
|
||||||
xmlFree(xv);
|
xmlFree(xv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void osmparser::endElement(const xmlChar* name)
|
void osmparser::endElement(const xmlChar* name)
|
||||||
{
|
{
|
||||||
if(xmlStrEqual(name,BAD_CAST "node"))
|
if(xmlStrEqual(name,BAD_CAST "node"))
|
||||||
{
|
{
|
||||||
in_node = false;
|
in_node = false;
|
||||||
components->add_node(static_cast<osm_node*>(cur_item));
|
components->add_node(static_cast<osm_node*>(cur_item));
|
||||||
}
|
}
|
||||||
else if(xmlStrEqual(name,BAD_CAST "way"))
|
else if(xmlStrEqual(name,BAD_CAST "way"))
|
||||||
{
|
{
|
||||||
in_way = false;
|
in_way = false;
|
||||||
components->add_way(static_cast<osm_way*>(cur_item));
|
components->add_way(static_cast<osm_way*>(cur_item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool osmparser::parse(osm_dataset *ds, const char* filename)
|
bool osmparser::parse(osm_dataset *ds, const char* filename)
|
||||||
{
|
{
|
||||||
components=ds;
|
components=ds;
|
||||||
xmlTextReaderPtr reader = xmlNewTextReaderFilename(filename);
|
xmlTextReaderPtr reader = xmlNewTextReaderFilename(filename);
|
||||||
int ret=do_parse(reader);
|
int ret=do_parse(reader);
|
||||||
xmlFreeTextReader(reader);
|
xmlFreeTextReader(reader);
|
||||||
return (ret==0) ? true:false;
|
return (ret==0) ? true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool osmparser::parse(osm_dataset *ds,char* data, int nbytes)
|
bool osmparser::parse(osm_dataset *ds,char* data, int nbytes)
|
||||||
{
|
{
|
||||||
// from cocoasamurai.blogspot.com/2008/10/getting-some-xml-love-with-
|
// from cocoasamurai.blogspot.com/2008/10/getting-some-xml-love-with-
|
||||||
// libxml2.html, converted from Objective-C to straight C
|
// libxml2.html, converted from Objective-C to straight C
|
||||||
|
|
||||||
components=ds;
|
components=ds;
|
||||||
xmlTextReaderPtr reader = xmlReaderForMemory(data,nbytes,NULL,NULL,0);
|
xmlTextReaderPtr reader = xmlReaderForMemory(data,nbytes,NULL,NULL,0);
|
||||||
int ret=do_parse(reader);
|
int ret=do_parse(reader);
|
||||||
xmlFreeTextReader(reader);
|
xmlFreeTextReader(reader);
|
||||||
return (ret==0) ? true:false;
|
return (ret==0) ? true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int osmparser::do_parse(xmlTextReaderPtr reader)
|
int osmparser::do_parse(xmlTextReaderPtr reader)
|
||||||
{
|
{
|
||||||
int ret=-1;
|
int ret=-1;
|
||||||
if(reader!=NULL)
|
if(reader!=NULL)
|
||||||
{
|
{
|
||||||
ret = xmlTextReaderRead(reader);
|
ret = xmlTextReaderRead(reader);
|
||||||
while(ret==1)
|
while(ret==1)
|
||||||
{
|
{
|
||||||
processNode(reader);
|
processNode(reader);
|
||||||
ret=xmlTextReaderRead(reader);
|
ret=xmlTextReaderRead(reader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ private:
|
||||||
static std::string error;
|
static std::string error;
|
||||||
static std::map<long,osm_node*> tmp_node_store;
|
static std::map<long,osm_node*> tmp_node_store;
|
||||||
|
|
||||||
static int do_parse(xmlTextReaderPtr);
|
static int do_parse(xmlTextReaderPtr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void processNode(xmlTextReaderPtr reader);
|
static void processNode(xmlTextReaderPtr reader);
|
||||||
|
|
|
@ -9,20 +9,20 @@
|
||||||
class osm_tag_types
|
class osm_tag_types
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::map<std::string,mapnik::eAttributeType> types;
|
std::map<std::string,mapnik::eAttributeType> types;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void add_type(std::string tag, mapnik::eAttributeType type)
|
void add_type(std::string tag, mapnik::eAttributeType type)
|
||||||
{
|
{
|
||||||
types[tag]=type;
|
types[tag]=type;
|
||||||
}
|
}
|
||||||
|
|
||||||
mapnik::eAttributeType get_type(std::string tag)
|
mapnik::eAttributeType get_type(std::string tag)
|
||||||
{
|
{
|
||||||
std::map<std::string,mapnik::eAttributeType>::iterator i =
|
std::map<std::string,mapnik::eAttributeType>::iterator i =
|
||||||
types.find(tag);
|
types.find(tag);
|
||||||
return (i==types.end()) ? mapnik::String: i->second;
|
return (i==types.end()) ? mapnik::String: i->second;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OSMTAGTYPES_H
|
#endif // OSMTAGTYPES_H
|
||||||
|
|
|
@ -17,43 +17,43 @@ using namespace std;
|
||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
if(argc < 6)
|
if(argc < 6)
|
||||||
{
|
{
|
||||||
std::cerr<<"Usage: render XMLfile w s e n [OSMfile]" << std::endl;
|
std::cerr<<"Usage: render XMLfile w s e n [OSMfile]" << std::endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource_cache::instance()->register_datasources
|
datasource_cache::instance()->register_datasources
|
||||||
("/usr/local/lib/mapnik/input");
|
("/usr/local/lib/mapnik/input");
|
||||||
freetype_engine::register_font
|
freetype_engine::register_font
|
||||||
("/usr/local/lib/mapnik/fonts/DejaVuSans.ttf");
|
("/usr/local/lib/mapnik/fonts/DejaVuSans.ttf");
|
||||||
|
|
||||||
Map m (800,800);
|
Map m (800,800);
|
||||||
load_map(m,argv[1]);
|
load_map(m,argv[1]);
|
||||||
|
|
||||||
if(argc>6)
|
if(argc>6)
|
||||||
{
|
{
|
||||||
parameters p;
|
parameters p;
|
||||||
p["type"] = "osm";
|
p["type"] = "osm";
|
||||||
p["file"] = argv[6];
|
p["file"] = argv[6];
|
||||||
for(int count=0; count<m.layer_count(); count++)
|
for(int count=0; count<m.layer_count(); count++)
|
||||||
{
|
{
|
||||||
parameters q = m.getLayer(count).datasource()->params();
|
parameters q = m.getLayer(count).datasource()->params();
|
||||||
m.getLayer(count).set_datasource(datasource_cache::instance()->
|
m.getLayer(count).set_datasource(datasource_cache::instance()->
|
||||||
create(p));
|
create(p));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
box2d<double> bbox (atof(argv[2]),atof(argv[3]),
|
box2d<double> bbox (atof(argv[2]),atof(argv[3]),
|
||||||
atof(argv[4]),atof(argv[5]));
|
atof(argv[4]),atof(argv[5]));
|
||||||
|
|
||||||
m.zoom_to_box(bbox);
|
m.zoom_to_box(bbox);
|
||||||
|
|
||||||
image_32 buf (m.width(), m.height());
|
image_32 buf (m.width(), m.height());
|
||||||
agg_renderer<image_32> r(m,buf);
|
agg_renderer<image_32> r(m,buf);
|
||||||
r.apply();
|
r.apply();
|
||||||
|
|
||||||
save_to_file<image_data_32>(buf.data(),"blah.png","png");
|
save_to_file<image_data_32>(buf.data(),"blah.png","png");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,21 +5,21 @@ using std::endl;
|
||||||
|
|
||||||
int main(int argc,char* argv[])
|
int main(int argc,char* argv[])
|
||||||
{
|
{
|
||||||
if(argc>=2)
|
if(argc>=2)
|
||||||
{
|
{
|
||||||
osm_dataset dataset(argv[1]);
|
osm_dataset dataset(argv[1]);
|
||||||
bounds b = dataset.get_bounds();
|
bounds b = dataset.get_bounds();
|
||||||
osm_item *item;
|
osm_item *item;
|
||||||
dataset.rewind();
|
dataset.rewind();
|
||||||
while((item=dataset.next_item())!=NULL)
|
while((item=dataset.next_item())!=NULL)
|
||||||
{
|
{
|
||||||
std::cerr << item->to_string() << endl;
|
std::cerr << item->to_string() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cerr<<"Usage: test OSMfile"<<std::endl;
|
std::cerr<<"Usage: test OSMfile"<<std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,18 @@
|
||||||
|
|
||||||
<Style name="coast-poly">
|
<Style name="coast-poly">
|
||||||
<Rule>
|
<Rule>
|
||||||
<PolygonSymbolizer>
|
<PolygonSymbolizer>
|
||||||
<CssParameter name="fill">#f2efe9</CssParameter>
|
<CssParameter name="fill">#f2efe9</CssParameter>
|
||||||
</PolygonSymbolizer>
|
</PolygonSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="coast-line">
|
<Style name="coast-line">
|
||||||
<Rule>
|
<Rule>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">skyblue</CssParameter>
|
<CssParameter name="stroke">skyblue</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="leisure">
|
<Style name="leisure">
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[leisure] = 'park' or [leisure] = 'common' or
|
<Filter>[leisure] = 'park' or [leisure] = 'common' or
|
||||||
[leisure] = 'golf_course'</Filter>
|
[leisure] = 'golf_course'</Filter>
|
||||||
<PolygonSymbolizer>
|
<PolygonSymbolizer>
|
||||||
<CssParameter name="fill">#d8e8d0</CssParameter>
|
<CssParameter name="fill">#d8e8d0</CssParameter>
|
||||||
</PolygonSymbolizer>
|
</PolygonSymbolizer>
|
||||||
|
@ -91,12 +91,12 @@
|
||||||
<Filter>[natural] = 'peak'</Filter>
|
<Filter>[natural] = 'peak'</Filter>
|
||||||
<TextSymbolizer name="name" face_name="Bitstream Vera Sans Roman" size="11" fill="#000" halo_radius="1" wrap_width="0"/>
|
<TextSymbolizer name="name" face_name="Bitstream Vera Sans Roman" size="11" fill="#000" halo_radius="1" wrap_width="0"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[natural] = 'wood' or [natural] = 'water' or [natural] = 'heath'
|
<Filter>[natural] = 'wood' or [natural] = 'water' or [natural] = 'heath'
|
||||||
or [leisure] = 'golf_course' </Filter>
|
or [leisure] = 'golf_course' </Filter>
|
||||||
<TextSymbolizer name="name" face_name="Bitstream Vera Sans Roman"
|
<TextSymbolizer name="name" face_name="Bitstream Vera Sans Roman"
|
||||||
size="10" fill="#000" halo_radius="2" wrap_width="0" />
|
size="10" fill="#000" halo_radius="2" wrap_width="0" />
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="river">
|
<Style name="river">
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
<Filter>[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
<Filter>[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#999</CssParameter>
|
<CssParameter name="stroke">#999</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">4</CssParameter>
|
<CssParameter name="stroke-width">4</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="trunk">
|
<Style name="trunk">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'trunk' or [highway] = 'trunk_link'</Filter>
|
<Filter>[highway] = 'trunk' or [highway] = 'trunk_link'</Filter>
|
||||||
|
@ -275,7 +275,7 @@
|
||||||
<Style name="residential">
|
<Style name="residential">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'residential' or [highway] = 'service' or
|
<Filter>[highway] = 'residential' or [highway] = 'service' or
|
||||||
[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
|
@ -283,9 +283,9 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="bridleway">
|
<Style name="bridleway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = ''</Filter>
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = ''</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -305,7 +305,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [foot] = 'yes' and [horse] = 'yes'
|
<Filter>[highway] = 'bridleway' and [foot] = 'yes' and [horse] = 'yes'
|
||||||
and [bicycle] = 'yes'</Filter>
|
and [bicycle] = 'yes'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">6</CssParameter>
|
<CssParameter name="stroke-width">6</CssParameter>
|
||||||
|
@ -323,7 +323,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'narrow'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'narrow'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#00c000</CssParameter>
|
<CssParameter name="stroke">#00c000</CssParameter>
|
||||||
<CssParameter name="stroke-width">1.0</CssParameter>
|
<CssParameter name="stroke-width">1.0</CssParameter>
|
||||||
|
@ -351,7 +351,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'gravel'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'gravel'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">6</CssParameter>
|
<CssParameter name="stroke-width">6</CssParameter>
|
||||||
|
@ -361,7 +361,7 @@
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">brown</CssParameter>
|
<CssParameter name="stroke">brown</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
|
@ -369,17 +369,17 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'track'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'track'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">brown</CssParameter>
|
<CssParameter name="stroke">brown</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">2,4</CssParameter>
|
<CssParameter name="stroke-dasharray">2,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="footway">
|
<Style name="footway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'footway'</Filter>
|
<Filter>[highway] = 'footway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -414,8 +414,8 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="cycleway">
|
<Style name="cycleway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'cycleway'</Filter>
|
<Filter>[highway] = 'cycleway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -433,8 +433,8 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="byway">
|
<Style name="byway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'byway'</Filter>
|
<Filter>[highway] = 'byway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -454,16 +454,16 @@
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="contours">
|
<Style name="contours">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[major] = 1</Filter>
|
<Filter>[major] = 1</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fb9b67</CssParameter>
|
<CssParameter name="stroke">#fb9b67</CssParameter>
|
||||||
<CssParameter name="stroke-width">1.0</CssParameter>
|
<CssParameter name="stroke-width">1.0</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<ElseFilter/>
|
<ElseFilter/>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fb9b67</CssParameter>
|
<CssParameter name="stroke">#fb9b67</CssParameter>
|
||||||
|
@ -477,7 +477,7 @@
|
||||||
<Style name="contours-text">
|
<Style name="contours-text">
|
||||||
<Rule>
|
<Rule>
|
||||||
<TextSymbolizer name="height" face_name="Bitstream Vera Sans Roman"
|
<TextSymbolizer name="height" face_name="Bitstream Vera Sans Roman"
|
||||||
size="8" fill="#fb9b67" halo_radius="0" placement="line"/>
|
size="8" fill="#fb9b67" halo_radius="0" placement="line"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
|
|
@ -5,22 +5,22 @@
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[amenity]='pub'</Filter>
|
<Filter>[amenity]='pub'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/pub.png" type="png"
|
<PointSymbolizer file="/home/nick/images/pub.png" type="png"
|
||||||
width="16" height="16" />
|
width="16" height="16" />
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[man_made]='mast'</Filter>
|
<Filter>[man_made]='mast'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/mast.png" type="png"
|
<PointSymbolizer file="/home/nick/images/mast.png" type="png"
|
||||||
width="16" height="16" />
|
width="16" height="16" />
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[amenity]='parking'</Filter>
|
<Filter>[amenity]='parking'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/carpark.png" type="png"
|
<PointSymbolizer file="/home/nick/images/carpark.png" type="png"
|
||||||
width="16" height="16"/>
|
width="16" height="16"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[residence]='farm'</Filter>
|
<Filter>[residence]='farm'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/farm.png" type="png"
|
<PointSymbolizer file="/home/nick/images/farm.png" type="png"
|
||||||
width="16" height="16"/>
|
width="16" height="16"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[leisure] = 'park' or [leisure] = 'common' or
|
<Filter>[leisure] = 'park' or [leisure] = 'common' or
|
||||||
[leisure] = 'golf_course'</Filter>
|
[leisure] = 'golf_course'</Filter>
|
||||||
<PolygonSymbolizer>
|
<PolygonSymbolizer>
|
||||||
<CssParameter name="fill">#d8e8d0</CssParameter>
|
<CssParameter name="fill">#d8e8d0</CssParameter>
|
||||||
</PolygonSymbolizer>
|
</PolygonSymbolizer>
|
||||||
|
@ -98,12 +98,12 @@
|
||||||
<Filter>[natural] = 'peak'</Filter>
|
<Filter>[natural] = 'peak'</Filter>
|
||||||
<TextSymbolizer name="name" face_name="DejaVu Sans Book" size="11" fill="#000" halo_radius="1" wrap_width="0"/>
|
<TextSymbolizer name="name" face_name="DejaVu Sans Book" size="11" fill="#000" halo_radius="1" wrap_width="0"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[natural] = 'wood' or [natural] = 'water' or [natural] = 'heath'
|
<Filter>[natural] = 'wood' or [natural] = 'water' or [natural] = 'heath'
|
||||||
or [leisure] = 'golf_course' </Filter>
|
or [leisure] = 'golf_course' </Filter>
|
||||||
<TextSymbolizer name="name" face_name="DejaVu Sans Book"
|
<TextSymbolizer name="name" face_name="DejaVu Sans Book"
|
||||||
size="10" fill="#000" halo_radius="2" wrap_width="0" />
|
size="10" fill="#000" halo_radius="2" wrap_width="0" />
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="river">
|
<Style name="river">
|
||||||
|
@ -200,7 +200,7 @@
|
||||||
<Filter>[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
<Filter>[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#999</CssParameter>
|
<CssParameter name="stroke">#999</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">4</CssParameter>
|
<CssParameter name="stroke-width">4</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="trunk">
|
<Style name="trunk">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'trunk' or [highway] = 'trunk_link'</Filter>
|
<Filter>[highway] = 'trunk' or [highway] = 'trunk_link'</Filter>
|
||||||
|
@ -282,7 +282,7 @@
|
||||||
<Style name="residential">
|
<Style name="residential">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'residential' or [highway] = 'service' or
|
<Filter>[highway] = 'residential' or [highway] = 'service' or
|
||||||
[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
|
@ -290,9 +290,9 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="bridleway">
|
<Style name="bridleway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = ''</Filter>
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = ''</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -312,7 +312,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [foot] = 'yes' and [horse] = 'yes'
|
<Filter>[highway] = 'bridleway' and [foot] = 'yes' and [horse] = 'yes'
|
||||||
and [bicycle] = 'yes'</Filter>
|
and [bicycle] = 'yes'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">6</CssParameter>
|
<CssParameter name="stroke-width">6</CssParameter>
|
||||||
|
@ -330,7 +330,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'narrow'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'narrow'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#00c000</CssParameter>
|
<CssParameter name="stroke">#00c000</CssParameter>
|
||||||
<CssParameter name="stroke-width">1.0</CssParameter>
|
<CssParameter name="stroke-width">1.0</CssParameter>
|
||||||
|
@ -358,7 +358,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'gravel'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'gravel'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">6</CssParameter>
|
<CssParameter name="stroke-width">6</CssParameter>
|
||||||
|
@ -368,7 +368,7 @@
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">brown</CssParameter>
|
<CssParameter name="stroke">brown</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
|
@ -376,17 +376,17 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'track'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'track'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">brown</CssParameter>
|
<CssParameter name="stroke">brown</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">2,4</CssParameter>
|
<CssParameter name="stroke-dasharray">2,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="footway">
|
<Style name="footway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'footway'</Filter>
|
<Filter>[highway] = 'footway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -421,8 +421,8 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="cycleway">
|
<Style name="cycleway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'cycleway'</Filter>
|
<Filter>[highway] = 'cycleway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -440,8 +440,8 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="byway">
|
<Style name="byway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'byway'</Filter>
|
<Filter>[highway] = 'byway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
|
|
@ -5,22 +5,22 @@
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[amenity]='pub'</Filter>
|
<Filter>[amenity]='pub'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/pub.png" type="png"
|
<PointSymbolizer file="/home/nick/images/pub.png" type="png"
|
||||||
width="16" height="16" />
|
width="16" height="16" />
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[man_made]='mast'</Filter>
|
<Filter>[man_made]='mast'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/mast.png" type="png"
|
<PointSymbolizer file="/home/nick/images/mast.png" type="png"
|
||||||
width="16" height="16" />
|
width="16" height="16" />
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[amenity]='parking'</Filter>
|
<Filter>[amenity]='parking'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/carpark.png" type="png"
|
<PointSymbolizer file="/home/nick/images/carpark.png" type="png"
|
||||||
width="16" height="16"/>
|
width="16" height="16"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[residence]='farm'</Filter>
|
<Filter>[residence]='farm'</Filter>
|
||||||
<PointSymbolizer file="/home/nick/images/farm.png" type="png"
|
<PointSymbolizer file="/home/nick/images/farm.png" type="png"
|
||||||
width="16" height="16"/>
|
width="16" height="16"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[leisure] = 'park' or [leisure] = 'common' or
|
<Filter>[leisure] = 'park' or [leisure] = 'common' or
|
||||||
[leisure] = 'golf_course'</Filter>
|
[leisure] = 'golf_course'</Filter>
|
||||||
<PolygonSymbolizer>
|
<PolygonSymbolizer>
|
||||||
<CssParameter name="fill">#d8e8d0</CssParameter>
|
<CssParameter name="fill">#d8e8d0</CssParameter>
|
||||||
</PolygonSymbolizer>
|
</PolygonSymbolizer>
|
||||||
|
@ -98,12 +98,12 @@
|
||||||
<Filter>[natural] = 'peak'</Filter>
|
<Filter>[natural] = 'peak'</Filter>
|
||||||
<TextSymbolizer name="name" face_name="DejaVu Sans Book" size="11" fill="#000" halo_radius="1" wrap_width="0"/>
|
<TextSymbolizer name="name" face_name="DejaVu Sans Book" size="11" fill="#000" halo_radius="1" wrap_width="0"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[natural] = 'wood' or [natural] = 'water' or [natural] = 'heath'
|
<Filter>[natural] = 'wood' or [natural] = 'water' or [natural] = 'heath'
|
||||||
or [leisure] = 'golf_course' </Filter>
|
or [leisure] = 'golf_course' </Filter>
|
||||||
<TextSymbolizer name="name" face_name="DejaVu Sans Book"
|
<TextSymbolizer name="name" face_name="DejaVu Sans Book"
|
||||||
size="10" fill="#000" halo_radius="2" wrap_width="0" />
|
size="10" fill="#000" halo_radius="2" wrap_width="0" />
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="river">
|
<Style name="river">
|
||||||
|
@ -200,7 +200,7 @@
|
||||||
<Filter>[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
<Filter>[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#999</CssParameter>
|
<CssParameter name="stroke">#999</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">4</CssParameter>
|
<CssParameter name="stroke-width">4</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="trunk">
|
<Style name="trunk">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'trunk' or [highway] = 'trunk_link'</Filter>
|
<Filter>[highway] = 'trunk' or [highway] = 'trunk_link'</Filter>
|
||||||
|
@ -282,7 +282,7 @@
|
||||||
<Style name="residential">
|
<Style name="residential">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'residential' or [highway] = 'service' or
|
<Filter>[highway] = 'residential' or [highway] = 'service' or
|
||||||
[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
[highway] = 'unsurfaced' or [highway] = 'track'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
|
@ -290,9 +290,9 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style name="bridleway">
|
<Style name="bridleway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = ''</Filter>
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = ''</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -312,7 +312,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [foot] = 'yes' and [horse] = 'yes'
|
<Filter>[highway] = 'bridleway' and [foot] = 'yes' and [horse] = 'yes'
|
||||||
and [bicycle] = 'yes'</Filter>
|
and [bicycle] = 'yes'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">6</CssParameter>
|
<CssParameter name="stroke-width">6</CssParameter>
|
||||||
|
@ -330,7 +330,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'narrow'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'narrow'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#00c000</CssParameter>
|
<CssParameter name="stroke">#00c000</CssParameter>
|
||||||
<CssParameter name="stroke-width">1.0</CssParameter>
|
<CssParameter name="stroke-width">1.0</CssParameter>
|
||||||
|
@ -358,7 +358,7 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'gravel'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'gravel'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">#fff</CssParameter>
|
<CssParameter name="stroke">#fff</CssParameter>
|
||||||
<CssParameter name="stroke-width">6</CssParameter>
|
<CssParameter name="stroke-width">6</CssParameter>
|
||||||
|
@ -368,7 +368,7 @@
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">brown</CssParameter>
|
<CssParameter name="stroke">brown</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
<CssParameter name="stroke-dasharray">6,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
|
@ -376,17 +376,17 @@
|
||||||
</Rule>
|
</Rule>
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'track'
|
<Filter>[highway] = 'bridleway' and [newforest_pathtype] = 'track'
|
||||||
</Filter>
|
</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
<CssParameter name="stroke">brown</CssParameter>
|
<CssParameter name="stroke">brown</CssParameter>
|
||||||
<CssParameter name="stroke-dasharray">2,4</CssParameter>
|
<CssParameter name="stroke-dasharray">2,4</CssParameter>
|
||||||
<CssParameter name="stroke-width">2</CssParameter>
|
<CssParameter name="stroke-width">2</CssParameter>
|
||||||
<CssParameter name="stroke-linejoin">round</CssParameter>
|
<CssParameter name="stroke-linejoin">round</CssParameter>
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="footway">
|
<Style name="footway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'footway'</Filter>
|
<Filter>[highway] = 'footway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -421,8 +421,8 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="cycleway">
|
<Style name="cycleway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'cycleway'</Filter>
|
<Filter>[highway] = 'cycleway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
@ -440,8 +440,8 @@
|
||||||
<CssParameter name="stroke-linecap">round</CssParameter>
|
<CssParameter name="stroke-linecap">round</CssParameter>
|
||||||
</LineSymbolizer>
|
</LineSymbolizer>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
<Style name="byway">
|
<Style name="byway">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[highway] = 'byway'</Filter>
|
<Filter>[highway] = 'byway'</Filter>
|
||||||
<LineSymbolizer>
|
<LineSymbolizer>
|
||||||
|
|
|
@ -27,10 +27,10 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
postgis_src = Split(
|
postgis_src = Split(
|
||||||
"""
|
"""
|
||||||
postgis.cpp
|
postgis.cpp
|
||||||
postgisfs.cpp
|
postgisfs.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = ['pq']
|
libraries = ['pq']
|
||||||
|
|
|
@ -67,44 +67,50 @@ std::string numeric2string(const char* buf)
|
||||||
|
|
||||||
while ( i >= 0)
|
while ( i >= 0)
|
||||||
{
|
{
|
||||||
if (i <= weight && d < ndigits) {
|
if (i <= weight && d < ndigits)
|
||||||
|
{
|
||||||
// All digits after the first must be padded to make the field 4 characters long
|
// All digits after the first must be padded to make the field 4 characters long
|
||||||
if (d != 0) {
|
if (d != 0)
|
||||||
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
int dig = digits[d];
|
int dig = digits[d];
|
||||||
if (dig < 10)
|
if (dig < 10)
|
||||||
{
|
{
|
||||||
ss << "000"; // 0000 - 0009
|
ss << "000"; // 0000 - 0009
|
||||||
}
|
}
|
||||||
else if (dig < 100)
|
else if (dig < 100)
|
||||||
{
|
{
|
||||||
ss << "00"; // 0010 - 0099
|
ss << "00"; // 0010 - 0099
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ss << "0"; // 0100 - 0999;
|
ss << "0"; // 0100 - 0999;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
switch(digits[d]) {
|
switch(digits[d])
|
||||||
case 0 ... 9:
|
{
|
||||||
ss << "000"; // 0000 - 0009
|
case 0 ... 9:
|
||||||
break;
|
ss << "000"; // 0000 - 0009
|
||||||
case 10 ... 99:
|
break;
|
||||||
ss << "00"; // 0010 - 0099
|
case 10 ... 99:
|
||||||
break;
|
ss << "00"; // 0010 - 0099
|
||||||
case 100 ... 999:
|
break;
|
||||||
ss << "0"; // 0100 - 0999
|
case 100 ... 999:
|
||||||
break;
|
ss << "0"; // 0100 - 0999
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ss << digits[d++];
|
ss << digits[d++];
|
||||||
} else {
|
|
||||||
if (d == 0)
|
|
||||||
ss << "0";
|
|
||||||
else
|
|
||||||
ss << "0000";
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (d == 0)
|
||||||
|
ss << "0";
|
||||||
|
else
|
||||||
|
ss << "0000";
|
||||||
|
}
|
||||||
|
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
if (dscale > 0)
|
if (dscale > 0)
|
||||||
|
@ -115,29 +121,29 @@ std::string numeric2string(const char* buf)
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
if (i <= weight && d < ndigits)
|
if (i <= weight && d < ndigits)
|
||||||
value = digits[d++];
|
value = digits[d++];
|
||||||
else
|
else
|
||||||
value = 0;
|
value = 0;
|
||||||
|
|
||||||
// Output up to 4 decimal digits for this value
|
// Output up to 4 decimal digits for this value
|
||||||
if (dscale > 0) {
|
if (dscale > 0) {
|
||||||
ss << (value / 1000);
|
ss << (value / 1000);
|
||||||
value %= 1000;
|
value %= 1000;
|
||||||
dscale--;
|
dscale--;
|
||||||
}
|
}
|
||||||
if (dscale > 0) {
|
if (dscale > 0) {
|
||||||
ss << (value / 100);
|
ss << (value / 100);
|
||||||
value %= 100;
|
value %= 100;
|
||||||
dscale--;
|
dscale--;
|
||||||
}
|
}
|
||||||
if (dscale > 0) {
|
if (dscale > 0) {
|
||||||
ss << (value / 10);
|
ss << (value / 10);
|
||||||
value %= 10;
|
value %= 10;
|
||||||
dscale--;
|
dscale--;
|
||||||
}
|
}
|
||||||
if (dscale > 0) {
|
if (dscale > 0) {
|
||||||
ss << value;
|
ss << value;
|
||||||
dscale--;
|
dscale--;
|
||||||
}
|
}
|
||||||
|
|
||||||
i--;
|
i--;
|
||||||
|
@ -166,7 +172,7 @@ feature_ptr postgis_featureset::next()
|
||||||
const char *data = rs_->getValue(0);
|
const char *data = rs_->getValue(0);
|
||||||
geometry_utils::from_wkb(*feature,data,size,multiple_geometries_);
|
geometry_utils::from_wkb(*feature,data,size,multiple_geometries_);
|
||||||
totalGeomSize_+=size;
|
totalGeomSize_+=size;
|
||||||
|
|
||||||
for (unsigned pos=1;pos<num_attrs_+1;++pos)
|
for (unsigned pos=1;pos<num_attrs_+1;++pos)
|
||||||
{
|
{
|
||||||
std::string name = rs_->getFieldName(pos);
|
std::string name = rs_->getFieldName(pos);
|
||||||
|
|
|
@ -27,11 +27,11 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
raster_src = Split(
|
raster_src = Split(
|
||||||
"""
|
"""
|
||||||
raster_datasource.cpp
|
raster_datasource.cpp
|
||||||
raster_featureset.cpp
|
raster_featureset.cpp
|
||||||
raster_info.cpp
|
raster_info.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = []
|
libraries = []
|
||||||
|
|
|
@ -27,10 +27,10 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
rasterlite_src = Split(
|
rasterlite_src = Split(
|
||||||
"""
|
"""
|
||||||
rasterlite_datasource.cpp
|
rasterlite_datasource.cpp
|
||||||
rasterlite_featureset.cpp
|
rasterlite_featureset.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = [env['PLUGINS']['rasterlite']['lib']]
|
libraries = [env['PLUGINS']['rasterlite']['lib']]
|
||||||
|
|
|
@ -59,7 +59,7 @@ inline void *rasterlite_datasource::open_dataset() const
|
||||||
{
|
{
|
||||||
std::string error (rasterliteGetLastError(dataset));
|
std::string error (rasterliteGetLastError(dataset));
|
||||||
|
|
||||||
rasterliteClose (dataset);
|
rasterliteClose (dataset);
|
||||||
|
|
||||||
throw datasource_exception(error);
|
throw datasource_exception(error);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ void rasterlite_datasource::bind() const
|
||||||
{
|
{
|
||||||
std::string error (rasterliteGetLastError(dataset));
|
std::string error (rasterliteGetLastError(dataset));
|
||||||
|
|
||||||
rasterliteClose (dataset);
|
rasterliteClose (dataset);
|
||||||
|
|
||||||
throw datasource_exception(error);
|
throw datasource_exception(error);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ void rasterlite_datasource::bind() const
|
||||||
{
|
{
|
||||||
std::string error (rasterliteGetLastError(dataset));
|
std::string error (rasterliteGetLastError(dataset));
|
||||||
|
|
||||||
rasterliteClose (dataset);
|
rasterliteClose (dataset);
|
||||||
|
|
||||||
throw datasource_exception(error);
|
throw datasource_exception(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q)
|
||||||
std::clog << "Rasterlite Plugin: View extent=" << q.get_bbox() << std::endl;
|
std::clog << "Rasterlite Plugin: View extent=" << q.get_bbox() << std::endl;
|
||||||
std::clog << "Rasterlite Plugin: Intersect extent=" << intersect << std::endl;
|
std::clog << "Rasterlite Plugin: Intersect extent=" << intersect << std::endl;
|
||||||
std::clog << "Rasterlite Plugin: Query resolution=" << boost::get<0>(q.resolution())
|
std::clog << "Rasterlite Plugin: Query resolution=" << boost::get<0>(q.resolution())
|
||||||
<< "," << boost::get<1>(q.resolution()) << std::endl;
|
<< "," << boost::get<1>(q.resolution()) << std::endl;
|
||||||
std::clog << "Rasterlite Plugin: Size=" << width << " " << height << std::endl;
|
std::clog << "Rasterlite Plugin: Size=" << width << " " << height << std::endl;
|
||||||
std::clog << "Rasterlite Plugin: Pixel Size=" << pixel_size << std::endl;
|
std::clog << "Rasterlite Plugin: Pixel Size=" << pixel_size << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
# This file is part of Mapnik (c++ mapping toolkit)
|
# This file is part of Mapnik (c++ mapping toolkit)
|
||||||
#
|
#
|
||||||
# Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon
|
# Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon
|
||||||
|
@ -28,13 +28,13 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
shape_src = Split(
|
shape_src = Split(
|
||||||
"""
|
"""
|
||||||
dbffile.cpp
|
dbffile.cpp
|
||||||
shape.cpp
|
shape.cpp
|
||||||
shape_featureset.cpp
|
shape_featureset.cpp
|
||||||
shape_index_featureset.cpp
|
shape_index_featureset.cpp
|
||||||
shape_io.cpp
|
shape_io.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = ['boost_iostreams%s' % env['BOOST_APPEND']]
|
libraries = ['boost_iostreams%s' % env['BOOST_APPEND']]
|
||||||
|
|
|
@ -46,7 +46,7 @@ int main(int argc,char** argv)
|
||||||
{
|
{
|
||||||
int width=dbf.descriptor(j).length_;
|
int width=dbf.descriptor(j).length_;
|
||||||
string name=dbf.descriptor(j).name_;
|
string name=dbf.descriptor(j).name_;
|
||||||
char type=dbf.descriptor(j).type_;
|
char type=dbf.descriptor(j).type_;
|
||||||
cout<<setw(width)<<name<<"("<<type<<")""|";
|
cout<<setw(width)<<name<<"("<<type<<")""|";
|
||||||
}
|
}
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
|
|
|
@ -204,11 +204,11 @@ geometry_type * shape_io::read_polylinem()
|
||||||
end=num_points;
|
end=num_points;
|
||||||
else
|
else
|
||||||
end=parts[k+1];
|
end=parts[k+1];
|
||||||
|
|
||||||
double x=record.read_double();
|
double x=record.read_double();
|
||||||
double y=record.read_double();
|
double y=record.read_double();
|
||||||
line->move_to(x,y);
|
line->move_to(x,y);
|
||||||
|
|
||||||
for (int j=start+1;j<end;++j)
|
for (int j=start+1;j<end;++j)
|
||||||
{
|
{
|
||||||
x=record.read_double();
|
x=record.read_double();
|
||||||
|
@ -284,7 +284,7 @@ geometry_type * shape_io::read_polylinez()
|
||||||
//double z1=record.read_double();
|
//double z1=record.read_double();
|
||||||
//for (int i=0;i<num_points;++i)
|
//for (int i=0;i<num_points;++i)
|
||||||
// {
|
// {
|
||||||
// double z=record.read_double();
|
// double z=record.read_double();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// m-range
|
// m-range
|
||||||
|
@ -428,7 +428,7 @@ geometry_type * shape_io::read_polygonz()
|
||||||
//double z1=record.read_double();
|
//double z1=record.read_double();
|
||||||
//for (int i=0;i<num_points;++i)
|
//for (int i=0;i<num_points;++i)
|
||||||
//{
|
//{
|
||||||
// double z=record.read_double();
|
// double z=record.read_double();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// m-range
|
// m-range
|
||||||
|
|
|
@ -27,10 +27,10 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
plugin_env = env.Clone()
|
plugin_env = env.Clone()
|
||||||
|
|
||||||
sqlite_src = Split(
|
sqlite_src = Split(
|
||||||
"""
|
"""
|
||||||
sqlite_datasource.cpp
|
sqlite_datasource.cpp
|
||||||
sqlite_featureset.cpp
|
sqlite_featureset.cpp
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
libraries = [ 'sqlite3' ]
|
libraries = [ 'sqlite3' ]
|
||||||
|
|
|
@ -156,7 +156,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
return new sqlite_resultset (stmt);
|
return new sqlite_resultset (stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlite3* operator*()
|
sqlite3* operator*()
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,10 +38,10 @@ plugin_env = env.Clone()
|
||||||
|
|
||||||
# Add the cpp files that need to be compiled
|
# Add the cpp files that need to be compiled
|
||||||
plugin_sources = Split(
|
plugin_sources = Split(
|
||||||
"""
|
"""
|
||||||
%(PLUGIN_NAME)s_datasource.cpp
|
%(PLUGIN_NAME)s_datasource.cpp
|
||||||
%(PLUGIN_NAME)s_featureset.cpp
|
%(PLUGIN_NAME)s_featureset.cpp
|
||||||
""" % locals()
|
""" % locals()
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add any external libraries this plugin should
|
# Add any external libraries this plugin should
|
||||||
|
|
Loading…
Reference in a new issue