Re: [Qgis-user] Announcing ProfileFromLine plugin
Olá Ricardo, thanks for the nice tool. I'm under ubuntu 10.04, using ubuntugis repositories and python-shapely installed. When I launch the plugin I always get The shapely python package uses the GEOS library. \Your current version of GEOS doesn't support the feature needed by Shapely. \Please install a more recent version of GEOS (version 3.2 or later). but as a fact I have GEOS 3.2.2 installed... thanks in advance -- Giovanni -- On Fri, 2010-08-13 at 21:53 +0100, Ricardo Filipe Soares Garcia da wrote: Hello list I have uploaded a new python plugin called ProfileFromLine. This plugin will generate points along lines according to a user specified interval and will optionally sample loaded raster(s) at each new point's location. Each new point will keep all the attributes of its originating line, plus any raster values that it had been asked to sample. In addition, every point will have a distinct attribute and also an attribute that stores the distance along its line since the beginning (the line's starting point being according to the original digitizing direction). the new points layer is created using the 'memory' provider, and the user must manually save it to disk. this seemed like a nice option, because you can choose your desired format upon saving. The plugin depends on the shapely python package, so you must have it installed and accessible on your system. This shouldn't be much of a problem on linux and windows (it is available on the osgeo4w packages as well). since I don't have a Mac I wouldn't know how easy it is to get shapely installed, but I trust it to be just as easy ;) I hope that it is useful. Please drop me a message through this mailing list if you have any suggestions. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
Olá Giovanni I am also on Ubuntu 10.04 (actually kubuntu, but it should be the same). I am guessing you probably have the shapely lib installed from the repositories. I thought I had the same, but I just checked and the version of shapely that is in the repos is 1.0.14-1. I must have installed shapely using easy_install and later forgot about it. I am sorry for this confusion. So, to solve the issue, please install shapely using easy_install. It will give you the current version, which is 1.2 and that will (most likely) solve your problem. If you don't have easy_install yet, just open up Synaptic and look for the python-setuptools package After that, you can run: sudo easy_install shapely On Tue, Aug 17, 2010 at 12:34 PM, Giovanni Manghi giovanni.man...@gmail.com wrote: Olá Ricardo, thanks for the nice tool. I'm under ubuntu 10.04, using ubuntugis repositories and python-shapely installed. When I launch the plugin I always get The shapely python package uses the GEOS library. \Your current version of GEOS doesn't support the feature needed by Shapely. \Please install a more recent version of GEOS (version 3.2 or later). but as a fact I have GEOS 3.2.2 installed... thanks in advance -- Giovanni -- On Fri, 2010-08-13 at 21:53 +0100, Ricardo Filipe Soares Garcia da wrote: Hello list I have uploaded a new python plugin called ProfileFromLine. This plugin will generate points along lines according to a user specified interval and will optionally sample loaded raster(s) at each new point's location. Each new point will keep all the attributes of its originating line, plus any raster values that it had been asked to sample. In addition, every point will have a distinct attribute and also an attribute that stores the distance along its line since the beginning (the line's starting point being according to the original digitizing direction). the new points layer is created using the 'memory' provider, and the user must manually save it to disk. this seemed like a nice option, because you can choose your desired format upon saving. The plugin depends on the shapely python package, so you must have it installed and accessible on your system. This shouldn't be much of a problem on linux and windows (it is available on the osgeo4w packages as well). since I don't have a Mac I wouldn't know how easy it is to get shapely installed, but I trust it to be just as easy ;) I hope that it is useful. Please drop me a message through this mailing list if you have any suggestions. -- ___ ___ __ Ricardo Garcia Silva ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
Dnia wtorek 17 sierpnia 2010 o 13:56:47 Ricardo Filipe Soares Garcia da napisał(a): I am guessing you probably have the shapely lib installed from the repositories. I thought I had the same, but I just checked and the version of shapely that is in the repos is 1.0.14-1. I must have installed shapely using easy_install and later forgot about it. I am sorry for this confusion. It will be perfect if you add a Shapely warning message in case geosCAPIVersion[0]0 ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
Hi all I must say that as an ordinary qGIS user - using version 1.5. under windows Vista - I am totally lost how to get the thing properly installed and working. I'll be greatful for some simple advice. Stefaan --- On Tue, 17/8/10, Borys Jurgiel borysia...@gmail.com wrote: From: Borys Jurgiel borysia...@gmail.com Subject: Re: [Qgis-user] Announcing ProfileFromLine plugin To: qgis-user@lists.osgeo.org Date: Tuesday, 17 August, 2010, 14:19 #yiv669835499 p, #yiv669835499 li {white-space:pre-wrap;} Dnia wtorek 17 sierpnia 2010 o 13:56:47 Ricardo Filipe Soares Garcia da napisał(a): I am guessing you probably have the shapely lib installed from the repositories. I thought I had the same, but I just checked and the version of shapely that is in the repos is 1.0.14-1. I must have installed shapely using easy_install and later forgot about it. I am sorry for this confusion. It will be perfect if you add a Shapely warning message in case geosCAPIVersion[0]0 -Inline Attachment Follows- ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
Dnia wtorek 17 sierpnia 2010 o 14:28:26 Giovanni Manghi napisał(a): second advice: use the osgeo4w installer, it is different from what you may already know, but after a few tries it makes perfectly sense... as you have everything in may need in the same installer. I'm not a windows user, but I'm afraid osgeo4w doesn't help in this particular case, as it's written here: http://lists.osgeo.org/pipermail/qgis-user/2010-August/009351.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
Hi Giovanni and Borys - both many thanks for your advise - so far I have been generating topographic transects using the SPRING (I use it mainly for DTM and for working with Satelite images) - it would have been great if I could do it easily and straight in qGIS, which I use mainly with vector data - but OK for the time being I'll continue using SPRING for that matter Cheers Stefaan _ Stefaan Dondeyne (PhD) GSM +32 476 61 90 65 (Belgium) Mobile +258 82 89 295 64 (Mozambique) Tel + 32 16 32 97 34 (Department Earth and Environmental Sciences - KU Leuven)_ http://www.panoramio.com/user/3497468?with_photo_id=25100300 http://www.mozambiqueflora.com/index.php http://micaia.org/centre/micaia_family.html http://ees.kuleuven.be/ --- On Tue, 17/8/10, Borys Jurgiel borysia...@aster.pl wrote: From: Borys Jurgiel borysia...@aster.pl Subject: Re: [Qgis-user] Announcing ProfileFromLine plugin To: giovanni.man...@gmail.com Cc: stefaan dondeyne stefaan_donde...@yahoo.co.uk, qgis-user@lists.osgeo.org Date: Tuesday, 17 August, 2010, 14:38 #yiv1509396459 p, #yiv1509396459 li {white-space:pre-wrap;} Dnia wtorek 17 sierpnia 2010 o 14:28:26 Giovanni Manghi napisał(a): second advice: use the osgeo4w installer, it is different from what you may already know, but after a few tries it makes perfectly sense... as you have everything in may need in the same installer. I'm not a windows user, but I'm afraid osgeo4w doesn't help in this particular case, as it's written here: http://lists.osgeo.org/pipermail/qgis-user/2010-August/009351.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
if the problem is installing the right version of shapely then easy install is available also for windows http://pypi.python.org/pypi/setuptools#windows On Tue, 2010-08-17 at 12:44 +, stefaan dondeyne wrote: Hi Giovanni and Borys - both many thanks for your advise - so far I have been generating topographic transects using the SPRING (I use it mainly for DTM and for working with Satelite images) - it would have been great if I could do it easily and straight in qGIS, which I use mainly with vector data - but OK for the time being I'll continue using SPRING for that matter Cheers Stefaan _ Stefaan Dondeyne (PhD) GSM +32 476 61 90 65 (Belgium) Mobile +258 82 89 295 64 (Mozambique) Tel + 32 16 32 97 34 (Department Earth and Environmental Sciences - KU Leuven)_ http://www.panoramio.com/user/3497468?with_photo_id=25100300 http://www.mozambiqueflora.com/index.php http://micaia.org/centre/micaia_family.html http://ees.kuleuven.be/ --- On Tue, 17/8/10, Borys Jurgiel borysia...@aster.pl wrote: From: Borys Jurgiel borysia...@aster.pl Subject: Re: [Qgis-user] Announcing ProfileFromLine plugin To: giovanni.man...@gmail.com Cc: stefaan dondeyne stefaan_donde...@yahoo.co.uk, qgis-user@lists.osgeo.org Date: Tuesday, 17 August, 2010, 14:38 Dnia wtorek 17 sierpnia 2010 o 14:28:26 Giovanni Manghi napisał(a): second advice: use the osgeo4w installer, it is different from what you may already know, but after a few tries it makes perfectly sense... as you have everything in may need in the same installer. I'm not a windows user, but I'm afraid osgeo4w doesn't help in this particular case, as it's written here: http://lists.osgeo.org/pipermail/qgis-user/2010-August/009351.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
Hello all I have uploaded a new version of this plugin. It will display a more meaningful error message when the user doesn't have the minimum version of Shapely or GEOS necessary to run it. I also added a fix for the problem reported by Paolo: ...BTW, if I run the Profile romLine without selecting a line (I know this is wrong), I get an error: Errore durante l'esecuzione di codice Python: Traceback (most recent call last): File /home/paolo/.qgis/python/plugins/ProfileFromLine/ProfileFromLineDialog.py, line 44, in accept params[interval], self.ui.progressBar) File /home/paolo/.qgis/python/plugins/ProfileFromLine/ProfileFromLine.py, line 106, in create_profile_layer AttributeError: 'NoneType' object has no attribute 'dataProvider' This should be trapped, and a more meaningful error should be displayed to the user Now the plugin will only be active (selectable from the toolbar or the plugins menu) if there is already a lines layer loaded in the map canvas. Thank you for testing it out On Tue, Aug 17, 2010 at 1:48 PM, Giovanni Manghi giovanni.man...@gmail.com wrote: if the problem is installing the right version of shapely then easy install is available also for windows http://pypi.python.org/pypi/setuptools#windows On Tue, 2010-08-17 at 12:44 +, stefaan dondeyne wrote: Hi Giovanni and Borys - both many thanks for your advise - so far I have been generating topographic transects using the SPRING (I use it mainly for DTM and for working with Satelite images) - it would have been great if I could do it easily and straight in qGIS, which I use mainly with vector data - but OK for the time being I'll continue using SPRING for that matter Cheers Stefaan _ Stefaan Dondeyne (PhD) GSM +32 476 61 90 65 (Belgium) Mobile +258 82 89 295 64 (Mozambique) Tel + 32 16 32 97 34 (Department Earth and Environmental Sciences - KU Leuven)_ http://www.panoramio.com/user/3497468?with_photo_id=25100300 http://www.mozambiqueflora.com/index.php http://micaia.org/centre/micaia_family.html http://ees.kuleuven.be/ --- On Tue, 17/8/10, Borys Jurgiel borysia...@aster.pl wrote: From: Borys Jurgiel borysia...@aster.pl Subject: Re: [Qgis-user] Announcing ProfileFromLine plugin To: giovanni.man...@gmail.com Cc: stefaan dondeyne stefaan_donde...@yahoo.co.uk, qgis-user@lists.osgeo.org Date: Tuesday, 17 August, 2010, 14:38 Dnia wtorek 17 sierpnia 2010 o 14:28:26 Giovanni Manghi napisał(a): second advice: use the osgeo4w installer, it is different from what you may already know, but after a few tries it makes perfectly sense... as you have everything in may need in the same installer. I'm not a windows user, but I'm afraid osgeo4w doesn't help in this particular case, as it's written here: http://lists.osgeo.org/pipermail/qgis-user/2010-August/009351.html ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user -- ___ ___ __ Ricardo Garcia Silva ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
The reason for this is the version of GEOS and Shapely libs that are packaged by the osgeo4w folks are a bit older than what the plugin requires. I am sorry for this inconvenience. I'll open a ticket at the osgeo4w trac to ask for packaging of newer libs. If you feel that you absolutely must have this feature, try using GRASS or SAGA GIS as an alternative. I believe many users use Shapely 1.0.x still, so I'd suggest to handle this error in more friendly manner, like: try: from shapely.geos import geos_capi_version except: geos_capi_version = (-1,-1,-1) and then include it to the geosCAPIVersion tests Thanks for the very useful plugin, anyway! It's what people often request from the ProfileTool (and I still hadn't any time to implement). ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
RE: [Qgis-user] Announcing ProfileFromLine plugin
Hello Ricardo, The usefulness of your plugin is very high. Thanks. While testing it I've got the following error: An error has occured while executing Python code: Traceback (most recent call last): File C:/.qgis/python/plugins\ProfileFromLine\ProfileFromLineDialog.py, line 43, in accept params[interval], self.ui.progressBar) File C:/.qgis/python/plugins\ProfileFromLine\ProfileFromLine.py, line 129, in create_profile_layer fieldMapper, rasterLayers, rasterFieldsStart) File C:/.qgis/python/plugins\ProfileFromLine\ProfileFromLine.py, line 179, in create_new_point shapelyPoint = shapelyLine.interpolate(distanceFromLine, normalized) AttributeError: 'LineString' object has no attribute 'interpolate' Python version: 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] QGIS version: 1.6.0-Trunk Trunk, 14077M Any idea why? The line shapefile in input contains 2 lines (many km long). The error is the same if I want to only create the points in-memory or if I want to extract raster values from a bunch of rasters. Another thing, could you tell what is the unit of Sampling interval you are using? Is it in the project units (m, feet, ...) or is it in another unit (the default, 4.00, seems very small to be in metres, but it would depend on the type of project, I suppose)? Also, the sampling interval is limited to 99.99, again, if in the project units, this is a serious limitation. Could you use an 'open' sampling interval? Cheers, Benoit -Original Message- From: qgis-user-boun...@lists.osgeo.org [mailto:qgis-user-boun...@lists.osgeo.org]on Behalf Of Ricardo Filipe Soares Garcia da Sent: Friday, 13 August 2010 22:53 To: qgis-user Subject: [Qgis-user] Announcing ProfileFromLine plugin Hello list I have uploaded a new python plugin called ProfileFromLine. This plugin will generate points along lines according to a user specified interval and will optionally sample loaded raster(s) at each new point's location. Each new point will keep all the attributes of its originating line, plus any raster values that it had been asked to sample. In addition, every point will have a distinct attribute and also an attribute that stores the distance along its line since the beginning (the line's starting point being according to the original digitizing direction). the new points layer is created using the 'memory' provider, and the user must manually save it to disk. this seemed like a nice option, because you can choose your desired format upon saving. The plugin depends on the shapely python package, so you must have it installed and accessible on your system. This shouldn't be much of a problem on linux and windows (it is available on the osgeo4w packages as well). since I don't have a Mac I wouldn't know how easy it is to get shapely installed, but I trust it to be just as easy ;) I hope that it is useful. Please drop me a message through this mailing list if you have any suggestions. -- ___ ___ __ Ricardo Garcia Silva ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
Hello Benoit and list I regret to inform you that, after a more careful inspection of the available libs offered by the osgeo4w installer, I realised that users that are using osgeo4w probably can't use my plugin (yet). The reason for this is the version of GEOS and Shapely libs that are packaged by the osgeo4w folks are a bit older than what the plugin requires. I am sorry for this inconvenience. I'll open a ticket at the osgeo4w trac to ask for packaging of newer libs. If you feel that you absolutely must have this feature, try using GRASS or SAGA GIS as an alternative. Thank you for your feedback On Sat, Aug 14, 2010 at 4:16 PM, Benoit de Cabissole ben...@exigesa.com wrote: Hello again Ricardo, You could be right! After installing the latest version from the plugin repo I got the following error: Couldn't load plugin ProfileFromLine due an error when calling its classFactory() method Traceback (most recent call last): File C:/PROGRAMS/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py, line 138, in startPlugin plugins[packageName] = package.classFactory(iface) File C:/Documents and Settings/Benoit/.qgis/python/plugins\ProfileFromLine\__init__.py, line 30, in classFactory from ProfileFromLine import ProfileFromLine File C:/PROGRAMS/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py, line 279, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File C:/Documents and Settings/Benoit/.qgis/python/plugins\ProfileFromLine\ProfileFromLine.py, line 25, in from shapely.geos import geos_capi_version ImportError: cannot import name geos_capi_version Python version: 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] QGIS version: 1.6.0-Trunk Trunk, 14077M I'm running QGIS 1.6.14077M from OSGeo4W on Windows XP. It then seems that the OSGeo4W Shapely libs (1.0.14-1) are quite old... And I do not know how to compile packages for OSGeo4W :-( Thanks for the quick answer. Cheers, Benoit -Original Message- From: Ricardo Filipe Soares Garcia da [mailto:ricardo.garcia.si...@gmail.com] Sent: Saturday, 14 August 2010 16:55 To: ben...@exigesa.com Cc: qgis-user Subject: Re: [Qgis-user] Announcing ProfileFromLine plugin Hi Benoit While testing it I've got the following error: ... Any idea why? I think you probably have an older version of the GEOS library. Please open a python console (it can be the Qgis python console) and type: import shapely.geos shapely.geos.geos_capi_version it should return a tuple with version 1.6.0 or higher (on my system it reads 1.6.2). Could this be the problem? What OS are you using? I added a check for this variable that will (hopefully) display an informative error message to the user. Another thing, could you tell what is the unit of Sampling interval you are using? Is it in the project units (m, feet, ...) or is it in another unit (the default, 4.00, seems very small to be in metres, but it would depend on the type of project, I suppose)? Also, the sampling interval is limited to 99.99, again, if in the project units, this is a serious limitation. Could you use an 'open' sampling interval? Well, the unit for the sampling interval is actually the layer's own units according to its own reference system and not the project's. The default value of 4,00 is indeed in meters, because the original project for which I designed this plugin is dealing with lines that are 60m long or so. Anyway, I changed the 'sampling interval' spinbox to accept values in the range 0.01 - 100. I'll try to come up with a nicer solution, but in the mean time I hope it will work for people that are using longer line lengths. I uploaded a newer version (0.3) to the repository so please test it out and see if it works for you. Thanks for testing it out :) -- ___ ___ __ Ricardo Garcia Silva -- ___ ___ __ Ricardo Garcia Silva ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Announcing ProfileFromLine plugin
Hello list I have uploaded a new python plugin called ProfileFromLine. This plugin will generate points along lines according to a user specified interval and will optionally sample loaded raster(s) at each new point's location. Each new point will keep all the attributes of its originating line, plus any raster values that it had been asked to sample. In addition, every point will have a distinct attribute and also an attribute that stores the distance along its line since the beginning (the line's starting point being according to the original digitizing direction). the new points layer is created using the 'memory' provider, and the user must manually save it to disk. this seemed like a nice option, because you can choose your desired format upon saving. The plugin depends on the shapely python package, so you must have it installed and accessible on your system. This shouldn't be much of a problem on linux and windows (it is available on the osgeo4w packages as well). since I don't have a Mac I wouldn't know how easy it is to get shapely installed, but I trust it to be just as easy ;) I hope that it is useful. Please drop me a message through this mailing list if you have any suggestions. -- ___ ___ __ Ricardo Garcia Silva ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Announcing ProfileFromLine plugin
On Aug 13, 2010, at 1:53 PM, Ricardo Filipe Soares Garcia da wrote: Hello list I have uploaded a new python plugin called ProfileFromLine. This plugin will generate points along lines according to a user specified interval and will optionally sample loaded raster(s) at each new point's location. Each new point will keep all the attributes of its originating line, plus any raster values that it had been asked to sample. In addition, every point will have a distinct attribute and also an attribute that stores the distance along its line since the beginning (the line's starting point being according to the original digitizing direction). the new points layer is created using the 'memory' provider, and the user must manually save it to disk. this seemed like a nice option, because you can choose your desired format upon saving. This sounds like another nice addition. I have done this with GRASS, and your plugin will greatly simplify the process. Kudos The plugin depends on the shapely python package, so you must have it installed and accessible on your system. This shouldn't be much of a problem on linux and windows (it is available on the osgeo4w packages as well). since I don't have a Mac I wouldn't know how easy it is to get shapely installed, but I trust it to be just as easy ;) It's pretty simple. This worked for me from the Terminal: sudo easy_install shapely I hope that it is useful. Please drop me a message through this mailing list if you have any suggestions. Cheers, John___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user