[postgis-users] OSM2pgsql, OpenStreetMap, MapServer, EPSG:900913, OpenLayers: issue
Ben Madin
lists at remoteinformation.com.au
Thu May 6 08:37:59 PDT 2010
I think you need to ask this on the MapServer List - MapServer doesn't use the postgis spatial_ref_sys table for it's projections, but the proj epsg library files, so you need to put the definition in there - I googled " MapServer Spherical Mercator Projection 900913 " to find out how to do this.
alternatively, you could just put the projection directly into the mapfile - look at http://spatialreference.org/ref/sr-org/6/
and click on MapServer mapfile
PROJECTION
"proj=merc"
"a=6378137"
"b=6378137"
"lat_ts=0.0"
"lon_0=0.0"
"x_0=0.0"
"y_0=0"
"k=1.0"
"units=m"
"nadgrids=@null"
"wktext"
"no_defs"
END
good luck.
cheers
Ben
On 06/05/2010, at 21:10 , roshni.spain wrote:
>
> Hi, I have more or less the same problem than you. I am rendering OSM data
> (imported to PostGIS with osm2pgsql) and i need to view the map with
> OpenLayers on MapServer.
>
> I am more or less on the same point than you, because when i changed on the
> map file all the projection info to "init=epsg:900913", the map goes blank.
> It comes empty with no information. Plus, the mapserver does not return any
> error in the log, and i really have no clue what i can do to fix this.
>
> My OSM data table (planet_osm_line) is on epsg:900913 and this is what i
> need to show on the map, but with no success. I have tried many options but
> i can never go further than this.
> Any clue??
> Thank you
>
>
> ibrahim saricicek wrote:
>>
>> Hi;
>>
>> 1) is your osm data table in Epsg:4326 projection?
>> if so use; "init=epsg:4326" for each layer..
>> 2) 'grey empty image'?? so you can get map from mapserver?
>> right click on a tile and copy image location. Try the copied url, is
>> there
>> an error?
>>
>> Regards..
>>
>>
>> On Tue, Mar 16, 2010 at 12:20 PM, Mulone1 <mulone at rome.com> wrote:
>>
>>>
>>> (apologies for cross-posting)
>>>
>>> Hi everybody,
>>> I'm trying to render openstreetmap data on a WMS on MapServer.
>>> The system used to work with epsg:4326 but in our project we need a
>>> GoogleMaps like projection and we chose epsg:900913.
>>>
>>> These are the steps I followed to reimport everything for the new
>>> projection:
>>>
>>> 1) download osm xml file from Cloudmade (e.g. Italy.osm.bz2)
>>> 2) Run 900913.sql on my PostGIS
>>> 3) import that file into PostGIS with command:
>>>
>>> ./osm2pgsql -U userid -W -H host -d maps -p myprefix -S default.style -c
>>> -m
>>> italy.osm.bz2
>>>
>>> 4) At this point everything seems ok. The geometry columns have 900913 as
>>> SRID.
>>> 5) update MapFile with:
>>>
>>> WEB
>>> METADATA
>>> wms_srs "epsg:900913"
>>> ...
>>>
>>> PROJECTION
>>> "init=epsg:900913"
>>> END
>>>
>>> Then in each layer I put:
>>>
>>> PROJECTION "init=epsg:900913" END
>>>
>>> and all of the queries have: using srid=900913
>>>
>>> 6) load the wms layer into OpenLayers
>>> with
>>>
>>> var wms = new OpenLayers.Layer.WMS("OpenStreetMap", mainurl, {
>>> ...
>>> units : 'm',
>>> projection:new OpenLayers.Projection("EPSG:900913"),
>>> ...
>>>
>>>
>>>
>>> Unfortunately all I get is a grey empty image. Looking at the map server
>>> log
>>> I noticed that it's full of:
>>>
>>> [Mon Mar 15 17:49:44 2010].517000 msPostGISLayerWhichShapes query status:
>>> 2
>>> [Mon Mar 15 17:49:44 2010].517000 msPostGISLayerWhichShapes got 0 records
>>> in
>>> result.
>>> [Mon Mar 15 17:49:44 2010].517000 msPostGISLayerNextShape called.
>>>
>>>
>>> With the other projection I was getting the records.
>>>
>>> Do you have any idea about what could be wrong in my set up? I tried to
>>> debug it in several ways but I couldn't find anything wrong.
>>>
>>> Cheers,
>>> Mulone
>>> --
>>> View this message in context:
>>> http://old.nabble.com/OSM2pgsql%2C-OpenStreetMap%2C-MapServer%2C-EPSG%3A900913%2C-OpenLayers%3A-issue-tp27915684p27915684.html
>>> Sent from the PostGIS - User mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
> --
> View this message in context: http://old.nabble.com/OSM2pgsql%2C-OpenStreetMap%2C-MapServer%2C-EPSG%3A900913%2C-OpenLayers%3A-issue-tp27915684p28472339.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list