Community
InfraWorks Forum
Welcome to Autodesk’s InfraWorks Forums. Share your knowledge, ask questions, and explore popular InfraWorks topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

WMS connection in Infraworks

32 REPLIES 32
Reply
Message 1 of 33
gperego
9662 Views, 32 Replies

WMS connection in Infraworks

I can't find any way to connect to WMS services.

 

Is there someone who knows how I can do?

 

Many thanks

Giovanni

Tags (2)
32 REPLIES 32
Message 2 of 33
john.de.leeuw
in reply to: gperego

Hi, depending on what you want to connect, yes this is possible.

 

Check this link from a past post about connecting to WMS through GDAL.

 

Best,

John

Message 3 of 33
gperego
in reply to: john.de.leeuw

Hi John, thanks for your quick answer.

 

But, where is GDAL provider?

 

I want to connect to Tuscany WMS service at address:

http://web.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsofc

 

I looked for in database sources, i found WFS but no WMS or GDAL.

 

Message 4 of 33
john.de.leeuw
in reply to: gperego

Hi Giovanni,

 

You need to make up a GDAL structured XML file. This XML file holds information about your WMS server. I've attached an example file for you to change to your needs, only inserted your URL like you mentioned. Several other information needs still to be added. Look for the quotes within [..]

 

When you have structured your XML file and saved it to some location on your HD, you can then just add this file directly into InfraWorks using Raster Type. Your WMS map should be loaded up and draped over your terrain. Below an example:

 

GDAL WMS.PNG

 

Let me know if this works out for you?

 

Goodluck!

John

Message 5 of 33
gperego
in reply to: john.de.leeuw

Hi John,

 

Many thanks for your needful explanation!

 

I prepared an XML and loaded it with the raster provider.

Unfortunately, after half an hour of elaboration, i had several errors of this kind:

 

659257 [7660]: GDALRasterData.cpp(64): error: GDAL: C:\CorsoInfraWorks2014\DatiSiena\WMS-Ortofoto-Siena\WMS-Toscana-Ortofoto.xml, band 1: IReadBlock failed at X offset 32, Y offset 32
659257 [7660]: GDALRasterData.cpp(64): error: GDAL: GetBlockRef failed at X block offset 32, Y block offset 32
659291 [2764]: GDALRasterData.cpp(64): error: GDAL: GDALWMS: The server returned exception code 'MissingParameterValue': msWMSLoadGetMapParams(): WMS server error. Missing required parameter SRS

 

You can find attached the XML I used.

Thanks again
Best regards
Giovanni

 

 

Message 6 of 33
john.de.leeuw
in reply to: gperego

Giovanni,

 

You might want to check your layer name in the XML (rt_ofc 10k10), because when I connect to your WMS from Map 3D I only see the following layers available:

 

XML error 01.PNG

XML error 02.PNG

 

There is not an "rt_ofc 10k10" layer in there?

 

Also you might lower the SizeX and SizeY values, since they represent the pixels from the raster that you are querying.

 

Regards,

John

 

Message 7 of 33
gperego
in reply to: john.de.leeuw

Hi John, thanks!

I made several tentatives.

I found the name of the layer in the .layer file saved from Map 3D, that, by the way, connects very well to the WMS service.
I tried with layer name OFC 2010 COL that you see in the WMS schema, but I had a clear error in the Log:

"GDALWMS: The server returned exception code 'LayerNotDefined': msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for this request. Check wms/ows_enable_request settings."

Using the name "rt_ofc 10k10" the error for LAYER parameter disappears.

I lowered SizeX and SizeY to 20000

You can find attached the new XML

But, unfortunately I have again the error "Refresh failed for: WMS-Toscana-Ortofoto5.xml"
The log shows:
300140 [10584]: GDALRasterData.cpp(64): error: GDAL: C:\CorsoInfraWorks2014\DatiSiena\WMS-Ortofoto-Siena\WMS-Toscana-Ortofoto5.xml, band 1: IReadBlock failed at X offset 2, Y offset 2
300140 [10584]: GDALRasterData.cpp(64): error: GDAL: GetBlockRef failed at X block offset 2, Y block offset 2
300453 [6172]: GDALRasterData.cpp(64): error: GDAL: GDALWMS: The server returned exception code 'MissingParameterValue': msWMSLoadGetMapParams(): WMS server error. Missing required parameter SRS"

Is there any problem with SRS EPSG:4326?

In Infraworks I am using LL84

Best regards
Giovanni

Message 8 of 33
john.de.leeuw
in reply to: gperego

It seems there is a problem with your WMS url, not sure though how to solve this soon. I did try a couple of things but nothing worked.

 

I've also tried to find some other Italian based WMS servers but couldn't find any who responded. With my own data it works fine so it is possible, that's for sure.

 

Can you try another WMS server you know of?

 

Regards,

John

Message 9 of 33

hello!

i have a similar problem. I have a xml file from my city ( http://www.stuttgart.de/item/show/476067 )

 

If I open the xml file with Infraworks 2014, it always gives me an error. Anyone can help me pls ?

 

Message 10 of 33

i want to add the error message: "there is no valid data source to import"

 

thanks,

Thomas

Message 11 of 33
lapis
in reply to: gperego

Hi,

Before you start trying to use the GDAL WMS driver in InfraWorks, you should try the WMS GetMap service first via an URL in a browser.
The URL is working great by showing the image in the browser or by downloading the image as a file.
If the GetMap function works, you convert the parameters of that URL to the parameters required in the GDAL WMS XML.

Success.
Tags (1)
Message 12 of 33
lapis
in reply to: subpartner-deu

Hi Thomas,

In your URL (http://www.stuttgart.de/item/show/476067) there is a sample of an aerial image included by using a GetMap function.
If you click on that sample URL you will get an image in your browser.
Now use those URL parameters and put those into the required fields of GDAL WMS XML (see http://www.gdal.org/frmt_wms.html for the right GDAL WMS format).

Success
Message 13 of 33
edward.winter
in reply to: gperego

Hi Giovanni,

 

Please use attached GDAL WMS XML file and see if this works for you.

 

Kind regards,

 

Edward Winter

Message 14 of 33

Hi John,

You probably know this by now, but I want this to be clear for anyone else who wants to try this GDAL WMS driver.
To get the right layer name from a WMS server you should use the GetCapabilities function.
In Giovanni's URL example it looks like this:
http://web.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsofc&service=wms&request=getcapab...
The WMS server returns an XML with information like layer names and EPSG codes amongst others which can be used with the GetMap function for retrieving the image from the WMS server.
In the returned XML you see the exact layer name to be used with Giovanni's URL: rt_ofc.10k10
Message 15 of 33
gperego
in reply to: edward.winter

Hi Edward,

 

You are very kind!

Unfortunately, i used your Xml but I had the useful error.

See image and log file attached...

 

I will try again tomorrow, beginning with GetMap in a browser.

 

Many thanks!

Giovanni

 

 

Message 16 of 33
gperego
in reply to: gperego

Finally I saw in the XML received with GetCapabilities that the problem was in Bounding Box.

Using BB of the XML from the server, now it works well!!

 

See attached XML

 

MAny thanks and best regards!

Giovanni

Message 17 of 33
lapis
in reply to: gperego

Hi Giovanni,

Glad that I could help you.
But I have to rectify your latest findings.
Your previous log message had nothing to do with the BB but with the online connection when you wanted to use the GDAL WMS service from InfraWorks. So probably you did not had an internet connection at that time or the web map service could not handle your request at that moment. And it even returned you with a forced shutdown.

Be careful using the BB of the XML of the GetCapabilities, because it is the boundingBox of the whole area of the applied EPSG code.
The BB I have used with my XML uses the exact window for that image only. See attachment.

I've tested my XML with the same 2014 R2 version and it works like charm. But I already knew that it would work... 😉

So please make sure that my supplied XML works for you too.
I wouldn't dare to use your XML, as it surely wants to download the whole area into InfraWorks..

Regards,

Edward
Message 18 of 33
gperego
in reply to: lapis

Hi Edward,

 

You are right, I had two obstacles to overcome to have WMS working in InfraWorks.

 

 - The first, for the internet connection, was the Proxy: fortunately I have also a free wireless.

 - The second was the Bounding Box: I used a different, lighter, model for these tentatives.

   With InfraWorks 2014 I had a generic error, with InfraWorks 360 (2015) I had a more specific error in the log:
   something like "the source is outside the bounding box".
   Modifying the BB, using the whole BB of Tuscany it worked well, because in InfraWorks I set a specific BB for the model.

   So, in a few seconds I had the ground imagery loaded.

 

Now I am working to improve the resolution, increasing SixeX and SizeY.

A first tentative, with 10000 worked in a couple of minutes.

 

Regards!
Giovanni

 

 

 

 

 

 

Message 19 of 33
lapis
in reply to: gperego

Hi Giovanni,

Glad you have sorted out the issues.
And you're right about the BB by using the model extents to keep the model as small as possible. That's an approach I forgot to use with the GDAL WMS driver. So thank you too for the reminder. 🙂
But I'm curious why you get log information about data being outside the BB. Did you set up an other EPSG code projection coordinate system for your model than the one delivered in the GDAL WMS XML file?
I'm also curious what your resolution of the image is: does my XML has a better resolution than yours using the model extents?

Looking forward to your answers.

Regards,

Edward
Message 20 of 33

John,

 

I read through this post and followed instructions as best as I could, however, I am still getting a "failed to import" upon bringing the .XML file into InfraWorks.  Naturally I am missing something important.  I have attached my .XML file and here is a link to Connecticut's image server; https://cteco.uconn.edu/ctraster/rest/services/images/Ortho_2016/ImageServer. 

 

Is this something you could help me with?

 

Thanks for your time.

Chris H

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report