How to use OSM with EPSG:31467

I tried to set up a OSM-WMS.
I used these instructions:
http://trac.osgeo.org/mapserver/wiki/RenderingOsmDataUbuntu

I had some problems, because i used newer PostgRes etc. but now it works.

Now i want to add EPSG:31467, so i added in
/home/user/osm-demo/mapserver-utils-svn/Makefile EPSG:31467 to OSM_WMS_SRS

My Makefile:

UNAME := $(shell uname)

ifeq ($(UNAME), Darwin)
SED=sed -i ""
CPP=cpp-4.2
else
SED=sed -i
CPP=cpp
endif


OSM_PREFIX=osm_new_
OSM_NAME_COLUMN=name
#OSM_SRID=4326
#OSM_UNITS=dd
#OSM_EXTENT=-180 -90 180 90
OSM_SRID=900913
OSM_UNITS=meters
OSM_EXTENT=-20000000 -20000000 20000000 20000000
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"
DEBUG=1
LAYERDEBUG=1
STYLE=google
#can also use google or bing

template=osmbase.map

includes=land.map landusage.map borders.map highways.map places.map \
		 generated/$(STYLE)style.msinc \
		 generated/$(STYLE)level0.msinc generated/$(STYLE)level1.msinc generated/$(STYLE)level2.msinc generated/$(STYLE)level3.msinc \
		 generated/$(STYLE)level4.msinc generated/$(STYLE)level5.msinc generated/$(STYLE)level6.msinc generated/$(STYLE)level7.msinc \
		 generated/$(STYLE)level8.msinc generated/$(STYLE)level9.msinc generated/$(STYLE)level10.msinc generated/$(STYLE)level11.msinc \
		 generated/$(STYLE)level12.msinc generated/$(STYLE)level13.msinc generated/$(STYLE)level14.msinc generated/$(STYLE)level15.msinc \
		 generated/$(STYLE)level16.msinc generated/$(STYLE)level17.msinc generated/$(STYLE)level18.msinc



mapfile=osm-$(STYLE).map
here=`pwd`

all:$(mapfile) boundaries.sql

generated/$(STYLE)style.msinc: generate_style.py
	python generate_style.py -s $(STYLE) -g > $@

generated/$(STYLE)level0.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 0 > $@ 

generated/$(STYLE)level1.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 1 > $@ 

generated/$(STYLE)level2.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 2 > $@ 

generated/$(STYLE)level3.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 3 > $@ 

generated/$(STYLE)level4.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 4 > $@ 

generated/$(STYLE)level5.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 5 > $@ 

generated/$(STYLE)level6.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 6 > $@ 

generated/$(STYLE)level7.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 7 > $@ 

generated/$(STYLE)level8.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 8 > $@ 

generated/$(STYLE)level9.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 9 > $@ 

generated/$(STYLE)level10.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 10 > $@

generated/$(STYLE)level11.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 11 > $@

generated/$(STYLE)level12.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 12 > $@

generated/$(STYLE)level13.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 13 > $@

generated/$(STYLE)level14.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 14 > $@

generated/$(STYLE)level15.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 15 > $@

generated/$(STYLE)level16.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 16 > $@

generated/$(STYLE)level17.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 17 > $@

generated/$(STYLE)level18.msinc: generate_style.py
	python generate_style.py  -s $(STYLE) -l 18 > $@

$(mapfile):$(template) $(includes) shapefiles
	$(CPP) -D_debug=$(DEBUG) -D_layerdebug=$(LAYERDEBUG)  -DOSM_PREFIX=$(OSM_PREFIX) -DOSM_SRID=$(OSM_SRID) -P -o $(mapfile) $(template) -DTHEME=$(STYLE) -D_proj_lib=\"$(here)\" -Igenerated
	$(SED) 's/##.*$$//g' $(mapfile)
	$(SED) '/^ *$$/d' $(mapfile)
	$(SED) -e 's/OSM_PREFIX_/$(OSM_PREFIX)/g' $(mapfile)
	$(SED) -e 's/OSM_SRID/$(OSM_SRID)/g' $(mapfile)
	$(SED) -e 's/OSM_UNITS/$(OSM_UNITS)/g' $(mapfile)
	$(SED) -e 's/OSM_EXTENT/$(OSM_EXTENT)/g' $(mapfile)
	$(SED) -e 's/OSM_WMS_SRS/$(OSM_WMS_SRS)/g' $(mapfile)
	$(SED) -e 's/OSM_NAME_COLUMN/$(OSM_NAME_COLUMN)/g' $(mapfile)

boundaries.sql: boundaries.sql.in
	cp -f $< $@
	$(SED) -e 's/OSM_PREFIX_/$(OSM_PREFIX)/g' $@

clean:
	rm -f generated/*

shapefiles:
	cd data; $(MAKE) $(MFLAGS)

Additional i edited my mapcache-osm.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!-- see the accompanying mapcache.xml.sample for a fully commented configuration file -->

<mapcache>
   <cache name="disk" type="disk">
      <base>/tmp</base>
      <symlink_blank/>
   </cache>
   <cache name="sqlite" type="sqlite3">
      <base>/tmp</base>
   </cache>
   <source name="vmap0" type="wms">
      <getmap>
         <params>
            <FORMAT>image/png</FORMAT>
            <LAYERS>default</LAYERS>
         </params>
      </getmap>
      
      <http>
         <url>http://localhost/cgi-bin/mapserv?map=/gro1/mapserver-utils/osm-google.map</url>
      </http>
   </source>
  

<source name="osm" type="wms">
 <getmap>
         <params>
            <FORMAT>image/png</FORMAT>
            <LAYERS>default</LAYERS>
         </params>
      </getmap>

      <http>
         <url>http://localhost/cgi-bin/mapserv?map=/home/user/osm-demo/mapserver-utils-svn/osm-google.map</url>
      </http>
	<MAP>/home/user/osm-demo/mapserver-utils-svn/osm-google.map</MAP>

</source>

<grid name="GK3">
      <metadata>
      <title>GK3</title>
      </metadata>
      <srs>EPSG:31467</srs>
      <srsalias>EPSG:GK3</srsalias>
      <size>256 256</size>
      <extent>3.2803e+006 5.2375e+006 3.9216e+006 6.1062e+006</extent>
      <resolutions>0.1 0.05 0.025 0.0125</resolutions>
</grid>
   
   <tileset name="test">
      <source>vmap0</source>
      <cache>sqlite</cache>
      <grid>WGS84</grid>
      <grid>g</grid>
      <format>PNG</format>
      <metatile>5 5</metatile>
      <metabuffer>10</metabuffer>
      <expires>3600</expires>
   </tileset>
  
<tileset name="osm">
      <metadata>
         <title>OSM MapServer served map</title>
         <abstract>see http://trac.osgeo.org/mapserver/wiki/RenderingOsmDataUbuntu</abstract>
      </metadata>
      <source>osm</source>
      <cache>disk</cache>
      <format>PNG</format>
      <grid>g</grid>
      <grid>WGS84</grid>
      <grid>GK3</grid>
      <metatile>5 5</metatile>
      <expires>10000</expires>
      <auto_expire>86400</auto_expire>
      <metabuffer>10</metabuffer>
   </tileset>

   <default_format>JPEG</default_format>

   <service type="wms" enabled="true">
      <full_wms>assemble</full_wms>
      <resample_mode>bilinear</resample_mode>
      <format>JPEG</format>
      <maxsize>4096</maxsize>
   </service>
   <service type="wmts" enabled="true"/>
   <service type="tms" enabled="true"/>
   <service type="kml" enabled="true"/>
   <service type="gmaps" enabled="true"/>
   <service type="ve" enabled="true"/>
   <service type="demo" enabled="true"/>

   <errors>report</errors>
   <lock_dir>/tmp</lock_dir>

</mapcache>

I do not know if this is correct


<grid name="GK3">
      <metadata>
         <title>GK3</title>
      </metadata>
      <srs>EPSG:31467</srs>
      <srsalias>EPSG:GK3</srsalias>
      <size>256 256</size>
      <extent>3.2803e+006 5.2375e+006 3.9216e+006 6.1062e+006</extent>
      <resolutions>0.1 0.05 0.025 0.0125</resolutions>
</grid>

http://127.0.0.1/mapcache/demo/wms is working with osm-g-wms, but selecting osm-GK3-wms don’t work.

if i request:
http://127.0.0.1/mapcache/?LAYERS=osm&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&SRS=EPSG%3A31467&BBOX=3471736,5933213,3474910,5936388&WIDTH=256&HEIGHT=256

i have in apache2/error.log:


[Wed Jul 11 11:32:02 2012] [error] [client 127.0.0.1] CGI Request 1 on process 26672
[Wed Jul 11 11:32:02 2012] [error] [client 127.0.0.1] msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Wed Jul 11 11:32:05 2012] [error] [client 127.0.0.1] msDrawLabelCache(): labelcache_map_edge_buffer = 10
[Wed Jul 11 11:32:10 2012] [error] [client 127.0.0.1] CGI Request 1 on process 26677
[Wed Jul 11 11:32:11 2012] [error] [client 127.0.0.1] msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Wed Jul 11 11:32:13 2012] [error] [client 127.0.0.1] msDrawLabelCache(): labelcache_map_edge_buffer = 10
[Wed Jul 11 11:32:16 2012] [error] [client 127.0.0.1] CGI Request 1 on process 26682
[Wed Jul 11 11:32:16 2012] [error] [client 127.0.0.1] CGI Request 1 on process 26683
[Wed Jul 11 11:32:16 2012] [error] [client 127.0.0.1] CGI Request 1 on process 26684
[Wed Jul 11 11:32:16 2012] [error] [client 127.0.0.1] msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Wed Jul 11 11:32:16 2012] [error] [client 127.0.0.1] msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Wed Jul 11 11:32:17 2012] [error] [client 127.0.0.1] msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Wed Jul 11 11:32:19 2012] [error] [client 127.0.0.1] msDrawLabelCache(): labelcache_map_edge_buffer = 10
[Wed Jul 11 11:32:21 2012] [error] [client 127.0.0.1] msDrawLabelCache(): labelcache_map_edge_buffer = 10
[Wed Jul 11 11:32:22 2012] [error] [client 127.0.0.1] msDrawLabelCache(): labelcache_map_edge_buffer = 10

i Don’t know what i have to do or what i have done wrong :frowning:
i hope someone can help me.