| 121 | * Note: multiple .osm.pbf files can be loaded in separate commands using the --merge-cache argument. |
| 122 | |
| 123 | == Install mapserver-utils mapfile generator == |
| 124 | |
| 125 | * Website: http://code.google.com/p/mapserver-utils/ |
| 126 | * Check out the 'imposm-branch' from SVN: |
| 127 | {{{ |
| 128 | cd ~/osm-demo/ |
| 129 | svn checkout http://mapserver-utils.googlecode.com/svn/branches/imposm-branch/ mapserver-utils-svn-imposm |
| 130 | cd mapserver-utils-svn-imposm |
| 131 | }}} |
| 132 | * Update mapserver-utils's osm-base.map and Makefile as follows: |
| 133 | {{{ |
| 134 | -------------------8<------------------------ |
| 135 | Index: osmbase.map |
| 136 | =================================================================== |
| 137 | --- osmbase.map (revision 83) |
| 138 | +++ osmbase.map (working copy) |
| 139 | @@ -7,6 +7,7 @@ |
| 140 | SIZE 800 800 |
| 141 | EXTENT 47586 1621243 1197769 2679357 |
| 142 | EXTENT 16805492 -4049385 16857351 -3975830 |
| 143 | +EXTENT -20000000 -20000000 20000000 20000000 |
| 144 | UNITS OSM_UNITS |
| 145 | IMAGECOLOR _ocean_clr0 |
| 146 | WEB |
| 147 | @@ -16,6 +17,8 @@ |
| 148 | "labelcache_map_edge_buffer" "-10" |
| 149 | "wms_title" "osm france" |
| 150 | END |
| 151 | + IMAGEPATH "/tmp/ms_tmp/" |
| 152 | + IMAGEURL "/ms_tmp/" |
| 153 | END |
| 154 | |
| 155 | DEBUG _debug |
| 156 | Index: Makefile |
| 157 | =================================================================== |
| 158 | --- Makefile (revision 83) |
| 159 | +++ Makefile (working copy) |
| 160 | @@ -1,11 +1,12 @@ |
| 161 | -CPP=cpp |
| 162 | +CPP=cpp-4.4 |
| 163 | |
| 164 | OSM_PREFIX=osm_new_ |
| 165 | OSM_SRID=4326 |
| 166 | -OSM_UNITS=dd |
| 167 | +OSM_SRID=900913 |
| 168 | +OSM_UNITS=meters |
| 169 | OSM_WMS_SRS="EPSG:900913 EPSG:4326 EPSG:3857 EPSG:2154 EPSG:310642901 EPSG:4171 EPSG:310024802 EPSG:310915814 EPSG:310486805 EPSG:310702807 EPSG:310700806 EPSG:310547809 EPSG:310706808 EPSG:310642810 EPSG:310642801 EPSG:310642812 EPSG:310032811 EPSG:310642813 EPSG:2986" |
| 170 | -DEBUG=1 |
| 171 | -LAYERDEBUG=1 |
| 172 | +DEBUG=2 |
| 173 | +LAYERDEBUG=2 |
| 174 | |
| 175 | template=osmbase.map |
| 176 | |
| 177 | -------------------->8----------------------- |
| 178 | }}} |
| 179 | |
| 180 | * Execute the mapserver-utils makefile to generate the mapfile. Note that the first time you run 'make' several large files will be downloaded (country boundaries, etc.). This will happen only the first time. |
| 181 | {{{ |
| 182 | cd ~/osm-demo/mapserver-utils-svn-imposm |
| 183 | make |
| 184 | }}} |
| 185 | * Create MapServer temp dirs (required by mapserv CGI for testing with openlayers template) |
| 186 | {{{ |
| 187 | mkdir /tmp/ms_tmp |
| 188 | chmod 777 /tmp/ms_tmp |
| 189 | }}} |
| 190 | |
| 191 | * Access your map online using MapServer's built-in template=openlayers mode: |
| 192 | {{{ |
| 193 | http://yourserver.tld/cgi-bin/mapserv?map=/path/to/osm-demo/mapserver-utils-svn-imposm/osm.map&mode=browse&template=openlayers&layers=all |
| 194 | }}} |