Oh, there have been great advances since you last checked, the open source world finally figured out Google's projection!
All you have to do now is request 900913, no need to change srs at different zoom levels. See http://crschmidt.net/blog/archives/243/google-projection-900913/
Chris
Javier de la Torre wrote:
Hi all,
I am trying to use Geoserver with Google maps. I've tried before and works fine, but this time I am having an issue with someone else WMS server. The issue is that Google maps requiere to change the SRS you want your map back at different zoom levels. Right now I just wanna have EPSG:4326 and EPSG:54004. In the server both get advertised as "usable". But when I tried to get the data with the two of them I get very different results for the same URL:
4326:
http://geoserver.gbif.org/wms?LAYERS=gbif%3AgbifDensityLayer&VERSION=1.0.0&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&STYLES=&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256&SLD=http%3A%2F%2Fwww.imaste-ips.com%2Ftmp%2FdensityLayerJavier.sld
FINE!
http://geoserver.gbif.org/wms?LAYERS=gbif%3AgbifDensityLayer&VERSION=1.0.0&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&STYLES=&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A54004&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256&SLD=http%3A%2F%2Fwww.imaste-ips.com%2Ftmp%2FdensityLayerJavier.sld
not fine, just a little dot in the middle of knowhere...
Any idea of what is this happening?
Thanks in advance.
Javier.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:4005,47c5d581292521012714783!
Javier de la Torre ha scritto:
Hi all,
I am trying to use Geoserver with Google maps. I've tried before and works fine, but this time I am having an issue with someone else WMS server. The issue is that Google maps requiere to change the SRS you want your map back at different zoom levels.
That's the old wisdom. The correct answer to the problem is the epsg:900913 projection, which is just one and works for every
zoom level for Google maps.
Now, that server you're pointing at is a little old, it's 1.5.3,
it has an early version of the 900913 projection but I'm not sure
it works 100% correct.
Right now I just wanna have EPSG:4326 and EPSG:54004. In the server both get advertised as "usable". But when I tried to get the data with the two of them I get very different results for the same URL:
4326:
http://geoserver.gbif.org/wms?LAYERS=gbif%3AgbifDensityLayer&VERSION=1.0.0&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&STYLES=&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256&SLD=http%3A%2F%2Fwww.imaste-ips.com%2Ftmp%2FdensityLayerJavier.sld
FINE!
http://geoserver.gbif.org/wms?LAYERS=gbif%3AgbifDensityLayer&VERSION=1.0.0&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&STYLES=&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A54004&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256&SLD=http%3A%2F%2Fwww.imaste-ips.com%2Ftmp%2FdensityLayerJavier.sld
not fine, just a little dot in the middle of knowhere...
You're using a mercator projection and keep on passing lon/lat coordinates to the map. The bbox should be projected
in 54004 if you want to make a proper request.
If 900913 works fine OpenLayers has direct support for it and you
should be able with it easily, we have some examples in the
latest versions of GeoServer (see demo and then overlays
with google maps, yahoo maps and virtual earth).
Cheers
Andrea
Thats great!
I checked on the geoserver wiki but did not find this info. I will try
to update the info there once I have my map working.
Anjother question. To use this projection what kind of coordinates I
have to send? The X and Y tile parameters that Google uses or still
the bounding box in lat/lon?
On the other hand I was thinking on using Amazon S3 to create a cache
for the requests I produce, anybody has done something similar?
And if someone is interested I have created a Google Maps Interface using Flex.
Cheers.
On Thu, Feb 28, 2008 at 9:27 AM, Andrea Aime <aaime@anonymised.com> wrote:
Javier de la Torre ha scritto:
> Hi all,
>
> I am trying to use Geoserver with Google maps. I've tried before and
> works fine, but this time I am having an issue with someone else WMS
> server. The issue is that Google maps requiere to change the SRS you
> want your map back at different zoom levels.
That's the old wisdom. The correct answer to the problem is the
epsg:900913 projection, which is just one and works for every
zoom level for Google maps.
Now, that server you're pointing at is a little old, it's 1.5.3,
it has an early version of the 900913 projection but I'm not sure
it works 100% correct.
> Right now I just wanna
> have EPSG:4326 and EPSG:54004. In the server both get advertised as
> "usable". But when I tried to get the data with the two of them I get
> very different results for the same URL:
> 4326:
> http://geoserver.gbif.org/wms?LAYERS=gbif%3AgbifDensityLayer&VERSION=1.0.0&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&STYLES=&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256&SLD=http%3A%2F%2Fwww.imaste-ips.com%2Ftmp%2FdensityLayerJavier.sld
>
> FINE!
>
>
> http://geoserver.gbif.org/wms?LAYERS=gbif%3AgbifDensityLayer&VERSION=1.0.0&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&STYLES=&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A54004&BBOX=-180,-90,180,90&WIDTH=256&HEIGHT=256&SLD=http%3A%2F%2Fwww.imaste-ips.com%2Ftmp%2FdensityLayerJavier.sld
>
> not fine, just a little dot in the middle of knowhere...
You're using a mercator projection and keep on passing lon/lat
coordinates to the map. The bbox should be projected
in 54004 if you want to make a proper request.
If 900913 works fine OpenLayers has direct support for it and you
should be able with it easily, we have some examples in the
latest versions of GeoServer (see demo and then overlays
with google maps, yahoo maps and virtual earth).
Cheers
Andrea
Javier de la Torre wrote:
Thats great!
I checked on the geoserver wiki but did not find this info. I will try
to update the info there once I have my map working.
Anjother question. To use this projection what kind of coordinates I
have to send? The X and Y tile parameters that Google uses or still
the bounding box in lat/lon?
In spherical mercator the world is a square and the world bounding box is
-20037508.34 -20037508.34 20037508.34 20037508.34
(max west , max south, max east , max north)
On the other hand I was thinking on using Amazon S3 to create a cache
for the requests I produce, anybody has done something similar?
Tilecache.org currently has some kind of support for this, though I
haven't tried it yet. I'm working on getting it into geowebcache.org,
which we hope to ship with GeoServer before long.
And if someone is interested I have created a Google Maps Interface using Flex.
Always curios to have a look, is there a demo?
-Arne
Hi Arne,
Thanks for the info.
I am trying to adjust my app now to work with 900913 projection, but I am struggling a bit.
I am using a flex client that does not know anything about WMS and projections so I have to handle it myself. Converting Google tiles to 4326 coordinates was not that complicate, but know I am lost on how to convert from the X,Y,Z tile information I have in the client to a bbox in 900913 for a wms url request.
Do you know how can I convert from Google tiles number X,Y and Z (zoom level) to this bbox? OpenLayer must be doing the same at some point but I cant figure out.
Thanks in advance.
Javier.
On 28/02/2008, at 16:00, Arne Kepp wrote:
Javier de la Torre wrote:
Thats great!
I checked on the geoserver wiki but did not find this info. I will try
to update the info there once I have my map working.
Anjother question. To use this projection what kind of coordinates I
have to send? The X and Y tile parameters that Google uses or still
the bounding box in lat/lon?
In spherical mercator the world is a square and the world bounding box is
-20037508.34 -20037508.34 20037508.34 20037508.34
(max west , max south, max east , max north)
On the other hand I was thinking on using Amazon S3 to create a cache
for the requests I produce, anybody has done something similar?
Tilecache.org currently has some kind of support for this, though I haven't tried it yet. I'm working on getting it into geowebcache.org, which we hope to ship with GeoServer before long.
And if someone is interested I have created a Google Maps Interface using Flex.
Always curios to have a look, is there a demo?
-Arne
Once GeoWebCache is in GeoServer you can probably use xyz directly, but if you want your data uncached or right now, without GWC, then you need to convert to 900913 coordinates (note that they are not lat/lon).
To convert to 900913 coordinates:
http://code.google.com/apis/maps/documentation/overlays.html#Tile_Overlays
Note that they have switched x and y on the second grid (documentation bug) , and use the bounding box mentioned below for world bounds. The required code should be very simple.
-Arne
Javier de la Torre wrote:
Hi Arne,
Thanks for the info.
I am trying to adjust my app now to work with 900913 projection, but I am struggling a bit.
I am using a flex client that does not know anything about WMS and projections so I have to handle it myself. Converting Google tiles to 4326 coordinates was not that complicate, but know I am lost on how to convert from the X,Y,Z tile information I have in the client to a bbox in 900913 for a wms url request.
Do you know how can I convert from Google tiles number X,Y and Z (zoom level) to this bbox? OpenLayer must be doing the same at some point but I cant figure out.
Thanks in advance.
Javier.
On 28/02/2008, at 16:00, Arne Kepp wrote:
Javier de la Torre wrote:
Thats great!
I checked on the geoserver wiki but did not find this info. I will try
to update the info there once I have my map working.
Anjother question. To use this projection what kind of coordinates I
have to send? The X and Y tile parameters that Google uses or still
the bounding box in lat/lon?
In spherical mercator the world is a square and the world bounding box is
-20037508.34 -20037508.34 20037508.34 20037508.34
(max west , max south, max east , max north)
On the other hand I was thinking on using Amazon S3 to create a cache
for the requests I produce, anybody has done something similar?
Tilecache.org currently has some kind of support for this, though I haven't tried it yet. I'm working on getting it into geowebcache.org, which we hope to ship with GeoServer before long.
And if someone is interested I have created a Google Maps Interface using Flex.
Always curios to have a look, is there a demo?
-Arne
!DSPAM:4038,47f0d30b91595219720167!
Yeah,
Ok, I have it working.
I will check out how well it align with the other stuff 
Thanks Arne.
Javier.
On 31/03/2008, at 15:42, Arne Kepp wrote:
Once GeoWebCache is in GeoServer you can probably use xyz directly, but if you want your data uncached or right now, without GWC, then you need to convert to 900913 coordinates (note that they are not lat/lon).
To convert to 900913 coordinates:
http://code.google.com/apis/maps/documentation/overlays.html#Tile_Overlays
Note that they have switched x and y on the second grid (documentation bug) , and use the bounding box mentioned below for world bounds. The required code should be very simple.
-Arne
Javier de la Torre wrote:
Hi Arne,
Thanks for the info.
I am trying to adjust my app now to work with 900913 projection, but I am struggling a bit.
I am using a flex client that does not know anything about WMS and projections so I have to handle it myself. Converting Google tiles to 4326 coordinates was not that complicate, but know I am lost on how to convert from the X,Y,Z tile information I have in the client to a bbox in 900913 for a wms url request.
Do you know how can I convert from Google tiles number X,Y and Z (zoom level) to this bbox? OpenLayer must be doing the same at some point but I cant figure out.
Thanks in advance.
Javier.
On 28/02/2008, at 16:00, Arne Kepp wrote:
Javier de la Torre wrote:
Thats great!
I checked on the geoserver wiki but did not find this info. I will try
to update the info there once I have my map working.
Anjother question. To use this projection what kind of coordinates I
have to send? The X and Y tile parameters that Google uses or still
the bounding box in lat/lon?
In spherical mercator the world is a square and the world bounding box is
-20037508.34 -20037508.34 20037508.34 20037508.34
(max west , max south, max east , max north)
On the other hand I was thinking on using Amazon S3 to create a cache
for the requests I produce, anybody has done something similar?
Tilecache.org currently has some kind of support for this, though I haven't tried it yet. I'm working on getting it into geowebcache.org, which we hope to ship with GeoServer before long.
And if someone is interested I have created a Google Maps Interface using Flex.
Always curios to have a look, is there a demo?
-Arne
!DSPAM:4038,47f0d30b91595219720167!