[Qgis-user] QGISWebserver and PostGIS-Layer

Bernhard Ströbl bernhard.stroebl at jena.de
Fri Nov 23 00:11:20 PST 2012


Hi,

do you get a map (and no white image) in QGIS desktop? If yes
1) your server is ok but your request is somehow wrong.
2) Check your access log and look at the GetMap-request that QGIS 
desktop sends. Compare it to your request.

If no there is something misconfigured, e.g. the SRS of the layer does 
not match the SRS of the data, the database is not accessible from the 
server (check pg_hba.conf)....

Bernhard

Am 23.11.2012 08:52, schrieb Albin Blaschka:
> Hi!
>
>
>
> Am 23.11.2012 08:02, schrieb Bernhard Ströbl:
>> Hi Albin,
>>
>> try
>> http://myserver/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/png&CRS=EPSG:4326&WIDTH=500&HEIGHT=500&LAYERS=mypostgislayer&BBOX=12.96,47.79,12.98,47.81
>>
>>
>>
>> as a major change from 1.1.1 to 1.3.0 is the exchange of x and y
>> coordinates or use VERSION=1.3.0 and exchange x and y coordinates of the
>> BBOX
>>
>> if I understand you correctly you get an image as reply but the image is
>> all white. So the server is running ok but there are no data in the
>> place for which you request the map.
>>
>
>
> Yes, you understand correctly - I followed your example, but no success...
>
> Is there a possibility to switch on some kind of logging, additionally
> to the apache logging? In the apache logs, no errors or warnings or
> similar appear...
>
> Thank you for your help!
>
> regards, Albin
>
>
>
>
>>
>> Am 22.11.2012 17:05, schrieb Albin Blaschka:
>>>
>>> Hello!
>>>
>>> Thank you for your answer!
>>>
>>>> the URL seems to lack the BBOX parameter (I think this is a necessary
>>>> parameter in a GetMap request)
>>>> Can you access the maps through QGIS desktop?
>>>> What happens if you send a GetCapabilities request:
>>>> http://myserver/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
>>>>
>>>>
>>>>
>>>
>>> In QGIS Desktop, everything seems ok, the GetCapabilities-Request looks
>>> also ok - here the head of the answer cut 'n copied:
>>>
>>> <WMS_Capabilities version="1.3.0"
>>> xsi:schemaLocation="http://www.opengis.net/wms
>>> http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd"><Service><Name>WMS</Name><Title>QGIS-Server</Title><Abstract/><OnlineResource
>>>
>>>
>>> xlink:type="simple"
>>> xlink:href=""/><ContactInformation><ContactPersonPrimary><ContactPerson>Albin
>>>
>>>
>>> Blaschka</ContactPerson><ContactOrganization>LFZ
>>> Raumberg-Gumpenstein</ContactOrganization></ContactPersonPrimary><ContactVoiceTelephone/><ContactElectronicMailAddress>albin.blaschka at raumberg-gumpenstein.at</ContactElectronicMailAddress></ContactInformation></Service>
>>>
>>>
>>>
>>> ...
>>>
>>> Concerning the BBOX:
>>> I tried it with the following URL (for a small area close to the town of
>>> Salzburg), but again, no success, just a white canvas:
>>>
>>> http://myserver/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&CRS=EPSG:4326&WIDTH=500&HEIGHT=500&LAYERS=mypostgislayer&BBOX=12.96,47.79,12.98,47.81
>>>
>>>
>>>
>>>
>>> Thanks,
>>> Albin
>>>
>>>>
>>>> Bernhard
>>>>
>>>> Am 22.11.2012 16:12, schrieb Albin Blaschka:
>>>>> Hello!
>>>>>
>>>>> I just started to use QGIS Server on an Ubuntu server, after
>>>>> installation and basic configuration, I get a successful answer of a
>>>>> GetCapability-Request.
>>>>>
>>>>> Now, for my first "real" project, I have a question regarding the QGIS
>>>>> Server and PostGIS-Layers: If I enter the following URL in firefox, I
>>>>> just get a blank canvas, no layer:
>>>>>
>>>>> http://myserver/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&CRS=EPSG:4326&WIDTH=500&HEIGHT=500&LAYERS=mypostgislayer
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> What I have done so far:
>>>>>
>>>>> * I have set up a project in QGIS Desktop including a PostGIS-Layer,
>>>>> with the connection storing the full connection string (username and
>>>>> password), the layer is shown as it should be
>>>>>
>>>>> * I saved the QGIS project file and opend it in a text editor and
>>>>> found
>>>>> the credentials for the PostGIS-Layer
>>>>>
>>>>> * I copied the project file into the cgi-bin directory, chmod'ed it
>>>>> even
>>>>> to 777, just to get it going; trying it with the "map="-parameter was
>>>>> also not successfull...
>>>>>
>>>>> * The database server is the same box as the apache (Ubuntu Oneiric
>>>>> 11.10, PostgreSQL 8.3.8, PostGIS Version 1.3; it is an
>>>>> intranet-server,
>>>>> not reachable from outside)
>>>>>
>>>>>
>>>>>
>>>>> What have I done wrong?
>>>>>
>>>>> Thanks in advance,
>>>>> best regards,
>>>>> Albin
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> __________ Information from ESET Mail Security, version of virus
>>>> signature database 7720 (20121122) __________
>>>>
>>>> The message was checked by ESET Mail Security.
>>>> http://www.eset.com
>>>>
>>>>
>>>> _______________________________________________
>>>> Qgis-user mailing list
>>>> Qgis-user at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>
>



__________ Information from ESET Mail Security, version of virus signature database 7722 (20121122) __________

The message was checked by ESET Mail Security.
http://www.eset.com





More information about the Qgis-user mailing list