Skip to content

Commit

Permalink
continued transition to new format
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed May 15, 2011
1 parent 5e3bf30 commit 696d9eb
Show file tree
Hide file tree
Showing 16 changed files with 911 additions and 572 deletions.
12 changes: 7 additions & 5 deletions Makefile
@@ -1,13 +1,15 @@
CPP=cpp
CPP=cpp-4.2

OSM_PREFIX=osm_new_
OSM_SRID=4326
OSM_UNITS=dd
OSM_WMS_SRS="EPSG:900913 EPSG:4326 EPSG:3857"
DEBUG=1
LAYERDEBUG=1

template=osmbase.map
theme=osm
includes=landusage.map borders.map highways.map places.map $(theme).style\

includes=land.map landusage.map borders.map highways.map places.map \
style.inc \
level0.inc level1.inc level2.inc level4.inc level3.inc level5.inc level6.inc\
level7.inc level8.inc level9.inc level10.inc level11.inc level12.inc\
Expand All @@ -20,7 +22,7 @@ here=`pwd`

all:$(mapfile) boundaries.sql

SED=sed
SED=gsed
SEDI=$(SED) -i
#if on BSD, use
# SED=sed -i ""
Expand Down Expand Up @@ -86,7 +88,7 @@ level18.inc: generate_style.py
python generate_style.py -l 18 > $@

$(mapfile):$(template) $(includes) shapefiles
$(CPP) -DOSM_PREFIX=$(OSM_PREFIX) -DOSM_SRID=$(OSM_SRID) -P -o $(mapfile) $(template) -Dtheme=\"$(theme).style\" -D_proj_lib=\"$(here)\"
$(CPP) -D_debug=$(DEBUG) -D_layerdebug=$(LAYERDEBUG) -DOSM_PREFIX=$(OSM_PREFIX) -DOSM_SRID=$(OSM_SRID) -P -o $(mapfile) $(template) -D_proj_lib=\"$(here)\"
$(SEDI) 's/##.*$$//g' $(mapfile)
$(SEDI) '/^ *$$/d' $(mapfile)
$(SEDI) -e 's/OSM_PREFIX_/$(OSM_PREFIX)/g' $(mapfile)
Expand Down
5 changes: 2 additions & 3 deletions borders.map
@@ -1,14 +1,13 @@
LAYER
_default_layer
GROUP "default"
STATUS ON
MAXSCALEDENOM _maxscale
MINSCALEDENOM _minscale
TYPE LINE
NAME "borders"
DATA _border_data
CLASSITEM "admin_level"
#if _display_border_2 == 1
CLASS
EXPRESSION "2"
#if _display_border_2_outer == 1
STYLE
WIDTH _border_2_width
Expand Down
7 changes: 6 additions & 1 deletion boundaries-gadm.sql
Expand Up @@ -4,7 +4,7 @@ drop table if exists gadm_tmp_rings1;


create table gadm_tmp_rings1 (id integer, geometry geometry);
create table gadm_tmp_rings (id integer, geometry geometry);
create table gadm_tmp_rings (gid serial, id integer, geometry geometry);
insert into gadm_tmp_rings1 (id,geometry) select gid, (st_dump(geometry)).geom from lev0;

insert into gadm_tmp_rings(id,geometry)
Expand All @@ -17,6 +17,11 @@ insert into gadm_tmp_rings (id,geometry)

create index gadm_tmp_rings_idx on gadm_tmp_rings using gist(geometry);
cluster gadm_tmp_rings_idx on gadm_tmp_rings;

delete from gadm_tmp_rings t1 using gadm_tmp_rings t2
where t1.id <> t2.id
and st_disjoint(t1.geometry, t2.geometry);

vacuum analyze;

drop table if exists gadm_boundaries;
Expand Down
Binary file added data/boundaries.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions data/boundaries.prj
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file added data/boundaries.qix
Binary file not shown.
Binary file added data/boundaries.shp
Binary file not shown.
Binary file added data/boundaries.shx
Binary file not shown.
2 changes: 1 addition & 1 deletion dbconnection
@@ -1 +1 @@
#define _db_connection "host=localhost dbname=osm2 user=osm2 password=osm port=5432"
#define _db_connection "host=localhost dbname=osm user=osm password=osm port=5432"

0 comments on commit 696d9eb

Please sign in to comment.