[mapguide-users] RE: MapGuide Open 1.0.1 and WMS problems

Andy Morsell amorsell at spatialgis.com
Fri Aug 11 18:00:54 EDT 2006


Thanks again Thomas.  You might consider your responses verbose, but I truly
appreciate the very detailed explanations.  Now, how do we get you back on
to the MapGuide team? ;-) 


Andy 

-----Original Message-----
From: Thomas M. Tuerke [mailto:thomas.m.tuerke at autodesk.com] 
Sent: Friday, August 11, 2006 2:44 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] RE: MapGuide Open 1.0.1 and WMS problems

Ahah... thanks for reminding me....

(I should point out that I've actually transitioned off of MapGuide onto
another team and project, so some of these details are receding into the
mists; any over-abundance of information on these answers is really just
meant to capture information for posterity... ;-)

Yes, there are two pieces of information in Site Admin's WMS/WFS config that
are not purely cosmetic: the server name and script name.

If you sunk Antonio's file into your installation, it's conceivable that
your install might have directed GetMap requests to Antonio's server (which
probably would have complained, unless both were serving the same maps.)
That said, it shouldn't have disabled any existing functionality on your
installation.

A bit of back story here, and apologies for the round-about way of coming to
an explanation.  OGC specs allow a separate URL for each WMS operation, so
(theoretically) you could set up a WMS that would have the GetCapabilities
handler at one URL, the GetMap handler at another URL, and the
GetFeatureInfo handler at another URL still.  These could be separate bits
of code on the same machine, or maybe on separate machines altogether.

We figured that 99% of MapGuide users would probably have MapAgent on a
single machine handle all requests for any given user, so that's the way
SiteAdmin is set up: specify your server, and we put that + the stock URL
into all three documented URL locations.

But that needn't be the case.  That other hypothetical 1% of installations
could modify their *.config.awd to suit, say, a web farm environment where
one machine might dole out Capy docs, but other machines do the actual
GetMap requests.  Here's how.  Look at your *.config.awd file, and a few
dozen lines in you should see the following.  Site Admin modifies these
definitions:

 <!-- The URL elements.  Change to suit, as this is reported -->  <Define
item="SERVER_NAME">localhost:8008</Define>
 <Define item="SCRIPT_NAME">/mapguide/mapagent/mapagent.fcgi</Define>

They are, in turn, used to create these definitions:

 <!-- Stock definitions -->
 <Define item="URl.OnlineResource">http://&SERVER_NAME;/</Define>
 <Define
item="Url.GetCapabilities">http://&SERVER_NAME;&SCRIPT_NAME;</Define>
 <Define item="Url.GetMap">http://&SERVER_NAME;&SCRIPT_NAME;</Define>
 <Define
item="Url.GetFeatureInfo">http://&SERVER_NAME;&SCRIPT_NAME;</Define>

But, if you want to send GetMap requests to another location, you could do
this:

<Define item="Url.GetMap">http://my-server-farm.com&SCRIPT_NAME;</Define>

In this case, GetMap requests would then be directed to another server:

  http://my-server-farm.com/mapguide/mapagent/mapagent.fcgi

Naturally, that's predicated on a properly-written WMS client that pays
attention to this info in GetCapabilities; I've seen some that don't, they
just fire the GetMap request to the same base URL they used for
GetCapabilities.

As an aside, if you make a GetMap request of your web-tier -- regardless of
whether your CapyDoc says GetMap requests are handled elsewhere -- MapAgent
will still honor the request.  That's sort of a fluke, where GetMap has such
a loose requirement on the templates; the other requests, GetCapabilities
and GetFeatureInfo, can literally be configured away.

If you browse into your #.#.#.xml.awd files, you'll notice that all the
GetCapabilities templates rely on the &Url.Whatever; definitions, allowing
central administration from these few definitions.

Anyway, if you consider that SERVER_NAME was probably still pointing to
Antonio's server, you get a sense of what was happening.

So, to sum up: Yes, SERVER_NAME and SCRIPT_NAME are important in
"documenting" your site.  The well-written client will (should) honor what's
described in your GetCapabilities document, but it's possible to "insist" on
the GetCapabilities URL still serving GetMap requests, regardless of what
GetCapabilities returns.  I'll leave it to others to decide if it's a
feature (to help the poorly-written clients,) a bug, or "security" (?)
loophole.

- Thomas

-----Original Message-----
From: Andy Morsell [mailto:amorsell at spatialgis.com]
Sent: Friday, August 11, 2006 12:36 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] RE: MapGuide Open 1.0.1 and WMS problems

Thanks for the detailed information, Thomas.  That helps in understanding
what is going on.  What I was saying about the server name deserves some
clarification: If I change the server name to something completely bogus in
the Configure WMS section of Admin, restart the web server and ensure that
the server name has stuck, a GetMap request still works.  So, it's looking
like that parameter really is not for configuring the way WMS works on the
server and is informational only?  Does anything on the WMS and WFS
configure screens actually effect the way the services work?


Andy 

-----Original Message-----
From: Thomas M. Tuerke [mailto:thomas.m.tuerke at autodesk.com]
Sent: Friday, August 11, 2006 12:06 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] RE: MapGuide Open 1.0.1 and WMS problems

Hi Andy,

The *.awd files are cached since -- under normal circumstances -- they're
static and they live in a centralized location on the server but are used on
the web extension tier (handled by an arbitrary number of boxes in a farm
environment.)  We felt that minimizing the chit-chat between the two tiers
would help performance... at the cost of some expiry issues, which are
usually resolved by a (webserver) restart after changing the server's copy
of these *.awd files.

While the *.awd files are static, the products they're responsible for
returning -- GetCapabilities, GetFeatureInfo, and in general text-based
responses -- are in fact "live."  Even so, much of this textual response is
boilerplate, and that boilerplate lives in the AWD files.  Just iterate over
the list of published layers or what have you to fill in the blanks, and
voila: one Capabilities Document.

Naturally, GetMap isn't a textual response, doesn't have a high degree of
boiler-plate, and generally doesn't have much similarity between responses,
so it's not worth caching.  (It also doesn't rely on much of the *.awd
files, so as you noticed, Antonio's service information didn't interfere
with your requests... it's just "false advertisement" to whatever humans
should happen to read the GetCapabilities response. ;-)

Changing the service properties in Site Administrator should only require
one restart of the web servers (Apache or IIS -- not the MapGuide server)
since that's where the stuff is cached.  If, after using Site Administrator,
you see that the *.config.awd file (that is, the actual bits on the server
hard disk) hasn't changed then suspect a file writing issue: being marked
read-only, or otherwise not having permissions to write to the file.  (Linux
may be all the more insistent, with a chmod or change of ownership likely.)

Hope that helps.  If you do discover the differences, I'd be interested in
knowing, too.  Thanks!

- Thomas

-----Original Message-----
From: Andy Morsell [mailto:amorsell at spatialgis.com]
Sent: Friday, August 11, 2006 11:40 AM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] RE: MapGuide Open 1.0.1 and WMS problems

Antonio sent me his OgcWmsService.config.awd file, I stopped my services,
copied the file in, restarted services and everything worked.  I have
absolutely no idea why and I will take the time to compare his .awd file
with mine later.  Could the file have been corrupt on my end from the
beginning after the install?  

One thing I noticed is that this file also stores the WMS server information
(which is also displayed via a WMS GetCapabillities request), but WMS GetMap
requests to my server were still working even with Antonio's server
information.  I changed this information several times in Admin (restarting
services in between each time), but it seems to not matter to the actual WMS
service and is purely informational. 

I'm happy now since my live demo of this stuff works again after a 2 week
hiatus: http://mapguide.spatialgis.com/mapguide/GoogleMapsDemo/


Andy

-----Original Message-----
From: Antonio de la Peña [mailto:antonio_dlp at dsgmexico.com.mx]
Sent: Thursday, August 10, 2006 6:05 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] RE: MapGuide Open 1.0.1 and WMS problems


I can't confirm that because I don't have the Sheboygan package installed
right now but I'll attach my awd file. You still have to set up the proper
server address either by hand or using the map administrator so it points to
your WMS server IP or name. Hope it works.


Andy Morsell wrote:
> 
> But, it sounds like it working for Antonio after removing the comment 
> and not having any additional WKT entries.  Antonio, can you confirm 
> that this works for you (replace the server with yours)?:
> 
> http://mapguide.spatialgis.com/mapguide/mapagent/mapagent.fcgi?request
> =GetMa
> p&service=WMS&layers=Samples/Sheboygan/Layers/Hydrography&srs=EPSG:432
> 6&bbox
> =-87.74,43.68,-87.69,43.815&width=500&height=500&format=image/png
> 
> Thanks.
> 
> Andy
> 
> -----Original Message-----
> From: Thomas M. Tuerke [mailto:thomas.m.tuerke at autodesk.com]
> Sent: Monday, August 07, 2006 3:22 PM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] MapGuide Open 1.0.1 and WMS problems
> 
> Hi Andy,
> 
> No, once you've restarted the IIS or Apache server, the in-memory 
> cache should be cleared.  (I think FastCGI clears the module -- and 
> thus the cache
> -- every several hundred requests or so, too.)
> 
> If the WKT isn't coming from the *.config.awd file, then it must be 
> coming from the underlying CS system; if that's generating a parser 
> error, then Houston, we have a problem (... which SRS.WKT.map was 
> meant to address in the first place ;-})
> 
> With this stray comment syntax error identified (thanks, Antonio!) how 
> about trying to reinstate one of last week's EPSG:4326 mappings to 
> WKT, to see if that's more digestible.  Either way, an OSGEO artifact 
> may be in order.
> 
> Thanks,
> 
> - Thomas
> 
> -----Original Message-----
> From: Andy Morsell [mailto:amorsell at spatialgis.com]
> Sent: Monday, August 07, 2006 3:11 PM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] MapGuide Open 1.0.1 and WMS problems
> 
> There is no entry for that WKT.  I am using the out-of-the-box 
> OgcWmsService.config.awd file with the exception of removing the 
> errant comment string.  I did try to add an entry last week per your 
> recommendations, but have reverted to the original file and have 
> restarted services, etc. Does that information get stored in another 
> configuration location that needs to be edited now?
> 
> 
> Andy
> 
> -----Original Message-----
> From: Thomas M. Tuerke [mailto:thomas.m.tuerke at autodesk.com]
> Sent: Monday, August 07, 2006 2:56 PM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] MapGuide Open 1.0.1 and WMS problems
> 
> If that WKT is coming from SRS.WKT.map, try removing it from the map 
> and seeing what happens.
> 
> -----Original Message-----
> From: Andy Morsell [mailto:amorsell at spatialgis.com]
> Sent: Monday, August 07, 2006 2:52 PM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] MapGuide Open 1.0.1 and WMS problems
> 
> Hi Antonio,
> I checked my file and see the same error (I'm kicking myself, I was 
> looking in this location just last week and didn't notice the error).
> However, after fixing it and then trying to generate the test WMS map 
> from the Sheboygan hydrography layer, I now get this error:
> 
> <ServiceExceptionReport version="1.1.1">  <ServiceException 
> code="InvalidCRS">
>   The coordinate system is invalid. PROJCS["WGS 84",GEOGCS["WGS 
> 84",DATUM["WGS_1984",SPHEROID["WGS
> 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","
> 6326"]
> ],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745
> 329251 994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]"
> Could not parse the OGC WKT.<details>The coordinate system is invalid.
> PROJCS["WGS 84",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS
> 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","
> 6326"]
> ],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745
> 329251 994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]"
> Could not parse the OGC WKT.
> Exception occurred in method MgCoordinateSystem.MgCoordinateSystem at 
> line
> 76 in file
> c:\build_tux_area\mgdev_opensource\common\service\coordinatesystem\Coo
> rdinat
> eSystem.cpp
> </details>
>  </ServiceException>
> </ServiceExceptionReport>
> 
> 
> Andy
> 
> -----Original Message-----
> From: Antonio de la Peña [mailto:antonio_dlp at dsgmexico.com.mx]
> Sent: Monday, August 07, 2006 2:15 PM
> To: users at mapguide.osgeo.org
> Subject: Re: [mapguide-users] MapGuide Open 1.0.1 and WMS problems
> 
> 
> Apparently the OgcWmsService.config.awd has a typo in the line 236 (or 
> near
> it) where it says:
> 
>   <!-- This example fixes a problem with EPSG:21781 not         -->
>        finding the WKT for EPSG:21781 in the CS library. 
>        -->
> 
> As you can see there's an orphan commentary closing tag so I corrected 
> it like this:
> 
>   <!-- This example fixes a problem with EPSG:21781 not         
>        finding the WKT for EPSG:21781 in the CS library. -->
> 
> Then I restarted the server both MapGuide service and IIS and now the 
> "coordinate system conversion failed." error is gone.
> 
> I added the artifact MG348 addressing this issue.
> --
> View this message in context:
> http://www.nabble.com/MapGuide-Open-1.0.1-and-WMS-problems-tf2025055.h
> tml#a5
> 696004
> Sent from the OSGeo MapGuide forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 

--
View this message in context:
http://www.nabble.com/MapGuide-Open-1.0.1-and-WMS-problems-tf2025055.html#a5
755358
Sent from the OSGeo MapGuide forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org








More information about the Mapguide-users mailing list