]> mj.ucw.cz Git - leo.git/blobdiff - map.c
Support for reading of shape files (partial)
[leo.git] / map.c
diff --git a/map.c b/map.c
index 8f318e23e9427bafa5a65a7baf5417a2d1ed68ad..8f502006324660fe42329f89a797452652c040d3 100644 (file)
--- a/map.c
+++ b/map.c
@@ -15,6 +15,7 @@
 
 #include "leo.h"
 #include "osm.h"
+#include "shp.h"
 #include "map.h"
 #include "css.h"
 #include "sym.h"
@@ -44,6 +45,7 @@ static const char * const map_formats[] = {
   "invalid",
   "osmxml",
   "fixed",
+  "shape",
 };
 
 static struct cf_section map_source_cf = {
@@ -236,6 +238,13 @@ static void map_load_source(struct data_source *ds)
       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");
     }