[Geoserver-users] Matching of Google Maps zoom levels with SLD

Hi,

Some days ago I sent a message about matching of Google Maps Zoom
levels to ScaleDenomintaor to use inside SLD documents. Forget about
it, is wrong :smiley:

No, what I did not consider is that the world is a sphere and the
scale changes when you move north and south in a flat map. Actually
Google Maps is very smart and changes the scale dynamically when you
move with it.

So, after some time investigating a good range of values that will let
me switch correctly in almost every latitude I got into something. Is
not perfect but for Euope and EEUU works fine. For other parts of the
world also of course, but you might have to tune a little bit the
ranges so that your country doesn't fail in the middle of a transition
from a scale to another. Is much better to show it in a map:

http://synthesys.csic.es/gmap/GmapExample.php

The SLD document is available here:

http://synthesys.csic.es/SLD/GMapExample.sld.xml

I know, I know, I should write all this on the wiki, I promise I will
do when I have a little bit more of time. Together with a nice way of
editing and testing SLD. You just have to edit the SLD document in a
file accessible trough http to the geoserver and use the SLD
parameter, for example:

http://synthesys.csic.es:8080/geoserver/wms?&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=tdwg:world_countries&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:41001&BBOX=-9985163.032194631,4992581.569375542,-4992581.516097316,9985163.03209607&WIDTH=256&HEIGHT=256&reaspect=false&SLD=http%3A%2F%2Fsynthesys.csic.es%2FSLD%2FGMapExample.sld.xml

Then you cna modify your SLD and directly refrsh the page to see if it
works or not :slight_smile: Pity that the WMS specifications set incorrectly the
mime type of the reponse because when I get an error Firefox ask me to
download it and I have to open it...

Hope this is useful.

Javier.

Thanks for the cool information Javier. If you want me to start a wiki page for you just ask.

Brent Owens
(The Open Planning Project)

Javier de la Torre wrote:

Hi,

Some days ago I sent a message about matching of Google Maps Zoom
levels to ScaleDenomintaor to use inside SLD documents. Forget about
it, is wrong :smiley:

No, what I did not consider is that the world is a sphere and the
scale changes when you move north and south in a flat map. Actually
Google Maps is very smart and changes the scale dynamically when you
move with it.

So, after some time investigating a good range of values that will let
me switch correctly in almost every latitude I got into something. Is
not perfect but for Euope and EEUU works fine. For other parts of the
world also of course, but you might have to tune a little bit the
ranges so that your country doesn't fail in the middle of a transition
from a scale to another. Is much better to show it in a map:

http://synthesys.csic.es/gmap/GmapExample.php

The SLD document is available here:

http://synthesys.csic.es/SLD/GMapExample.sld.xml

I know, I know, I should write all this on the wiki, I promise I will
do when I have a little bit more of time. Together with a nice way of
editing and testing SLD. You just have to edit the SLD document in a
file accessible trough http to the geoserver and use the SLD
parameter, for example:

http://synthesys.csic.es:8080/geoserver/wms?&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=tdwg:world_countries&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:41001&BBOX=-9985163.032194631,4992581.569375542,-4992581.516097316,9985163.03209607&WIDTH=256&HEIGHT=256&reaspect=false&SLD=http%3A%2F%2Fsynthesys.csic.es%2FSLD%2FGMapExample.sld.xml

Then you cna modify your SLD and directly refrsh the page to see if it
works or not :slight_smile: Pity that the WMS specifications set incorrectly the
mime type of the reponse because when I get an error Firefox ask me to
download it and I have to open it...

Hope this is useful.

Javier.

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Well, this information should probably just go directly on: http://docs.codehaus.org/display/GEOSDOC/Google+Maps

I'll include at least a link to this email there now... If someone has some time to port more than go for it.

C

Brent Owens wrote:

Thanks for the cool information Javier. If you want me to start a wiki page for you just ask.

Brent Owens
(The Open Planning Project)

Javier de la Torre wrote:

Hi,

Some days ago I sent a message about matching of Google Maps Zoom
levels to ScaleDenomintaor to use inside SLD documents. Forget about
it, is wrong :smiley:

No, what I did not consider is that the world is a sphere and the
scale changes when you move north and south in a flat map. Actually
Google Maps is very smart and changes the scale dynamically when you
move with it.

So, after some time investigating a good range of values that will let
me switch correctly in almost every latitude I got into something. Is
not perfect but for Euope and EEUU works fine. For other parts of the
world also of course, but you might have to tune a little bit the
ranges so that your country doesn't fail in the middle of a transition
from a scale to another. Is much better to show it in a map:

http://synthesys.csic.es/gmap/GmapExample.php

The SLD document is available here:

http://synthesys.csic.es/SLD/GMapExample.sld.xml

I know, I know, I should write all this on the wiki, I promise I will
do when I have a little bit more of time. Together with a nice way of
editing and testing SLD. You just have to edit the SLD document in a
file accessible trough http to the geoserver and use the SLD
parameter, for example:

http://synthesys.csic.es:8080/geoserver/wms?&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=tdwg:world_countries&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:41001&BBOX=-9985163.032194631,4992581.569375542,-4992581.516097316,9985163.03209607&WIDTH=256&HEIGHT=256&reaspect=false&SLD=http%3A%2F%2Fsynthesys.csic.es%2FSLD%2FGMapExample.sld.xml

Then you cna modify your SLD and directly refrsh the page to see if it
works or not :slight_smile: Pity that the WMS specifications set incorrectly the
mime type of the reponse because when I get an error Firefox ask me to
download it and I have to open it...

Hope this is useful.

Javier.

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,4498263f223221775926497!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org