[Qgis-developer] Mapserver Exporter Bug?
Gary Sherman
sherman at mrcc.com
Sat May 31 02:03:58 EDT 2008
You should be using the latest mapserver exporter that is included in
QGIS, not the plugin from the repository. Most of the problems you
have encountered have been fixed in the latest version. Delete the
$HOME/.qgis/python/plugins/mapserver_export directory and test again.
To avoid further confusion, I have removed the mapserver_exporter
plugin from the respository. I will soon be releasing a standalone
version of the exporter, complete with map preview and other features.
It contains a number of fixes and enhancements over the current version.
-gary
On May 30, 2008, at 8:41 AM, Mauricio de Paulo wrote:
> Ok....
> I think i know how to fix this. Hum... i'd like to hear from the
> mapserver
> exporter manteiner if i have permission to alter his code more.
> Until now i've been changing my file and sending him the
> modifications. I wish
> these fixes were implemented on the version available in the
> repository.
> As soon as I get this permission (or some other way of sending him
> the fixes
> I'll be back to mapserver exporter's bug busting. :D
> Maurício de Paulo
>
>
> On Thursday 29 May 2008 20:06:27 John C. Tull wrote:
>> Mauricio,
>>
>> I get the following error now, but this may be related to some layers
>> with no names because a partial file is being written. Let me play
>> some more...
>>
>> An error has occured while executing Python code:
>>
>> Traceback (most recent call last):
>> File "/Users/jctull/.qgis//python/plugins/mapserver_export/
>> mapserverexport.py", line 94, in run
>> result = exporter.writeMapFile()
>> File "/Users/jctull/.qgis//python/plugins/mapserver_export/
>> ms_export.py", line 101, in writeMapFile
>> self.writeMapLayers()
>> File "/Users/jctull/.qgis//python/plugins/mapserver_export/
>> ms_export.py", line 283, in writeMapLayers
>> self.outFile.write(" NAME '" +
>> lyr.getElementsByTagName("layername")
>> [0].childNodes[0].nodeValue.encode('utf-8').replace("\"", "") +
>> "'\n")
>> IndexError: list index out of range
>>
>> Ok, this is because there were some layers (rasters) that had no
>> name.
>> When I drag and drop rasters, they come in with no name, but I place
>> them in a group folder, so never change them. This led to the above
>> problem.
>>
>> John
>>
>> On May 29, 2008, at 3:38 PM, Mauricio de Paulo wrote:
>>> Please, can you test this mapserverexport update? I've written the
>>> str()
>>> function on every qwidget that might need the type cast. And i did
>>> some other
>>> fix that i don't remember (hum... i think that it was the exporter
>>> wrong
>>> layers' ordering)
>>> Hope it works.
>>> See ya.
>>> Maurício de Paulo
>>>
>>> On Thursday 29 May 2008 17:18:24 John C. Tull wrote:
>>>> I get the same error on OS X, but the suggested change to line 81
>>>> did
>>>> not fix this for me.
>>>>
>>>> John
>>>>
>>>> On May 27, 2008, at 3:42 PM, Mauricio de Paulo wrote:
>>>>> Hi everybody,
>>>>> I was working with mapserver exporter and ran into a problem with
>>>>> the error
>>>>> message at the end of this mail.
>>>>> After a little debug i found out that the code was passing a
>>>>> QString
>>>>> instead
>>>>> of a python string when reading the filename from the dialog. This
>>>>> is a
>>>>> regular source of bug as some classes don't understand QStrings
>>>>> very
>>>>> well,
>>>>> even though they do work a lot like python strings.
>>>>> After the change on mapserverexport.py on line 81:
>>>>> exporter = Qgis2Map(str(self.dlg.ui.txtQgisFilePath.text()),
>>>>> str(self.dlg.ui.txtMapFilePath.text()))
>>>>>
>>>>> I don't know exactly if only my python and pyqt versions require
>>>>> this but it
>>>>> fixed the problem for me. I think it's a good idea to NEVER work
>>>>> with
>>>>> QString, just with python strings for compatibility purposes.
>>>>>
>>>>> versions:
>>>>> Python 2.5.2
>>>>> PyQt4.QtCore.qVersion() '4.3.4'
>>>>> qgis 0.10.0
>>>>> Ubuntu 8.10
>>>>>
>>>>> Thanks for the good work with Mapserver Export Plugin. I've been
>>>>> working with
>>>>> it for 2 years now and it fills a great gap in the mapfile
>>>>> production.
>>>>>
>>>>> Maurício de Paulo
>>>>>
>>>>> An error has occured while executing Python code:
>>>>> Traceback (most recent call last):
>>>>> File "/home/vatto/.qgis//python/plugins/mapserver_export/
>>>>> mapserverexport.py",
>>>>> line 81, in run
>>>>> exporter = Qgis2Map(self.dlg.ui.txtQgisFilePath.text(),
>>>>> self.dlg.ui.txtMapFilePath.text())
>>>>> File "/home/vatto/.qgis//python/plugins/mapserver_export/
>>>>> ms_export.py", line
>>>>> 37, in __init__
>>>>> self.qgs = minidom.parse(projectFile)
>>>>> File "/usr/lib/python2.5/xml/dom/minidom.py", line 1915, in parse
>>>>> return expatbuilder.parse(file)
>>>>> File "/usr/lib/python2.5/xml/dom/expatbuilder.py", line 928, in
>>>>> parse
>>>>> result = builder.parseFile(file)
>>>>> File "/usr/lib/python2.5/xml/dom/expatbuilder.py", line 204, in
>>>>> parseFile
>>>>> buffer = file.read(16*1024)
>>>>> AttributeError: read
>>>>>
>>>>> W
>>>>> _______________________________________________
>>>>> Qgis-developer mailing list
>>>>> Qgis-developer at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>>
>>> <mapserverexport.py>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Gary Sherman
Chair, QGIS Project Steering Committee
-Micro Resources: http://mrcc.com
*Geospatial Hosting
*Web Site Hosting
-Desktop GIS Book:
*http://desktopgisbook.com
"We work virtually everywhere"
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
More information about the Qgis-developer
mailing list