[Qgis-developer] Problems using QgsGeometryAnalyzer.simplify() on Mac OS?

William Kyngesburye woklist at kyngchaos.com
Thu Jan 24 07:21:55 PST 2013


On Jan 23, 2013, at 11:37 PM, Chris B wrote:

> Hmm possibly. 
> 
> I went back into the GUI/console and tried ogr as the importer, and it did
> appear to work:
> 
>>>> vlayer =
>>>> QgsVectorLayer("/Users/cbarnes/wkt2/kml/ny-08.kml","ny08","ogr")
>>>> vlayer.isValid()
> True
>>>> QgsGeometryAnalyzer().simplify(vlayer,"test_ny",0.005,False)
> True
> 
> Sure enough, I got a simplified layer that I could open through the GUI.  
> 
> Looking at what I saw on the web, my guess is I need to correct one of these
> two items:
> 
> 1. Ensure the correct prefix path:  I was under the impression it was
> supposed to be 
> 
> QgsApplication.setPrefixPath("/Applications/Qgis.app/Contents/MacOS/QGIS",True)
> 
> but if this is what sets up the plugin folder, it might be incorrect because
> in my install that folder is actually located at:
> 
> /Applications/QGIS.app/Contents/PlugIns
> 
I think /Applications/Qgis.app/Contents/MacOS is the right path (note: remove "QGIS" from what you have).  For OS X the prefix path is where the "QGIS" executable is.


> 2. Do I need LD_LIBRARY_PATH?
> 
> I think your current assumption is correct - if you know that either one of
> these are the problem I can probably get this working.  Thanks again for
> your help!


This is probably working fine - if you can import the qgis python modules, then it's working.  Loading QGIS providers and plugins will not give import errors if QGIS can't find them, you just get layer format errors later.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy




More information about the Qgis-developer mailing list