Users Archive

List Statistics

  • Total Threads: 1594
  • Total Posts: 3418
  #1  
31-05-2010 01:28 PM
Users member admin is online now
User
 

Hello,


Appears that my question hasn't appeared in the list yet, so reposting.


Tried different examples but the image is still showing up streched --
http://skip.nonsense.ee/.dev/openlayers/

With JOSM everything is working -- image is displayed in EPSG:3857 and
WMS images get asked in EPSG:4326 as it should...


How to fix?



Regards,
--
Joosep-Georg Jrvemaa
_______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #2  
31-05-2010 02:12 PM
Users member admin is online now
User
 

Thanks Andreas for your answer,

> So I'd configure the map like this:
>
> var options = {
> projection: new OpenLayers.Projection("EPSG:3301"),
> displayProjection: new OpenLayers.Projection("EPSG:4326"),
> units: 'm',
> 'maxExtent': new OpenLayers.Bounds(
> 370753.1145, 6382922.7769, 739245.6000, 6624811.0577
> ),
> 'maxResolution': 'auto'
> };

Now it stopped working at all -- see


I can see that OpenLayers is sending now WMS requests with
SRS=EPSG%3A3301&BBOX=370753.1145,6382922.7769,561216.32772835,6573385.9901283

But it should send them with
SRS=EPSG:4326&bbox=24.6461274,59.3624859,24.6479219,59.3634004

Like:

http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499



Regards,
--
Joosep-Georg
_______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #3  
31-05-2010 02:41 PM
Users member admin is online now
User
 

On May 31, 2010, at 15:12 , Joosep-Georg Jrvemaa wrote:

> Thanks Andreas for your answer,
>
>> So I'd configure the map like this:
>>
>> var options = {
>> projection: new OpenLayers.Projection("EPSG:3301"),
>> displayProjection: new OpenLayers.Projection("EPSG:4326"),
>> units: 'm',
>> 'maxExtent': new OpenLayers.Bounds(
>> 370753.1145, 6382922.7769, 739245.6000, 6624811.0577
>> ),
>> 'maxResolution': 'auto'
>> };
>
> Now it stopped working at all -- see

Looking at your WMS Capabilities again, I see that the 'of10000' layer does not support EPSG:3301. Remove it from the "layers" list, and you should be fine.

Also note that displayProjection will display your coordinates in EPSG:3301, because OpenLayers cannot transform from 3301 to 4326. But all you have to do is to include proj4js (google for it), and add the proj4js definition from the spatialreference.org link I posted in my first reply to your js code.

Regards,
Andreas.

>
>
> I can see that OpenLayers is sending now WMS requests with
> SRS=EPSG%3A3301&BBOX=370753.1145,6382922.7769,561216.32772835,6573385.9901283
>
> But it should send them with
> SRS=EPSG:4326&bbox=24.6461274,59.3624859,24.6479219,59.3634004
>
> Like:
>
> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
>
>
>
> Regards,
> --
> Joosep-Georg
> _______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #4  
01-06-2010 09:58 AM
Users member admin is online now
User
 

Hello,


Thank you Andreas for your time!


> Looking at your WMS Capabilities again, I see that the 'of10000' layer does not support EPSG:3301. Remove it from the "layers" list, and you should be fine.

Do I understand it right that you're saying that the following should not work?

>> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499

But for some reason it has always worked with JOSM and I can not
imagine what should I do when it doesn't one day...



Regards,
--
Joosep-Georg
_______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #5  
01-06-2010 10:59 AM
Users member admin is online now
User
 

On Jun 1, 2010, at 10:58 , Joosep-Georg Jrvemaa wrote:

> Hello,
>
>
> Thank you Andreas for your time!
>
>
>> Looking at your WMS Capabilities again, I see that the 'of10000' layer does not support EPSG:3301. Remove it from the "layers" list, and you should be fine.
>
> Do I understand it right that you're saying that the following should not work?
>
>>> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
>
> But for some reason it has always worked with JOSM and I can not
> imagine what should I do when it doesn't one day...

The request you pasted above is in EPSG:4326. The of10000 layer seems to support EPSG:4326 (despite the capabilities document listing "NONE" as only supported SRS). But the of10000 layer can not be requested in EPSG:3301, which is what OpenLayers does.

You should be able to add support for EPSG:3301 to that layer by changing the mapfile. You probably also have to define the native projection of the aerial image in the mapfile, to get rid of the "NONE" srs. Please ask on the mapserver-users list for more details if you don't know how to do that.

Regards,
Andreas.

>
>
>
> Regards,
> --
> Joosep-Georg
> _______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #6  
01-06-2010 11:11 AM
Users member admin is online now
User
 

>>
>>>> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
>>
> The request you pasted above is in EPSG:4326. The of10000 layer seems to support EPSG:4326 (despite the capabilities document listing "NONE" as only supported SRS). But the of10000 layer can not be requested in EPSG:3301, which is what OpenLayers does.

So you're saying that this JOSM-like behaviour where I have the
display picture in EPSG:3857 and am working with real coordinates is
not possible at all with OpenLayers?


What else options do I have at browser-side to do that then?



Regards,
--
Joosep-Georg
_______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #7  
01-06-2010 11:33 AM
Users member admin is online now
User
 

On Jun 1, 2010, at 12:11 , Joosep-Georg Jrvemaa wrote:

>>>
>>>>> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
>>>
>> The request you pasted above is in EPSG:4326. The of10000 layer seems to support EPSG:4326 (despite the capabilities document listing "NONE" as only supported SRS). But the of10000 layer can not be requested in EPSG:3301, which is what OpenLayers does.
>
> So you're saying that this JOSM-like behaviour where I have the
> display picture in EPSG:3857 and am working with real coordinates is
> not possible at all with OpenLayers?

Exactly. This is why I showed you the other approach - requesting the tiles in the appropriate projection.

> What else options do I have at browser-side to do that then?

None with OpenLayers. In general, reprojecting images on the client needs processing power. Browsers don't have a lot of that.

-Andreas.

>
>
>
> Regards,
> --
> Joosep-Georg
> _______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #8  
01-06-2010 11:51 AM
Users member admin is online now
User
 

>>>>
>> So you're saying that this JOSM-like behaviour where I have the
>> display picture in EPSG:3857 and am working with real coordinates is
>> not possible at all with OpenLayers?
>
> Exactly. This is why I showed you the other approach - requesting the tiles in the appropriate projection.
>
> In general, reprojecting images on the client needs processing power. Browsers don't have a lot of that.

Well, it's just beyond my understanding how can JOSM do that and why
can OpenLayers not -- only thing what has to be done is ask the image
from the WMS server -- and the server already serves the image in
right projection what I want to see.

The link I'm dragging along is not constructed by myself but is a real
working URI grabbed from JOSM debug output --
http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499

And looking at all those Mercator-examples for OpenLayers something
tells me that it must be possible... Google serves images in Mercator,
right? So does the server at maaamet.ee -- you just have to ask for
the image with EPSG:4326 and real coordinates.

How hard can be translating coordinates from one EPSG to another? Some
OpenLayers examples show some coordinates-translation being done... I
just can not understand how can JOSM have that "computing power" and
browser running on very same machine suddenly does not.


My final goal is to start drawing vector data from OSM on that
maaamet.ee WMS layer.

I just would like to accomplish that without starting to write my own
JavaScript library which would do that because I am not familiar with
GIS internals that much...



Regards,
--
Joosep-Georg
_______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #9  
01-06-2010 12:20 PM
Users member admin is online now
User
 

On Jun 1, 2010, at 6:51 AM, ext Joosep-Georg Jrvemaa wrote:

>>>>>
>>> So you're saying that this JOSM-like behaviour where I have the
>>> display picture in EPSG:3857 and am working with real coordinates is
>>> not possible at all with OpenLayers?
>>
>> Exactly. This is why I showed you the other approach - requesting the tiles in the appropriate projection.
>>
>> In general, reprojecting images on the client needs processing power. Browsers don't have a lot of that.
>
> Well, it's just beyond my understanding how can JOSM do that and why
> can OpenLayers not -- only thing what has to be done is ask the image
> from the WMS server -- and the server already serves the image in
> right projection what I want to see.
>
> The link I'm dragging along is not constructed by myself but is a real
> working URI grabbed from JOSM debug output --
> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
>
> And looking at all those Mercator-examples for OpenLayers something
> tells me that it must be possible... Google serves images in Mercator,
> right? So does the server at maaamet.ee -- you just have to ask for
> the image with EPSG:4326 and real coordinates.

These images are not mercator. I'm not sure why you think they are. It's possible that you think this because JOSM will allow you to set the projection to Mercator. When it does this, it *reprojects the source image*, by stretching it. This is something that OpenLayers does not have the ability to do, because you can't (practically) reproject image data in Javascript.

> How hard can be translating coordinates from one EPSG to another? Some
> OpenLayers examples show some coordinates-translation being done... I
> just can not understand how can JOSM have that "computing power" and
> browser running on very same machine suddenly does not.

Coordinates are easy. Images are hard.

> My final goal is to start drawing vector data from OSM on that
> maaamet.ee WMS layer.

In which case, you don't need anything to be in mercator. OSM coordinates are 4326. The WMS is 4326. What is the problem, exactly?

Regards,
--
Christopher Schmidt
Nokia

_______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.

  #10  
01-06-2010 12:27 PM
Users member admin is online now
User
 

On Jun 1, 2010, at 12:51 , Joosep-Georg Jrvemaa wrote:

>>>>>
>>> So you're saying that this JOSM-like behaviour where I have the
>>> display picture in EPSG:3857 and am working with real coordinates is
>>> not possible at all with OpenLayers?
>>
>> Exactly. This is why I showed you the other approach - requesting the tiles in the appropriate projection.
>>
>> In general, reprojecting images on the client needs processing power. Browsers don't have a lot of that.
>
> Well, it's just beyond my understanding how can JOSM do that and why
> can OpenLayers not -- only thing what has to be done is ask the image
> from the WMS server -- and the server already serves the image in
> right projection what I want to see.
>
> The link I'm dragging along is not constructed by myself but is a real
> working URI grabbed from JOSM debug output --
> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
>
> And looking at all those Mercator-examples for OpenLayers something
> tells me that it must be possible... Google serves images in Mercator,
> right? So does the server at maaamet.ee -- you just have to ask for
> the image with EPSG:4326 and real coordinates.

No. Google serves images in Spherical Mercator (EPSG:900913 or EPSG:3857 or whatever EPSG codes there else may exist). maaamet.ee serves images in unprojected WGS84 (EPSG:4326) and EPSG:3301 (a projection suitable for this area).

> How hard can be translating coordinates from one EPSG to another? Some
> OpenLayers examples show some coordinates-translation being done...

It is easy for coordinates. OpenLayers can do it between EPSG:4326 and EPSG:900913, and for other projections you just have to include proj4js. But OpenLayers does not transform map images (which I assume JOSM does).

> I
> just can not understand how can JOSM have that "computing power" and
> browser running on very same machine suddenly does not.

JOSM uses the Java VM to do that. And a Java VM, running compiled code, is much faster than a browser, interpreting JavaScript.

> My final goal is to start drawing vector data from OSM on that
> maaamet.ee WMS layer.

Then you will have to include proj4js on your OpenLayers page and transform existing OpenStreetMap data from Spherical Mercator (EPSG:900913 or EPSG:3857 or whatever) to EPSG:3301, and back before you save it. If you also need this aerial imagery, you will have to use EPSG:4326 instead of EPSG:3301, and live with the strange aspect ratio of the displayed map.

> I just would like to accomplish that without starting to write my own
> JavaScript library which would do that because I am not familiar with
> GIS internals that much...

You can do it with OpenLayers, but you can only do it with projections that your image server supports.

-Andreas.

>
>
>
> Regards,
> --
> Joosep-Georg
> _______________________________________________
___________________________________________________

Posted on the Users mailing list. Go to http://openlayers.org/mailman/listinfo/users to subscribe.





NewsArc Lists  |  Culture Pages   |  Computing Archive  |  Media-Pages
Link to this page on your blog or website by copying the HTML code below and pasting it into your site: