Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with OGCServer #7

Closed
Witchmaster opened this issue Dec 20, 2010 · 15 comments
Closed

Problems with OGCServer #7

Witchmaster opened this issue Dec 20, 2010 · 15 comments

Comments

@Witchmaster
Copy link

Hello,

i hope this is the correct place for my problem.

I used the OGCServer as a CGI Script (your wms.py) and i think the paths are set correctly.
But when i want to run the Server i have several Problems.

  • When I start a GetMap Request in version 1.1.1, i get a blank Map.
    The Requestparameter that i used will work without problems with the UMN Mapserver. So i think the BBox and the projection are correctly set.
    My XML File from that i read will also be found form the OGCServer and shows Map with nik2img.py.

What do i wrong to show a map in the Browser.

  • When I start a GetMap Request in Version 1.3.0 i get an internal ServerError. And the Apache Log shows the following:

Traceback (most recent call last):
File "/usr/lib/cgi-bin/wms.py", line 29, in <module>
fcgi.Server({fcgi.FCGI_RESPONDER: OGCServerHandler}).run()
File "/usr/local/lib/python2.6/dist-packages/jon/fcgi.py", line 514, in run
self.handler_types[FCGI_RESPONDER]).process()
File "/usr/local/lib/python2.6/dist-packages/jon/cgi.py", line 476, in process
handler.traceback(self)
File "/usr/local/lib/python2.6/dist-packages/ogcserver/cgiserver.py", line 87, in traceback
eh = ExceptionHandler130(self.debug)
TypeError: __init__() takes at least 3 arguments (2 given)

  • When I start the wms.py from console i get nearly the same error with a diffrent Version:

Traceback (most recent call last):
File "/usr/lib/cgi-bin/wms.py", line 29, in <module>
fcgi.Server({fcgi.FCGI_RESPONDER: OGCServerHandler}).run()
File "/usr/local/lib/python2.6/dist-packages/jon/fcgi.py", line 514, in run
self.handler_types[FCGI_RESPONDER]).process()
File "/usr/local/lib/python2.6/dist-packages/jon/cgi.py", line 476, in process
handler.traceback(self)
File "/usr/local/lib/python2.6/dist-packages/ogcserver/cgiserver.py", line 87, in traceback
eh = ExceptionHandler111(self.debug)
TypeError: __init__() takes at least 3 arguments (2 given)

Could you help me to solve these Problems?

(Sorry for my bad English)

@manelclos
Copy link
Member

Hi,

Which ogcserver version are you using?
What is the URL you are requesting?

@manelclos
Copy link
Member

I've updated cgiserver.py and common.py. Can you please try again?

@Witchmaster
Copy link
Author

I will try it today at home and tell you my result

@Witchmaster
Copy link
Author

Hi,

After I updated the files mentioned the problem with V1.3.0 is gone.
But know from the Console i get this Error:

Content-Type: text/html
Content-Length: 393

Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/jon/cgi.py", line 474, in process handler.process(self) File "/usr/local/lib/python2.6/dist-packages/ogcserver/cgiserver.py", line 50, in process server_port = req.environ['SERVER_PORT'] File "/usr/lib/python2.6/UserDict.py", line 22, in **getitem** raise KeyError(key) KeyError: 'SERVER_PORT'

and my Browser get's a white Image.

What am i doing wrong that i get only a blank Map.

@manelclos
Copy link
Member

wms.py is a cgi script and it is meant to be run from a web server. When running from the command line some variables (i.e. SERVER_PORT) are not defined. Are you running from the command line because you want a test server?

@Witchmaster
Copy link
Author

Something I've already thought of.

I've tried the script only on the command line to check whether the previous
Error still occurs.

Actually, I call the script on the above links.
But I still get a blank map.
This surprises me because nik2img.py creates a correct map with the same XML file.

@manelclos
Copy link
Member

Try the above links with EXCEPTIONS=application/vnd.ogc.se_xml to see if you get more info. Also, check with -e option in nik2img that the coordinates are ok.

If you still get the blank image, can you upload the xml and some data you are using?

@Witchmaster
Copy link
Author

Okay i have changed the EXCEPTIONS Parameter but i get still a blank map.
Then i have checked the Extent with nik2img (used the coordinates from link). But the Map wich nik2img created is fine.
http://www6.pic-upload.de/21.12.10/sydp8zxucjp2.png

So here is my XML file.
Fyi: I have a Postgis DB where OSM Entries from Saxony-Anhalt/Germany are deposited.

Because i don't know how i can upload Files directly to this location, i have used a free hoster. (Sorry)

http://www.file-upload.net/download-3066889/MAP.xml.html

@manelclos
Copy link
Member

The mapfile.xml:

<!DOCTYPE Map>
<Map background-color="#ffffff" minimum_version="0.7.2">
  <Style name="Seen_Style">
    <Rule>
      <PolygonSymbolizer fill="rgb(151,193,190)"/>
      <LineSymbolizer stroke-linejoin="round" stroke="rgb(108,141,193)" stroke-width="1" stroke-linecap="round" stroke-opacity="1"/>
    </Rule>
  </Style>
  <Style name="Fluesse2_Style">
    <Rule>
      <PolygonSymbolizer fill="rgb(151,193,190)"/>
      <LineSymbolizer stroke-linejoin="round" stroke="rgb(151,193,190)" stroke-width="1" stroke-linecap="round" stroke-opacity="1"/>
    </Rule>
  </Style>
  <Style name="Fluesse_Style">
    <Rule>
      <LineSymbolizer stroke-linejoin="round" stroke="rgb(151,193,190)" stroke-width="1" stroke-linecap="round" stroke-opacity="1"/>
    </Rule>
  </Style>
  <Style name="Kreise_Style">
    <Rule>
      <LineSymbolizer stroke-linejoin="round" stroke-opacity="1" stroke="rgb(161, 196, 151)" stroke-linecap="round" stroke-dasharray="5,3,2,3" stroke-width="1"/>
    </Rule>
  </Style>
  <Style name="Grenzen_Style">
    <Rule>
      <LineSymbolizer stroke-linejoin="round" stroke="rgb(161, 196, 151)" stroke-width="2" stroke-linecap="round" stroke-opacity="1"/>
    </Rule>
  </Style>
  <Layer name="Seen" status="on">
    <StyleName>Seen_Style</StyleName>
    <Datasource>
      <Parameter name="table">
        (SELECT osm_id, way FROM planet_polygon WHERE "natural" = 'water') AS line
        </Parameter>
      <Parameter name="type">postgis</Parameter>
      <Parameter name="password">password</Parameter>
      <Parameter name="host">localhost</Parameter>
      <Parameter name="port">5432</Parameter>
      <Parameter name="user">user</Parameter>
      <Parameter name="dbname">dbname</Parameter>
      <Parameter name="estimate_extent">true</Parameter>
    </Datasource>
  </Layer>
  <Layer name="Fluesse" status="on">
    <StyleName>Fluesse_Style</StyleName>
    <Datasource>
      <Parameter name="table">
        (SELECT osm_id, way FROM planet_roads WHERE "waterway" = 'stream' OR "waterway" = 'river') AS line
        </Parameter>
      <Parameter name="type">postgis</Parameter>
      <Parameter name="password">password</Parameter>
      <Parameter name="host">localhost</Parameter>
      <Parameter name="port">5432</Parameter>
      <Parameter name="user">user</Parameter>
      <Parameter name="dbname">dbname</Parameter>
      <Parameter name="estimate_extent">true</Parameter>
    </Datasource>
  </Layer>
  <Layer name="Fluesse" status="on">
    <StyleName>Fluesse2_Style</StyleName>
    <Datasource>
      <Parameter name="table">
        (SELECT osm_id, way FROM planet_polygon WHERE "waterway" = 'riverbank') AS line
        </Parameter>
      <Parameter name="type">postgis</Parameter>
      <Parameter name="password">password</Parameter>
      <Parameter name="host">localhost</Parameter>
      <Parameter name="port">5432</Parameter>
      <Parameter name="user">user</Parameter>
      <Parameter name="dbname">dbname</Parameter>
      <Parameter name="estimate_extent">true</Parameter>
    </Datasource>
  </Layer>
  <Layer name="Kreise" status="on">
    <StyleName>Kreise_Style</StyleName>
    <Datasource>
      <Parameter name="table">
        (SELECT osm_id, way FROM planet_roads WHERE "boundary" = 'administrative' AND "admin_level" = '6') AS line
        </Parameter>
      <Parameter name="type">postgis</Parameter>
      <Parameter name="password">password</Parameter>
      <Parameter name="host">localhost</Parameter>
      <Parameter name="port">5432</Parameter>
      <Parameter name="user">user</Parameter>
      <Parameter name="dbname">dbname</Parameter>
      <Parameter name="estimate_extent">true</Parameter>
    </Datasource>
  </Layer>
  <Layer name="Grenzen" status="on">
    <StyleName>Grenzen_Style</StyleName>
    <Datasource>
      <Parameter name="table">
        (SELECT osm_id, way FROM planet_roads WHERE "boundary" = 'administrative' AND "admin_level" = '4') AS line
        </Parameter>
      <Parameter name="type">postgis</Parameter>
      <Parameter name="password">password</Parameter>
      <Parameter name="host">localhost</Parameter>
      <Parameter name="port">5432</Parameter>
      <Parameter name="user">user</Parameter>
      <Parameter name="dbname">dbname</Parameter>
      <Parameter name="estimate_extent">true</Parameter>
    </Datasource>
  </Layer>
</Map>

@Witchmaster
Copy link
Author

Now i have changed the Layers "Fluesse" to "Fluesse1" and "Fluesse2" and started both requests you mentioned above. But i get still a blank white map.

I'm helpless.

@manelclos
Copy link
Member

You need to add the SRS to your OSM layers:
<Layer .... srs="+init=epsg:900913">

Check with nik2img -v which "Long/lat extent of all layers" are you getting.

Paste your GetCapabilities if you still have problems:
http://server-address/cgi-bin/wms.py?request=GetCapabilities&service=WMS&Version=1.3.0

@Witchmaster
Copy link
Author

Wow now it runs without any problems.
The problem was the missing projection in the XML file.
Thank you very much for your help.
You makes a very good job.Keep it up.

Yours sincerely,
Witch

@manelclos
Copy link
Member

Thanks to you for reporting the initial bug ;)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants