PDA

View Full Version : MapServer and World Wind


gazzanic
09-30-2004, 08:28 AM
Has anyone else got UMN MapServer (http://mapserver.gis.umn.edu/) showing in World Wind?

His is a screen shot (http://www.mapserver.co.nz/images/wawonworldwind.jpg) with my server.

Adding the WMS service to wms_server_list.xml was easy, the tricky part was that MapServer returns images with an equal scale in both directions but World Wind is asking for images with unequal scales.

If there is any interest in how I got around this I'll post the answer here.

Cheers

Gazza

PS Thanks for a great ap Chris. :)

TomServo
09-30-2004, 01:02 PM
I am sure people will want to know anyway, post it. :)

gazzanic
09-30-2004, 02:14 PM
Originally posted by TomServo@Oct 1 2004, 01:02 AM
I am sure people will want to know anyway, post it. :)
Quoted post


Will do. I just need to find a couple of hours to tidy the script up.

Rich Signell
01-10-2005, 05:11 PM
Originally posted by gazzanic@Sep 30 2004, 09:14 AM
Will do. I just need to find a couple of hours to tidy the script up.
Quoted post

Gazza,
Have you found those hours yet? ;)

I've got some MapServer data I'd like to view in WW, and it would be great not to have to reinvent the wheel!

-Rich

nhv
01-10-2005, 09:34 PM
Originally posted by Rich Signell@Jan 10 2005, 01:11 PM
Gazza,
Have you found those hours yet? ;)

I've got some MapServer data I'd like to view in WW, and it would be great not to have to reinvent the wheel!

-Rich
Quoted post


You mean something similar to this ?
EastCoastBathy (http://www.vso.cape.com/~nhv/files/tmp/ww.jpg)

I would post the URL to the server
but it couldn't handle the traffic :-)

just add your layer to the
Configuration\WorldXmlDescriptors\EarthL ayers\Images.xml
once you have a WMS running :-)

HTH

<QuadTileSet ShowAtStartup="false">
<Name>@@YOUR LAYER NAME HERE@@</Name>
<DistanceAboveSurface>0</DistanceAboveSurface>
<LevelZeroTileSizeDegrees>4.0</LevelZeroTileSizeDegrees>
<BoundingBox>
<North>
<Value>90.0</Value>
</North>
<South>
<Value>-90.0</Value>
</South>
<West>
<Value>-180.0</Value>
</West>
<East>
<Value>180.0</Value>
</East>
</BoundingBox>
<TextureSizePixels>512</TextureSizePixels>
<TerrainMapped>true</TerrainMapped>
<NumberLevels>4</NumberLevels>
<DownloadableWMSSet>
<ServerGetMapUrl>@@YOUR SERVER WMS ADDRESS HERE@@</ServerGetMapUrl>
<Version>1.1.1</Version>
<ImageFormat>image/jpeg</ImageFormat>
<WMSLayerName>@@@YOURLAYER@@@</WMSLayerName>
<WMSLayerStyle></WMSLayerStyle>
<UseTransparency>false</UseTransparency>
<ServerLogoFilePath>Data\Icons\31.png</ServerLogoFilePath>
</DownloadableWMSSet>
</QuadTileSet>

nhv
01-11-2005, 03:48 PM
Originally posted by nhv@Jan 10 2005, 05:34 PM
You mean something similar to this ?
EastCoastBathy (http://www.vso.cape.com/~nhv/files/tmp/ww.jpg)

I would post the URL to the server
but it couldn't handle the traffic :-)

just add your layer to the
Configuration\WorldXmlDescriptors\EarthL ayers\Images.xml
once you have a WMS running :-)

HTH

<QuadTileSet ShowAtStartup="false">
<Name>@@YOUR LAYER NAME HERE@@</Name>
<DistanceAboveSurface>0</DistanceAboveSurface>
<LevelZeroTileSizeDegrees>4.0</LevelZeroTileSizeDegrees>
<BoundingBox>
<North>
<Value>90.0</Value>
</North>
<South>
<Value>-90.0</Value>
</South>
<West>
<Value>-180.0</Value>
</West>
<East>
<Value>180.0</Value>
</East>
</BoundingBox>
<TextureSizePixels>512</TextureSizePixels>
<TerrainMapped>true</TerrainMapped>
<NumberLevels>4</NumberLevels>
<DownloadableWMSSet>
<ServerGetMapUrl>@@YOUR SERVER WMS ADDRESS HERE@@</ServerGetMapUrl>
<Version>1.1.1</Version>
<ImageFormat>image/jpeg</ImageFormat>
<WMSLayerName>@@@YOURLAYER@@@</WMSLayerName>
<WMSLayerStyle></WMSLayerStyle>
<UseTransparency>false</UseTransparency>
<ServerLogoFilePath>Data\Icons\31.png</ServerLogoFilePath>
</DownloadableWMSSet>
</QuadTileSet>
Quoted post


To further clarify the above wants to go in the "ChildLayerSet" section of your configuration file i.e.

<ChildLayerSet Name="High-Resolution Terrain Mapped Imagery" ShowOnlyOneLayer="true" ShowAtStartup="true">

@@@ YOUR NEW DATA SET TAGS GO HERE @@@

</ChildLayerSet>

Rich Signell
01-11-2005, 04:33 PM
Originally posted by nhv@Jan 11 2005, 11:48 AM
To further clarify the above wants to go in the "ChildLayerSet" section of your configuration file i.e.

<ChildLayerSet Name="High-Resolution Terrain Mapped Imagery" ShowOnlyOneLayer="true" ShowAtStartup="true">

@@@ YOUR NEW DATA SET TAGS GO HERE @@@

</ChildLayerSet>
Quoted post



I just wanted to say that this works great! I was able to add your XML snippet (http://tinyurl.com/6nr5c) to Images.xml and see my own WMS served data layer. Took 5 minutes! Thanks Norm!

-Rich

Rich Signell
01-11-2005, 07:28 PM
Originally posted by Rich Signell@Jan 11 2005, 12:33 PM
I just wanted to say that this works great! I was able to add your XML snippet (http://tinyurl.com/6nr5c) to Images.xml and see my own WMS served data layer. Took 5 minutes! Thanks Norm!

-Rich
Quoted post


I think I should modify my statement to say that "it worked", but there are still some issues. For some reason WW is not recognizing my lat/lon limits or the transparency, and hence my WMS layer is creating a huge white region outside of the data region that is taking over the world. Does something additional need to be specified in the xml?

http://cove.whoi.edu/~rsignell/gom_sediment.png

Rich Signell
01-11-2005, 07:34 PM
Originally posted by gazzanic@Sep 30 2004, 03:28 AM
His is a screen shot (http://www.mapserver.co.nz/images/wawonworldwind.jpg) with my server.

Adding the WMS service to wms_server_list.xml was easy, the tricky part was that MapServer returns images with an equal scale in both directions but World Wind is asking for images with unequal scales.

Quoted post



After implementing NHV's method (http://tinyurl.com/6nr5c) of displaying my WMS imagery via modifying the Images.xml file to point directly to the layer I wanted to show, I realized that it would be a lot simpler to modify the wms_server.xml list to point to my server. But I guess I rediscovered gazzanic's problem. Even though the layer agrees with the coastline when displayed using the NHV method, when I use the wms_server.xml method, I get a big mismatch in the WMS coverage (see image below). Gazzanic or anybody, can you help?
http://cove.whoi.edu/~rsignell/gom_sediment_shift.png

evergreener2
01-12-2005, 04:41 PM
In your mapserver mapfile try setting STATUS OFF on all the layers you don't want to see, like the states layer.

gazzanic
01-17-2005, 08:40 PM
Originally posted by Rich Signell@Jan 12 2005, 08:34 AM
After implementing NHV's method (http://tinyurl.com/6nr5c) of displaying my WMS imagery via modifying the Images.xml file to point directly to the layer I wanted to show, I realized that it would be a lot simpler to modify the wms_server.xml list to point to my server. But I guess I rediscovered gazzanic's problem. Even though the layer agrees with the coastline when displayed using the NHV method, when I use the wms_server.xml method, I get a big mismatch in the WMS coverage (see image below). Gazzanic or anybody, can you help?


What I ended up doing was to stop using MapServer's built in WMS capability and create a php mapscript that does the following:

1. From the supplied bounding box, width and height calculate a new width so that the scale is the same in both directions.

2. Use Mapscript to create the image to disk.

3. Using PHP, read the image back in and modify the width so that it honours the orginal width that WorldWind asked for.

4. Return that stretched image.

I'll post a link to that script later today however I've got a feeling that a change has been made in the latest versions of MapServer so that it stretches the image to honour the input parameters. Don't quote me on that though.

Gazza

Rich Signell
01-17-2005, 10:14 PM
Gazza,

Thanks for the reply. It's odd that if the problem is with MapServer, that if instead of adding the WMS server to the wms_server_list.xml file, you add a specific layer from that WMS server in the images.xml file, you don't have the problem. Is this because WW is then asking for images with equal scales? It's also odd that if this is a problem with MapServer, that ESRI's mapserver has the same problem (at least the version we are running).

Just to be on the safe side, I've basically posted the same question to the support discussion group. Hopefully we'll see if there is a more graceful way to handle this!

-Rich

gazzanic
01-18-2005, 05:09 AM
If anyone is interested here is the php Mapscript (http://www.mapserver.co.nz/worldwind.txt) that I used to connect Worldwind to Mapserver.

The settings in Worldwind config files are similar to what is shown above.

Gary

Guest
01-18-2005, 05:53 PM
Originally posted by Rich Signell@Jan 17 2005, 02:14 PM
Gazza,

Thanks for the reply. It's odd that if the problem is with MapServer, that if instead of adding the WMS server to the wms_server_list.xml file, you add a specific layer from that WMS server in the images.xml file, you don't have the problem. Is this because WW is then asking for images with equal scales? It's also odd that if this is a problem with MapServer, that ESRI's mapserver has the same problem (at least the version we are running).

Just to be on the safe side, I've basically posted the same question to the support discussion group. Hopefully we'll see if there is a more graceful way to handle this!

-Rich
Quoted post


Are you by any chance running the latest version of MapServer? Could the WMS enhancements in the newer version fix this problem?

smult
01-28-2005, 10:06 AM
I've tried to connect WW to a known WMS-server, but it seems not to show up on the globe

When I try zooming in on a certain area I know there are images (these are satellite and ortho imagery) WW tries to download (red squares starting to appear) but no image is displayed.

Any chance of getting to know the exact url WW tries to contact? I have a basic aspx-url for a WMS-service, but don't know anything about the parameters needed and if I'm providing the right stuff.

The <WMSLayerName> should be a known layer for the WMS-service? Not just my own "custom layername"?

Do I need to provide any <WMSLayerStyle>-info?

And what about <DistanceAboveSurface>0</DistanceAboveSurface>
<LevelZeroTileSizeDegrees>1.0</LevelZeroTileSizeDegrees>

What is the DistanceAboveSurface doing?

The LevelZeroTileSizeDegrees I guess is a level for where (altitude) the downloading starts?

hmm.. doesn't seem to get this thing to work though....

smult
02-01-2005, 03:00 PM
Hmm.. anyone got it working adding an external dataset? (WMS)

I tried my WMS-source (norwegian orthoimages) with http://demo.ionicsoft.com/geoviewer/ which has an autodetect layer thing, and it shows up just fine, but not in WW when adding the right layername...

Any settings I have to include in images.xml to get a WMS-service to show up on the globe?

Seems to start downloading data (red squares) but nothing happens..

Tried using the WMS-service linked from statkart.no publicly available from this article (in norwegian) : http://www.statkart.no/IPS/?module=Article...licShow;ID=4215 (http://www.statkart.no/IPS/?module=Articles;action=Article.publicSh ow;ID=4215) and the service itself is http://www.norgeibilder.no/services/wms/wms.aspx

There are three layers: "Satellittbilde", "RUTENETT_UTM32" and "Ortofoto Backdrops". The "Satellittbilde"-layer shows fine in the geoviewer from ionicsoft mentioned abov.

Guess there might be a problem with spaces in the layername? Like "Ortofoto Backdrops"? How do I "encode" this in the images.xml-file?

t.

Mashiharu
02-01-2005, 09:04 PM
Originally posted by smult@Feb 1 2005, 04:00 PM
Hmm.. anyone got it working adding an external dataset? (WMS)

I tried my WMS-source (norwegian orthoimages) with http://demo.ionicsoft.com/geoviewer/ which has an autodetect layer thing, and it shows up just fine, but not in WW when adding the right layername...

Any settings I have to include in images.xml to get a WMS-service to show up on the globe?

Quoted post


I think your problem is most likely related to projection. World Wind currently only supports EPSG:4326 (Geographic Longitude-Latitude). And it looks like your map server only supports other projections (WGS 84 / UTM).

Until World Wind learns how to reproject imagery I think you will have to reproject outside of WW, for instance by installing a mapserver between WW and your data source.

I'm sorry I don't have a better answer.

Helge
02-12-2005, 10:52 PM
The norgeibidler wms server supports the layers SatelliteImage and Backdrops.
In this version, unfortunately, it supports only WGS 84 UTM zones 31-35 and the local Norwegian datum/coordsystem NGO.
In the next version, we'll probably support 4326 coordinates.
Since the site was meant to be used mainly by Norwegian systems, that wasn't a priority at the time version 1 was designed.

Helge

smult
07-13-2005, 02:17 PM
Any news on support for other projections?

smult