[Geoserver-users] Help with Google Maps, Geoserver

Hello I’m new at Geoserver and Openlayers.

I am working with a Shapefile (EPSG:4326) that when opened on Google Earth fits like a charm on the correct coordinates.

But when I overlay it on Google Maps using GeoServer it doens’t FIT. 5 - 6 meters away from the target!

Anyone can tell me how can i Fix it?

OpenLayers Code:

var wms = new OpenLayers.Layer.WMS(
“TOPP States”,
http://localhost:8080/geoserver/wms?”,
{
layers: ‘utad:residencia_lotes_terreno’,
styles: ‘’,
srs: ‘EPSG:4326’,
format: ‘image/png’,
tiled: ‘true’,
tilesOrigin : “143.60260815000004,-43.851764249999995”,
transparent: true
},
{
‘opacity’: 0.75, ‘isBaseLayer’: false, ‘wrapDateLine’: true
}
);

var options = {
// the “community” epsg code for spherical mercator
projection: “EPSG:900913”,
// map horizontal units are meters
units: “m”,
// this resolution displays the globe in one 256x256 pixel tile
maxResolution: 156543.0339,
// these are the bounds of the globe in sperical mercator
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508)
};
// construct a map with the above options
map = new OpenLayers.Map(‘map’, options);

// create Google layer
var gsat = new OpenLayers.Layer.Google(
“Google Sattelite”,
{ ‘sphericalMercator’: true}
);

Thanks in advance…


Descubra uma nova internet. Internet Explorer 8. Mergulhe.

You have to use EPSG:900913 throughout.

You can look at the source code of

http://localhost:8080/geoserver/gwc/demo/utad:residencia_lotes_terreno?srs=EPSG:900913

(No need to use GWC, but it shows you how to set the bounds and resolution for the Map and Layer objects).

-Arne

José Adriano Almeida wrote:

Hello I'm new at Geoserver and Openlayers.

I am working with a Shapefile (EPSG:4326) that when opened on Google Earth fits like a charm on the correct coordinates.

But when I overlay it on Google Maps using GeoServer it doens't FIT. 5 - 6 meters away from the target!

Anyone can tell me how can i Fix it?

OpenLayers Code:

var wms = new OpenLayers.Layer.WMS(
                "TOPP States",
                "http://localhost:8080/geoserver/wms?",
                {
                   layers: 'utad:residencia_lotes_terreno',
                   styles: '',
                   srs: 'EPSG:4326',
                   format: 'image/png',
                   tiled: 'true',
                   tilesOrigin : "143.60260815000004,-43.851764249999995",
                   transparent: true
                },
                {
                    'opacity': 0.75, 'isBaseLayer': false, 'wrapDateLine': true
                }
            );

var options = {
                // the "community" epsg code for spherical mercator
                projection: "EPSG:900913",
                // map horizontal units are meters
                units: "m",
                // this resolution displays the globe in one 256x256 pixel tile
                maxResolution: 156543.0339,
                // these are the bounds of the globe in sperical mercator
                maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                                 20037508, 20037508)
            };
            // construct a map with the above options
            map = new OpenLayers.Map('map', options);

            // create Google layer
            var gsat = new OpenLayers.Layer.Google(
                "Google Sattelite",
                { 'sphericalMercator': true}
            );

Thanks in advance...

------------------------------------------------------------------------
Descubra uma nova internet. Internet Explorer 8. Mergulhe. <http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8&gt;

------------------------------------------------------------------------

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com ------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers

Hello Arne, Thanks for the fast answer…

I changed the EPSG , as you recommended:

var wms = new OpenLayers.Layer.WMS(
“Univ”,
http://localhost:8080/geoserver/wms?”,
{
layers: ‘tiger-ny’,
styles: ‘’,
srs: ‘EPSG:900913’,
format: ‘image/png’,
tiled: ‘true’,
tilesOrigin : “143.60260815000004,-43.851764249999995”,
transparent: true
},
{
‘opacity’: 0.75, ‘isBaseLayer’: false, ‘wrapDateLine’: true
}
);

But it stills come away from the target, as you can see in attach.

Do I need to reproject it? If yes, what is the best software for that?

Jose Almeida

Date: Wed, 27 May 2009 18:19:45 +0800
From: ak@anonymised.com
To: bzzoiro@anonymised.com
CC: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Help with Google Maps, Geoserver

You have to use EPSG:900913 throughout.

You can look at the source code of

http://localhost:8080/geoserver/gwc/demo/utad:residencia_lotes_terreno?srs=EPSG:900913

(No need to use GWC, but it shows you how to set the bounds and
resolution for the Map and Layer objects).

-Arne

José Adriano Almeida wrote:

Hello I’m new at Geoserver and Openlayers.

I am working with a Shapefile (EPSG:4326) that when opened on Google
Earth fits like a charm on the correct coordinates.

But when I overlay it on Google Maps using GeoServer it doens’t FIT. 5

  • 6 meters away from the target!

Anyone can tell me how can i Fix it?

OpenLayers Code:

var wms = new OpenLayers.Layer.WMS(
“TOPP States”,
http://localhost:8080/geoserver/wms?”,
{
layers: ‘utad:residencia_lotes_terreno’,
styles: ‘’,
srs: ‘EPSG:4326’,
format: ‘image/png’,
tiled: ‘true’,
tilesOrigin : “143.60260815000004,-43.851764249999995”,
transparent: true
},
{
‘opacity’: 0.75, ‘isBaseLayer’: false,
‘wrapDateLine’: true
}
);

var options = {
// the “community” epsg code for spherical mercator
projection: “EPSG:900913”,
// map horizontal units are meters
units: “m”,
// this resolution displays the globe in one 256x256
pixel tile
maxResolution: 156543.0339,
// these are the bounds of the globe in sperical mercator
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508)
};
// construct a map with the above options
map = new OpenLayers.Map(‘map’, options);

// create Google layer
var gsat = new OpenLayers.Layer.Google(
“Google Sattelite”,
{ ‘sphericalMercator’: true}
);

Thanks in advance…


Descubra uma nova internet. Internet Explorer 8. Mergulhe.
http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8



Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com


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


Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers


Quer uma internet mais segura? Baixe agora o novo Internet Explorer 8. É grátis!

noTitle.JPG

That is not sufficient, for example the tilesOrigin will create problems. You can try setting it to -180.0,-90.0, but there could be other problems as well.

I repeat my suggestion to look at the source of the URL I gave you. My experience is that it's much easier to tweak a working copy than to fix one with broken tile alignment.

-Arne

José Adriano Almeida wrote:

Hello Arne, Thanks for the fast answer...

I changed the EPSG , as you recommended:

var wms = new OpenLayers.Layer.WMS(
                "Univ",
                "http://localhost:8080/geoserver/wms?&quot;,
                {
                   layers: 'tiger-ny',
                   styles: '',
                   srs: 'EPSG:900913',
                   format: 'image/png',
                   tiled: 'true',
                   tilesOrigin : "143.60260815000004,-43.851764249999995",
                   transparent: true
                },
                {
                    'opacity': 0.75, 'isBaseLayer': false, 'wrapDateLine': true
                }
            );

But it stills come away from the target, as you can see in attach.

Do I need to reproject it? If yes, what is the best software for that?

Jose Almeida

> Date: Wed, 27 May 2009 18:19:45 +0800
> From: ak@anonymised.com
> To: bzzoiro@anonymised.com
> CC: geoserver-users@lists.sourceforge.net
> Subject: Re: [Geoserver-users] Help with Google Maps, Geoserver
>
> You have to use EPSG:900913 throughout.
>
> You can look at the source code of
>
> http://localhost:8080/geoserver/gwc/demo/utad:residencia_lotes_terreno?srs=EPSG:900913

>
> (No need to use GWC, but it shows you how to set the bounds and
> resolution for the Map and Layer objects).
>
> -Arne
>
> José Adriano Almeida wrote:
> >
> > Hello I'm new at Geoserver and Openlayers.
> >
> > I am working with a Shapefile (EPSG:4326) that when opened on Google
> > Earth fits like a charm on the correct coordinates.
> >
> > But when I overlay it on Google Maps using GeoServer it doens't FIT. 5
> > - 6 meters away from the target!
> >
> > Anyone can tell me how can i Fix it?
> >
> > OpenLayers Code:
> >
> > var wms = new OpenLayers.Layer.WMS(
> > "TOPP States",
> > "http://localhost:8080/geoserver/wms?&quot;,
> > {
> > layers: 'utad:residencia_lotes_terreno',
> > styles: '',
> > srs: 'EPSG:4326',
> > format: 'image/png',
> > tiled: 'true',
> > tilesOrigin : "143.60260815000004,-43.851764249999995",
> > transparent: true
> > },
> > {
> > 'opacity': 0.75, 'isBaseLayer': false,
> > 'wrapDateLine': true
> > }
> > );
> >
> > var options = {
> > // the "community" epsg code for spherical mercator
> > projection: "EPSG:900913",
> > // map horizontal units are meters
> > units: "m",
> > // this resolution displays the globe in one 256x256
> > pixel tile
> > maxResolution: 156543.0339,
> > // these are the bounds of the globe in sperical mercator
> > maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
> > 20037508, 20037508)
> > };
> > // construct a map with the above options
> > map = new OpenLayers.Map('map', options);
> >
> > // create Google layer
> > var gsat = new OpenLayers.Layer.Google(
> > "Google Sattelite",
> > { 'sphericalMercator': true}
> > );
> >
> > Thanks in advance...
> >
> > ------------------------------------------------------------------------
> > Descubra uma nova internet. Internet Explorer 8. Mergulhe.
> > <http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8&gt;

> >
> > ------------------------------------------------------------------------
> >
> > ------------------------------------------------------------------------------
> > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> > is a gathering of tech-side developers & brand creativity professionals. Meet
> > the minds behind Google Creative Lab, Visual Complexity, Processing, &
> > iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
> > Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Geoserver-users mailing list
> > Geoserver-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geoserver-users
> >
>
> --
> Arne Kepp
> OpenGeo - http://opengeo.org
> Expert service straight from the developers
>

------------------------------------------------------------------------
Quer uma internet mais segura? Baixe agora o novo Internet Explorer 8. É grátis! <http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8&gt;
------------------------------------------------------------------------

--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers

Wooo Now worked like a charm! :smiley:
It is a bit out of site, but i think that could be georeferencing error.

Many Thanks.

Date: Wed, 27 May 2009 18:19:45 +0800
From: ak@anonymised.com
To: bzzoiro@anonymised.com
CC: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Help with Google Maps, Geoserver

You have to use EPSG:900913 throughout.

You can look at the source code of

http://localhost:8080/geoserver/gwc/demo/utad:residencia_lotes_terreno?srs=EPSG:900913

(No need to use GWC, but it shows you how to set the bounds and
resolution for the Map and Layer objects).

-Arne

José Adriano Almeida wrote:

Hello I’m new at Geoserver and Openlayers.

I am working with a Shapefile (EPSG:4326) that when opened on Google
Earth fits like a charm on the correct coordinates.

But when I overlay it on Google Maps using GeoServer it doens’t FIT. 5

  • 6 meters away from the target!

Anyone can tell me how can i Fix it?

OpenLayers Code:

var wms = new OpenLayers.Layer.WMS(
“TOPP States”,
http://localhost:8080/geoserver/wms?”,
{
layers: ‘utad:residencia_lotes_terreno’,
styles: ‘’,
srs: ‘EPSG:4326’,
format: ‘image/png’,
tiled: ‘true’,
tilesOrigin : “143.60260815000004,-43.851764249999995”,
transparent: true
},
{
‘opacity’: 0.75, ‘isBaseLayer’: false,
‘wrapDateLine’: true
}
);

var options = {
// the “community” epsg code for spherical mercator
projection: “EPSG:900913”,
// map horizontal units are meters
units: “m”,
// this resolution displays the globe in one 256x256
pixel tile
maxResolution: 156543.0339,
// these are the bounds of the globe in sperical mercator
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508)
};
// construct a map with the above options
map = new OpenLayers.Map(‘map’, options);

// create Google layer
var gsat = new OpenLayers.Layer.Google(
“Google Sattelite”,
{ ‘sphericalMercator’: true}
);

Thanks in advance…


Descubra uma nova internet. Internet Explorer 8. Mergulhe.
http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8



Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com


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


Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers


Descubra uma nova internet. Internet Explorer 8. Mergulhe.