#include "leo.h"
#include "osm.h"
+#include "shp.h"
#include "map.h"
#include "css.h"
#include "sym.h"
"invalid",
"osmxml",
"fixed",
+ "shape",
};
static struct cf_section map_source_cf = {
msg(L_INFO, "Adding fixed objects");
fixed_add();
break;
+ case DATA_SOURCE_SHAPE:
+ msg(L_INFO, "Parsing %s as shape file", ds->file);
+ if (!ds->file)
+ die("Shape data sources must have a file name");
+ shp_parse(ds->file);
+ need_proj = 1;
+ break;
default:
die("Invalid data source format");
}
# File format:
# osmxml OpenStreetMap XML
# fixed Fixed objects (no File used, see FixedObjects section below)
+ # shape ESRI shape file (partial support only)
Format osmxml
# MapCSS stylesheet to apply (multiple style-sheets are allowed)
DATA_SOURCE_INVALID,
DATA_SOURCE_OSMXML,
DATA_SOURCE_FIXED,
+ DATA_SOURCE_SHAPE,
};
struct data_source {
#include "map.h"
#include "shp.h"
-// FIXME: Hack
-static osm_id_t shp_id_counter = 1000000000000;
+static osm_id_t shp_id_counter;
static double shp_get_double(byte *p)
{
{
msg(L_INFO, "Loading shape file %s", name);
struct fastbuf *fb = bopen_file(name, O_RDONLY, NULL);
+ shp_id_counter = 1;
byte *buf;
GARY_INIT(buf, 100);