Re: [Qgis-developer] Raster providers

2011-02-27 Thread Radim Blazek
Hi,
thanks for testing, there are really too many combinations of data types,
drawing styles, projections, resolutions etc. which I am not able to test all.

It is fixed now. The problem was not in the color handling but in
source resolution calculation.

Radim

On Thu, Feb 24, 2011 at 10:00 AM, Tim Sutton li...@linfiniti.com wrote:
 Hi Radim

 I did some testing too. Having otf projection is coool! Id did run
 into some problems with my paletted image[1] though.

 If I open the image in QGIS default session (i.e. no OTF projection)
 it displays fine [2].
 If I enabled OTF Projection (using 900913 Google Mercator) the image
 displays as all grey [3].
 If I set the CRS to the native image projection (EPSG:32734), the
 image does not show at all.

 I still need to test with other image types properly but thought I
 would give you this feedback so long.

 Also I noted that for greyscale images they always seem to load with
 min 0 / max 0 and I have to manually go into properties to load them
 from the layer.

 [1] http://linfiniti.com/downloads/Toposheet.tif.bz2
 [2] http://imgur.com/JHOvt
 [3] http://imgur.com/NxB7z


 By the way if anyone else is using git-svn and wanting to test Radims
 branch, this was the process I used to add it as a local and remote
 branch in my local repo:


 git config --add svn-remote.raster-providers.url
 https://svn.osgeo.org/qgis/branches/raster-providers
 git config --add svn-remote.raster-providers.fetch
 :refs/remotes/raster-providers
 git svn fetch raster-providers -r 15231
 git checkout -b raster-providers -t raster-providers
 git svn rebase raster-providers

 Thanks to Juergen for pointing me to the relevant crannie in the
 internet that showed how to do that.

 Regards

 Tim


 On Mon, Feb 21, 2011 at 4:04 PM, Radim Blazek radim.bla...@gmail.com wrote:
 Hi have fixed some known problems:
 - short data types are represented by longer types to get space for
 nulls (the problem Marco found)
 - avoid statistics calculation on raster load  (reported by John C. Tull)
 - properties are enabled according provider capabilities

 Please test.
 Radim
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer




 --
 Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
 ==
 Please do not email me off-list with technical
 support questions. Using the lists will gain
 more exposure for your issues and the knowledge
 surrounding your issue will be shared with all.

 Visit http://linfiniti.com to find out about:
  * QGIS programming and support services
  * Mapserver and PostGIS based hosting plans
  * FOSS Consulting Services
 Skype: timlinux
 Irc: timlinux on #qgis at freenode.net
 ==

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Raster providers

2011-02-27 Thread Radim Blazek
On Thu, Feb 24, 2011 at 10:00 AM, Tim Sutton li...@linfiniti.com wrote:
 Also I noted that for greyscale images they always seem to load with
 min 0 / max 0 and I have to manually go into properties to load them
 from the layer.

For me it loads with source data type range (tested with UInt16) and
it works the same
way in trunk. QgsRasterLayerProperties are using
mRasterLayer-minimum/maximumValue()
which is by default the source data type (passed to
QgsContrastEnhancement) range.

Maybe 'Contrast enhancement' should be set to 'Stretch to MinMax' by
default for SingleBandGray?

There was little confusion in types of data read for stats calculation
for GDAL, fixed.

Radim
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Raster providers

2011-02-27 Thread Tim Sutton
Hi Radim

On Sun, Feb 27, 2011 at 6:04 PM, Radim Blazek radim.bla...@gmail.com wrote:
 On Thu, Feb 24, 2011 at 10:00 AM, Tim Sutton li...@linfiniti.com wrote:
 Also I noted that for greyscale images they always seem to load with
 min 0 / max 0 and I have to manually go into properties to load them
 from the layer.

 For me it loads with source data type range (tested with UInt16) and
 it works the same
 way in trunk. QgsRasterLayerProperties are using
 mRasterLayer-minimum/maximumValue()
 which is by default the source data type (passed to
 QgsContrastEnhancement) range.

 Maybe 'Contrast enhancement' should be set to 'Stretch to MinMax' by
 default for SingleBandGray?

 There was little confusion in types of data read for stats calculation
 for GDAL, fixed.



Thanks its working great now. The grayscale issue I was having I can't
replicate with the data I have here at home - will try again tomorrow
on my office pc with the original dataset - as far as I know that
machine is already set to stretch to min-max by default.

From playing around a little on my samsung netbook, I would say
performance seems quite ok for raster reprojection given the CPU's on
these machines are slow.

I found two other issues:

- pyramids tab no long shows options to build pyramids (you can
replicate with that test dataset I pointed you to).
- it would be nice if the 'collar' - the part outside the image data
area in rotated images was made transparent by default.

Otherwise its looking great for a merge into trunk soon and being part of 1.7!

regards

Tim


 Radim




-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Raster providers

2011-02-27 Thread Radim Blazek
On Sun, Feb 27, 2011 at 7:08 PM, Tim Sutton li...@linfiniti.com wrote:
 Thanks its working great now. The grayscale issue I was having I can't
 replicate with the data I have here at home - will try again tomorrow
 on my office pc with the original dataset - as far as I know that
 machine is already set to stretch to min-max by default.

Sorry, you were right, after selecting 'stretch to min/max' and apply,
the min max values were set wrongly. Fixed now in GDAL provider
(was missing const, uff).

 From playing around a little on my samsung netbook, I would say
 performance seems quite ok for raster reprojection given the CPU's on
 these machines are slow.

I have done some more optimization today, still not the best but acceptable,
for me, the reprojection takes about 75% of time more.
BTW: compiling as Release, the reprojection time was reduced to about 25%.

 I found two other issues:

 - pyramids tab no long shows options to build pyramids (you can
 replicate with that test dataset I pointed you to).

Fixed. The methods were not virtual, but how on earth it could work before?

 - it would be nice if the 'collar' - the part outside the image data
 area in rotated images was made transparent by default.

Isn't it? The data outside source data extent are null. That is the source
of all the troubles with null values handling and types remapping.
The grey border around the tif you posted is part of the image. Is not?

Radim

 Otherwise its looking great for a merge into trunk soon and being part of 1.7!

 regards

 Tim


 Radim




 --
 Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
 ==
 Please do not email me off-list with technical
 support questions. Using the lists will gain
 more exposure for your issues and the knowledge
 surrounding your issue will be shared with all.

 Visit http://linfiniti.com to find out about:
  * QGIS programming and support services
  * Mapserver and PostGIS based hosting plans
  * FOSS Consulting Services
 Skype: timlinux
 Irc: timlinux on #qgis at freenode.net
 ==

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Raster providers

2011-02-27 Thread Tim Sutton
Hi

8-snip-

 - it would be nice if the 'collar' - the part outside the image data
 area in rotated images was made transparent by default.

 Isn't it? The data outside source data extent are null. That is the source
 of all the troubles with null values handling and types remapping.
 The grey border around the tif you posted is part of the image. Is not?


Sorry you are right - the issue lies with my data.

Do you have anything else left on your todo list before you can merge to trunk?

+1 from me to merge when you are ready

I would like to make some cleanups to the raster properties dialog
after you are done...hopefully I can do the ui clean upsin time for
1.7

Regards

Tim

-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Plugin Development C++ Windows - Any response?

2011-02-27 Thread Martin Dobias
On Sat, Feb 26, 2011 at 12:52 PM, Barend Gehrels bar...@xs4all.nl wrote:
 I can imagine the API is not binary compatible for some upgrades (usually
 it
 is extended so then still compatible, depending on the model used). Is
 there
 not a mechanism to check if a plugin corresponds to the version of the
 host
 (qgis)? I think this is feasable...

 Yes the version is available within the QGIS namespace: QGis::QGIS_VERSION

 What I mean is this: adding one method to QgisPlugin, e.g.:
 virtual int interfaceVersion() = 0;

 which gives back a interface_version_number. That number only changes if the
 (plugin) interface changes. QGis can check if the plugin does implement the
 right interface.

 But I now understand better that if the plugin calls back the qgis API, also
 that interface has to be stable. So in practice this will indeed change with
 every version. But anyway, even then, qgis can check that number as its
 first action and discard that plugin if the interface_version_number is
 wrong.

Exactly. This is something that should be added and checked in order
to avoid possible crashes after upgrades. Even better would be to make
it a global function in each plugin since that would avoid creation of
a new instance of that plugin which could actually make some calls to
qgis api. I would call that method e.g. 'requiredQgisVersion' and it
would always QGis::QGIS_VERSION - i.e. version of qgis used when
compiling the plugin.

Martin
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS and Google Summer of Code - ideas page on the wiki

2011-02-27 Thread Giuseppe Sucameli
On Mon, Feb 28, 2011 at 1:08 AM, Giuseppe Sucameli sucam...@faunalia.itwrote:

 adding ... to the gsoc proposal?
 ... add it to the proposal?

I forgot the list word 2 times... it's time to go bed.

-- 
Giuseppe Sucameli
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Raster providers

2011-02-27 Thread John C. Tull
Hi,

I was testing a little today. It appears that WMS layers are not being 
projected. I would imagine that needs to be corrected before a merge. Also, 
openlayers are not correctly projecting based on some quick tests on my end. 
I'm not sure if this is a problem with the branch or the plugin.

Cheers,
John

On Feb 27, 2011, at 12:54 PM, Tim Sutton wrote:

 Hi
 
 8-snip-
 
 - it would be nice if the 'collar' - the part outside the image data
 area in rotated images was made transparent by default.
 
 Isn't it? The data outside source data extent are null. That is the source
 of all the troubles with null values handling and types remapping.
 The grey border around the tif you posted is part of the image. Is not?
 
 
 Sorry you are right - the issue lies with my data.
 
 Do you have anything else left on your todo list before you can merge to 
 trunk?
 
 +1 from me to merge when you are ready
 
 I would like to make some cleanups to the raster properties dialog
 after you are done...hopefully I can do the ui clean upsin time for
 1.7
 
 Regards
 
 Tim
 
 -- 
 Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
 ==
 Please do not email me off-list with technical
 support questions. Using the lists will gain
 more exposure for your issues and the knowledge
 surrounding your issue will be shared with all.
 
 Visit http://linfiniti.com to find out about:
  * QGIS programming and support services
  * Mapserver and PostGIS based hosting plans
  * FOSS Consulting Services
 Skype: timlinux
 Irc: timlinux on #qgis at freenode.net
 ==
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] new plugin repo online

2011-02-27 Thread Giuseppe Sucameli
Hi guys,
thanks a lot for your work! The new plugin site it's really nice.

BTW, the https login is still missing. I understand it would be one of the
last features
you'll put on.
Do you have a todo list or a roadmap? I'd like to look at it.

Cheers.

On Fri, Feb 25, 2011 at 1:56 PM, Martin Dobias wonder...@gmail.com wrote:

 On Thu, Feb 24, 2011 at 9:41 AM, Paolo Cavallini cavall...@faunalia.it
 wrote:
  Il giorno mer, 23/02/2011 alle 00.47 -0800, Alex Mandel ha scritto:
 
  That feature has been discussed, is way down at the bottom of the todo
  list but is quite possible. We are looking for python programmers to try
  and implement it in django if you are interested in helping.
 
  I do not quite agree it's a low priority issue: we found the publishing
  process rather painful, and error prone. We use a bash script for this,
  it can be used until a py program comes out.

 Probably the easiest way for publishing of plugins would be a python
 script bundled with QGIS which would do it on request:

 publish_plugin.py -user foo -pass bar  my_plugin

 That would zip the my_plugin plugin from your local working
 directory, sign you in the qgis repository, upload the plugin and
 print the result (success / error). Such a script can be done very
 quickly, right? Eventually a plugin could do this job, remembering the
 username/password, so publishing a new version of a plugin would be a
 one-click action.

 Martin
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer




-- 
Giuseppe Sucameli
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] PyQGIS Cookbook, MySQL geometries and Graduated symbol renderer

2011-02-27 Thread Germán Carrillo
Hi Martin,

I would like to propose a couple of Python snippets to be included in the
PyQGIS Cookbook.

1)  Load of MySQL geometries:
--
uri =
MySQL:dbname,host=localhost,port=3306,user=root,password=xxx|layername=my_table
vLayer = QgsVectorLayer( uri, 'my_table', 'ogr' )
--
BTW, I'm not sure if it is the best way to do it, but it works.

2) Graduated symbol renderer (Old symbology):
--
fieldName = My_Field
numberOfClasses = 5
mFieldMap = {}

# Get the field index based on the field name
fields = layer.pendingFields()
for ( key, field ) in fields.iteritems():
if field.type() == QVariant.Int or field.type() == QVariant.Double:

mFieldMap[ str( field.name() ) ] = key
fieldIndex = mFieldMap[ fieldName ]

# Create the renderer object
renderer = QgsGraduatedSymbolRenderer( layer.geometryType() )
renderer.setMode( QgsGraduatedSymbolRenderer.EqualInterval ) #
EqualInterval/Quantile/Empty

# Prepare the required symbol objects
symbolList = []
geom = layer.geometryType()
provider = layer.dataProvider()
for i in range( numberOfClasses ):
symbol = QgsSymbol( geom )
brush = QBrush()
brush.setColor( self.randomColor() )
brush.setStyle( Qt.SolidPattern )
symbol.setBrush( brush )
symbolList.append( symbol )

# Define classes
minimum = provider.minimumValue( fieldIndex ).toDouble()[ 0 ]
maximum = provider.maximumValue( fieldIndex ).toDouble()[ 0 ]
for i in range( numberOfClasses ):
# Switch if attribute is int or double
lower = ('%.*f' % (2, minimum + ( maximum - minimum ) / numberOfClasses
* i ) )
upper = ('%.*f' % (2, minimum + ( maximum - minimum ) / numberOfClasses
* ( i + 1 ) ) )

lowerString = QVariant( lower ).toString()
upperString = QVariant( upper ).toString()
symbolList[ i ].setLowerValue( lowerString )
symbolList[ i ].setUpperValue( upperString )
symbolList[ i ].setLabel( lowerString +  -  + upperString )

# Define a symbol object based on each class
for i in range( numberOfClasses ):
symbol = symbolList[ i ]
lower_bound = symbol.lowerValue()
upper_bound = symbol.upperValue()
label = symbol.label()

sy = QgsSymbol( layer.geometryType(), lower_bound, upper_bound, label )
sy.setFillColor( symbol.brush().color() )
sy.setFillStyle( symbol.brush().style() )

renderer.addSymbol( sy )

renderer.setClassificationField( fieldIndex )
layer.setRenderer( renderer )
--


Regards,

Germán

-- 
---
   |\__
(:__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS and Google Summer of Code - ideas page on the wiki

2011-02-27 Thread Paolo Cavallini
Il giorno lun, 28/02/2011 alle 01.08 +0100, Giuseppe Sucameli ha
scritto:
 Hi guys,
 I added the DBmanager development, maybe this could be a good chance
 to integrate some of the database plugins.

Hi all.
I also added another idea (thanks frankie@debian): to make qgis
scriptable. I think this would be very useful for repetitive, automated
tasks.
All the best.
-- 
http://www.faunalia.it/pc

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer