[Geoserver-users] [Geotools-gt2-users] FW: Virtual Earth Transformation Question

Switching this thread to geoserver-users, as it's not a gt question.

And because someone else is likely going to have to help out, as I won't
be online much longer.

But did you change the SRS in the admin console, like in the featureType
page? Or did you just change it in the request string? Because if you
just do the latter than you also need to adjust the bbox. If you do the
former it should work, but there may be something in the pipeline that's
not quite right.

Chris

On Tue, August 21, 2007 12:26 pm, Brad Cooper wrote:

I've played a little more (downloaded 1.5.3 nightly
build). I don't get the error any longer but I don't see an image. I tried
the demo examples from the GeoServer admin console (changing the SRS
parameter).

http://localhost:8080/geoserver/wms?bbox=588215.0934998066,4912904.566716
96,610781.6060742784,4929115.20400145&styles=&Format=application/openlaye
rs&request=GetMap&layers=sf:streams&width=800&height=539&srs=EPSG:900913

But it still doesn't return anything.

--- Chris Holmes <cholmes@anonymised.com> wrote:

1.5.3 should return something, and it should
recognize 900913. It may get the error he got if 900913 isn't defined in
the data directory, like if he's using an older data directory.

On Tue, August 21, 2007 12:10 pm, Randy George
wrote:

Brad's message didn't cop to this list. I assume

this is the bug you

mentioned being fixed in the svn.

-----Original Message-----
From: Brad Cooper [mailto:coobr01@anonymised.com]
Sent: Tuesday, August 21, 2007 9:26 AM
To: Randy George
Subject: RE: [Geotools-gt2-users] Virtual Earth

Transformation Question

Correct, I used the %4.png

Unfortunately I get this error message from my

new

1.5.3 Geoserver install.

<ServiceException code="InvalidSRS">No authority

was

defined for code &quot;900913&quot;. Did you

forget

&quot;AUTHORITY:NUMBER&quot;?</ServiceException>
--- Randy George <rkgeorge@anonymised.com> wrote:

When I directly put SRS=EPSG:900913 in a URL to a
valid WMS request, it alway's comes back with a

blank png image. I'll look

at it again later.

Hi Coop,

Hmm... I would have thought the opposite - zoom

in

bad fit, zoom out good fit. I will be curious to

know if EPSG:900913

solves the issue.

I see that now the veapi.js doesn't have to be
modified (the blog was from 2006). Did you work

out how to fool the

tileSourceSpec to point to a Java servlet?

tileSourceSpec.TileSource =

http://someserver:someport/somewebapp/tiles/%4.png";

Randy

-----Original Message-----
From: Brad Cooper [mailto:coobr01@anonymised.com]
Sent: Tuesday, August 21, 2007 8:38 AM
To: Randy George;
Geotools-gt2-users@lists.sourceforge.net
Subject: Re: [Geotools-gt2-users] Virtual Earth
Transformation Question

Thanks for the reply Randy,
That's exactly what I'm experiencing "does not

work

well at high zoom values". I've attached two

screenshots from a local VE

.html page. The tiles
are getting dynamically generated from a local

GeoServer instance and

streamed back to the client using a servlet. As

you can see from the

screenshot, the overlay is perfect (we'll looks

perfect to the eye) when

zoomed in, but is off when zoomed out (gets worse

the more I zoom out).

Thanks for the tips, I'll try them out and let

you

know.

--- Randy George <rkgeorge@anonymised.com> wrote:

Hi Coop,

I'm interested in this as well and am planning

to

get to it sometime. Rob Blackwell's blog

mentioned that he used

EPSG:4326

"Virtual Earth uses a WGS84 Mercator projection,

but

WMS servers need you to
specify the projection. In this case we've

specified

a Coordinate Reference System (CRS) of EPSG:4326

which is a common

geographic projection that is equivalent to

WGS84." I suspect this does

not work well at high zoom values. I gather as

well that the veapi.js

needs to be modified.

Chris Holmes mentions this in his GeoServer

1.5.3

announcement:

http://blog.geoserver.org/2007/08/14/geoserver-embraces-the-geoweb/

"With a bit of coding from Andrea we're also now
shipping with support for the map projection

used by Virtual Earth and

Google

Maps, thanks to SharpGIS
and Chris Schmidt. So now if you use 900913 as

the

EPSG code for your WMS
requests our output will be perfectly overlaid

on those maps."

900913 is a custom EPSG created specific to

Google

and VE. You can download the latest version of

GeoServer1.5.3 and look

at

the

configuration\release\user_projections\epsg.properties

900913=PROJCS["WGS84 / Simple Mercator",

GEOGCS["WGS

84", DATUM["WGS_1984",
SPHEROID["WGS_1984", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH]],
PROJECTION["Mercator_1SP_Google"],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 0.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0], UNIT["m",

1.0],

AXIS["x", EAST], AXIS["y",
NORTH], AUTHORITY["EPSG","900913"]]

You can use the GeoTools projection code by

adding

this to the EPSG database. Or you could more

simply add your own

Java

projection code using the parameters above.

http://mathworld.wolfram.com/MercatorProjection.html

Let us know if you succeed in getting the VE WMS
overlay working

Thanks
Randy

-----Original Message-----
From:
geotools-gt2-users-bounces@lists.sourceforge.net

=== message truncated ===

_________________________________________________________________________
___________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

!DSPAM:4005,46cb125e145421439371379!

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

Thanks Chris, yes-I only changed the SRS in the URL
and I updated the bbox to be something large enough
that I thought would display the information.

--- Chris Holmes <cholmes@anonymised.com> wrote:

Switching this thread to geoserver-users, as it's
not a gt question.

And because someone else is likely going to have to
help out, as I won't
be online much longer.

But did you change the SRS in the admin console,
like in the featureType
page? Or did you just change it in the request
string? Because if you
just do the latter than you also need to adjust the
bbox. If you do the
former it should work, but there may be something in
the pipeline that's
not quite right.

Chris

On Tue, August 21, 2007 12:26 pm, Brad Cooper wrote:
> I've played a little more (downloaded 1.5.3
nightly
> build). I don't get the error any longer but I
don't see an image. I tried
> the demo examples from the GeoServer admin console
(changing the SRS
> parameter).
>
>

http://localhost:8080/geoserver/wms?bbox=588215.0934998066,4912904.566716

>

96,610781.6060742784,4929115.20400145&styles=&Format=application/openlaye

>

rs&request=GetMap&layers=sf:streams&width=800&height=539&srs=EPSG:900913

>
>
> But it still doesn't return anything.
>
>
>
>
>
> --- Chris Holmes <cholmes@anonymised.com> wrote:
>
>
>> 1.5.3 should return something, and it should
>> recognize 900913. It may get the error he got if
900913 isn't defined in
>> the data directory, like if he's using an older
data directory.
>>
>>
>> On Tue, August 21, 2007 12:10 pm, Randy George
>> wrote:
>>
>>> Brad's message didn't cop to this list. I assume
>>>
>> this is the bug you
>>> mentioned being fixed in the svn.
>>>
>>>
>>> -----Original Message-----
>>> From: Brad Cooper [mailto:coobr01@anonymised.com]
>>> Sent: Tuesday, August 21, 2007 9:26 AM
>>> To: Randy George
>>> Subject: RE: [Geotools-gt2-users] Virtual Earth
>>>
>> Transformation Question
>>
>>>
>>>
>>> Correct, I used the %4.png
>>>
>>>
>>>
>>> Unfortunately I get this error message from my
>>>
>> new
>>> 1.5.3 Geoserver install.
>>>
>>>
>>>
>>> <ServiceException code="InvalidSRS">No authority
>>>
>> was
>>> defined for code &quot;900913&quot;. Did you
>> forget
>>> &quot;AUTHORITY:NUMBER&quot;?</ServiceException>
>>> --- Randy George <rkgeorge@anonymised.com> wrote:
>>>
>>>
>>>
>>> When I directly put SRS=EPSG:900913 in a URL to
a
>>> valid WMS request, it alway's comes back with a
>> blank png image. I'll look
>>> at it again later.
>>>
>>>
>>>
>>>> Hi Coop,
>>>>
>>>>
>>>>
>>>> Hmm... I would have thought the opposite - zoom
>>>>
>> in
>>>> bad fit, zoom out good fit. I will be curious
to
>> know if EPSG:900913
>>>> solves the issue.
>>>>
>>>> I see that now the veapi.js doesn't have to be
>>>> modified (the blog was from 2006). Did you work
>> out how to fool the
>>>> tileSourceSpec to point to a Java servlet?
>> tileSourceSpec.TileSource =
>>>>
>>
http://someserver:someport/somewebapp/tiles/%4.png";
>>
>>>>
>>>>
>>>> Randy
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Brad Cooper [mailto:coobr01@anonymised.com]
>>>> Sent: Tuesday, August 21, 2007 8:38 AM
>>>> To: Randy George;
>>>> Geotools-gt2-users@lists.sourceforge.net
>>>> Subject: Re: [Geotools-gt2-users] Virtual Earth
>>>> Transformation Question
>>>>
>>>>
>>>>
>>>> Thanks for the reply Randy,
>>>> That's exactly what I'm experiencing "does not
>>>>
>> work
>>>> well at high zoom values". I've attached two
>> screenshots from a local VE
>>>> .html page. The tiles
>>>> are getting dynamically generated from a local
>> GeoServer instance and
>>
>>>> streamed back to the client using a servlet. As
>> you can see from the
>>>> screenshot, the overlay is perfect (we'll looks
>> perfect to the eye) when
>>>> zoomed in, but is off when zoomed out (gets
worse
>> the more I zoom out).
>>>>
>>>> Thanks for the tips, I'll try them out and let
>>>>
>> you
>>>> know.
>>>>
>>>>
>>>>
>>>> --- Randy George <rkgeorge@anonymised.com> wrote:
>>>>
>>>>
>>>>
>>>>> Hi Coop,
>>>>>
>>>>>
>>>>>
>>>>> I'm interested in this as well and am planning
>>>>>
>> to
>>>>> get to it sometime. Rob Blackwell's blog
>> mentioned that he used
>>>>> EPSG:4326
>>>>>
>>>>>
>>>>>
>>>>> "Virtual Earth uses a WGS84 Mercator
projection,
>>>>>
>>>>>
>>>> but
>>>>> WMS servers need you to
>>>>> specify the projection. In this case we've
>>>> specified
>>>>> a Coordinate Reference System (CRS) of
EPSG:4326
>> which is a common
>>>>> geographic projection that is equivalent to
>> WGS84." I suspect this does
>>
>>>>> not work well at high zoom values. I gather as
>> well that the veapi.js
>>>>> needs to be modified.
>>>>>
>>>>> Chris Holmes mentions this in his GeoServer
>>>>>

=== message truncated ===

____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/

Brad Cooper ha scritto:

Thanks Chris, yes-I only changed the SRS in the URL
and I updated the bbox to be something large enough
that I thought would display the information.

Just tried with the actual 900913 bbox and I get the map all right.
Here is the request:

http://localhost:8080/geoserver/wms?bbox=-11563633,5523243,-11535246,5543493&styles=&Format=application/openlayers&request=GetMap&layers=sf:streams&width=800&height=539&srs=EPSG:900913

Now, to get the bbox in 900913 I had to write a little program
that does the envelope reprojection, and run it among the GeoServer
sources so that it picks up our "extra" Google projection class.
Here it is, just for completeness sake:

import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.referencing.CRS;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

public class GoogleEnvelopeTest {
     public static void main(String args) throws Exception {
         CoordinateReferenceSystem wgs = CRS.decode("EPSG:4326", true);
         System.out.println(wgs);
         CoordinateReferenceSystem google = CRS.decode("EPSG:900913");
         System.out.println(google);
         ReferencedEnvelope lle = new ReferencedEnvelope(-103.87789019829768, -103.62287788915457, 44.372335260095554, 44.502218486214815, wgs);
         ReferencedEnvelope ge = lle.transform(google, true);
         System.out.println(lle);
         System.out.println(ge);
     }
}

Hope this helps. Hum, in fact it would be nice to have some
geodetic calculator among the GeoServer demos allowing the
end user to perform point and envelop reprojection, compute
geodetic distances and the like... scheduling an issue for
GeoServer 1.7, we need the new interface framework before
we can tackle this one (unless anyone wants to do it now
with Struts, I certainly would not be against it :slight_smile: ).
Cheers
Andrea

Thanks Andrea,
It makes since but I do I get GeoTools to recognize
the EPSG:900913 projection? I've never tried to add a
new project to GeoTools (only to Geoserver).

Thanks!

--- Andrea Aime <aaime@anonymised.com> wrote:

Brad Cooper ha scritto:
> Thanks Chris, yes-I only changed the SRS in the
URL
> and I updated the bbox to be something large
enough
> that I thought would display the information.

Just tried with the actual 900913 bbox and I get the
map all right.
Here is the request:

http://localhost:8080/geoserver/wms?bbox=-11563633,5523243,-11535246,5543493&styles=&Format=application/openlayers&request=GetMap&layers=sf:streams&width=800&height=539&srs=EPSG:900913

Now, to get the bbox in 900913 I had to write a
little program
that does the envelope reprojection, and run it
among the GeoServer
sources so that it picks up our "extra" Google
projection class.
Here it is, just for completeness sake:

import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.referencing.CRS;
import

org.opengis.referencing.crs.CoordinateReferenceSystem;

public class GoogleEnvelopeTest {
     public static void main(String args) throws
Exception {
         CoordinateReferenceSystem wgs =
CRS.decode("EPSG:4326", true);
         System.out.println(wgs);
         CoordinateReferenceSystem google =
CRS.decode("EPSG:900913");
         System.out.println(google);
         ReferencedEnvelope lle = new
ReferencedEnvelope(-103.87789019829768,
-103.62287788915457,
44.372335260095554, 44.502218486214815, wgs);
         ReferencedEnvelope ge =
lle.transform(google, true);
         System.out.println(lle);
         System.out.println(ge);
     }
}

Hope this helps. Hum, in fact it would be nice to
have some
geodetic calculator among the GeoServer demos
allowing the
end user to perform point and envelop reprojection,
compute
geodetic distances and the like... scheduling an
issue for
GeoServer 1.7, we need the new interface framework
before
we can tackle this one (unless anyone wants to do it
now
with Struts, I certainly would not be against it :slight_smile:
).
Cheers
Andrea

____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/collections/222

Brad Cooper ha scritto:

Thanks Andrea,
It makes since but I do I get GeoTools to recognize
the EPSG:900913 projection? I've never tried to add a
new project to GeoTools (only to Geoserver).

The Google projection is a new class,
with custom code to accomodate for the custom way Google
interprets the Mercator projection.
This class has been created in GeoServer, and still has
to be backported into GeoTools.

Can I ask what are you trying to achieve?
Cheers
Andrea

Basically I’d like to create a java based proxy
Servlet that would 1) convert Virtual Earth/Google Map
tile requests to bounding box coordinates, 2)
transform
those coordinates to the appropriate ESPG 900913
reference system, 3) send the appropriate request
based on the
transformed coordinates to a GeoServer WMS, 4) Stream
the WMS results back to the VE map control.

--- Andrea Aime <aaime@anonymised.com> wrote:

Brad Cooper ha scritto:
> Thanks Andrea,
> It makes since but I do I get GeoTools to
recognize
> the EPSG:900913 projection? I've never tried to
add a
> new project to GeoTools (only to Geoserver).

The Google projection is a new class,
with custom code to accomodate for the custom way
Google
interprets the Mercator projection.
This class has been created in GeoServer, and still
has
to be backported into GeoTools.

Can I ask what are you trying to achieve?
Cheers
Andrea

____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/

Brad Cooper ha scritto:

Basically I’d like to create a java based proxy
Servlet that would 1) convert Virtual Earth/Google Map
tile requests to bounding box coordinates, 2)
transform
those coordinates to the appropriate ESPG 900913
reference system, 3) send the appropriate request
based on the
transformed coordinates to a GeoServer WMS, 4) Stream
the WMS results back to the VE map control.

Just wondering, we already have a javascript based solution
that does this work on the client side, turning a tile
request into a WMS request, created especially for Google
Maps. You can find it in this file:
https://svn.codehaus.org/geoserver/trunk/geoserver/web/src/main/webapp/gmaps/wms-gs.js

If you can't work in javascript, I guess all you need to
do is to translate this code into java when creating the proxy.
Would that be an acceptable solution?

Cheers
Andrea

Thanks Andrea, since I have to support VE I'll need to
do this on the middle tier (convert VE QUAD Tile
Requests to Bounding Boxes and then transform to
900913). I'll take a look at the javascript.

--- Andrea Aime <aaime@anonymised.com> wrote:

Brad Cooper ha scritto:
> Basically I’d like to create a java based proxy
> Servlet that would 1) convert Virtual Earth/Google
Map
> tile requests to bounding box coordinates, 2)
> transform
> those coordinates to the appropriate ESPG 900913
> reference system, 3) send the appropriate request
> based on the
> transformed coordinates to a GeoServer WMS, 4)
Stream
> the WMS results back to the VE map control.

Just wondering, we already have a javascript based
solution
that does this work on the client side, turning a
tile
request into a WMS request, created especially for
Google
Maps. You can find it in this file:

https://svn.codehaus.org/geoserver/trunk/geoserver/web/src/main/webapp/gmaps/wms-gs.js

If you can't work in javascript, I guess all you
need to
do is to translate this code into java when creating
the proxy.
Would that be an acceptable solution?

Cheers
Andrea

      ____________________________________________________________________________________
Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7

I was wondering if Brad or anyone else has had success displaying Geoserver WMS on Virtual Earth directly (without using OpenLayers). Did the 900913 projection overlay correctly?

I’ve got a custom proxy servlet that translates between VE quad code and WGS 84 WMS and caches the result, but a) I run into the same overlay problems as Brad and b) I’d rather have one integrated WFS/WMS/VE tile cache solution. Can I do this under Geoserver now or soon-ish?

Thanks, Trevor

Brad Cooper wrote:
Thanks Andrea, since I have to support VE I’ll need to do this on the middle tier (convert VE QUAD Tile Requests to Bounding Boxes and then transform to 900913). I’ll take a look at the javascript.


View this message in context: Re: [Geotools-gt2-users] FW: Virtual Earth Transformation Question
Sent from the GeoServer - User mailing list archive at Nabble.com.