Re: [Qgis-user] FW: Export Data

2014-10-01 Thread Siki Zoltan

Dear Paolo,

the new version is available from the QGIS offcial repository as an 
experimental plugin.
Can the original owner of the plugin give me rights to upload newer 
versions?


Best regards,
Zoltan

On Tue, 30 Sep 2014, Paolo Cavallini wrote:


Il 30/09/2014 13:22, Siki Zoltan ha scritto:

Dear Paolo,

originally it is not my project, I cloned and upgraded it and sent back to the
original developer to upload to the plugin page. It has not happend yet :(
I have not right to upload to that plugin.
I didn't want to start a new project under my name.


Right. Could you please remind the original author? In case of no reply, I can 
grant
you upload access to the original one.
All the best, and thanks.

--
Paolo Cavallini - www.faunalia.eu
Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html


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


Re: [Qgis-user] FW: Export Data

2014-10-01 Thread Paolo Cavallini
Il 01/10/2014 09:31, Siki Zoltan ha scritto:
 Dear Paolo,
 
 the new version is available from the QGIS offcial repository as an 
 experimental plugin.
 Can the original owner of the plugin give me rights to upload newer versions?

I think he cannot, but I can do it anyway.
Please note: some metadata are missing, I'd appreciate if you could fill up 
tracker
and code repo.
Thanks!

-- 
Paolo Cavallini - www.faunalia.eu
Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] qgis in feature freeze: announcement on qgis.org?

2014-10-01 Thread Filipe Dias
Hi

Since QGIS is in feature freeze shouldn't there be a banner announcing it
to all users and encouraging them to test it? I see there's a small notice
in the opening page but it's not very obvious.

Also, it might be good to say QGIS will have daily Release Candidates
available for all or most OS until its release date.

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

Re: [Qgis-user] OT: IRTF to GDA94 difference

2014-10-01 Thread Chris Crook
Just in relation to the use of the HTDP grids, in Australia you don't need to 
do anything so complicated :-)  On the other hand, if you come from New Zealand 
- as I do - then you definitely need to use an approach something like this if 
you want to use PROJ or almost any other GIS software to do the conversion 
between NZGD2000 and ITRF2008.

The relationship between GDA94 and ITRF2008 at any particular date is a 
standard 7 parameter transformation (3 x translation, 3 x rotation, plus 
scale).  PROJ, along with other GIS coordinate conversion software will handle 
this with a custom datum transformation string.

Cheers
Chris

From: Matt Boyd [mattsli...@gmail.com]
Sent: 01 October 2014 18:26
To: qgis-user
Subject: Re: [Qgis-user] OT: IRTF to GDA94 difference

Thanks everyone,
this is a lot of help.

Matt

On Wed, Oct 1, 2014 at 4:55 AM, Even Rouault 
even.roua...@spatialys.commailto:even.roua...@spatialys.com wrote:
Hi,

Related to that rather advanced topic, I think I should mention similar work
done in the past by Frank Warmerdam in proj.4 for NAD83 vs WGS84 :
https://trac.osgeo.org/proj/wiki/HTDPGrids.
Perhaps a similar approach can work for GDA94.

Best regards,

Even

Le mardi 30 septembre 2014 20:49:56, Chris Crook a écrit :
 Hi Matt

 ITRF is a global reference frame (or actually a series of reference frames
 such as ITRF2000, ITRF2005, ITRF2008, and shortly ITRF2013).  It is the
 coordinate system used for global system such as GNSS (global navigation
 satellite systems, of which GPS is the most well known).

 Each tectonic plate is moving relative to it.  So the movement of the
 Australian plate in this system amounts to about 7 cm per year.

 GDA94 is an Australian datum and is effectively defined in terms of the
 Australian plate, so it moves with it.  What that means a point in
 Australia has a fixed coordinate in terms of GDA94, but it's latitude and
 longitude in terms of an ITRF is steadily changing, equivalent to the 7cm
 per year.  In 1994 when GDA94 was originally defined the latitude and
 longitude were more or less the same as ITRF, which means now the
 difference is equivalent to about 20*7cm = 1.4m offset.  That is, if you
 confuse an ITRF latitude and longitude with a GDA94 latitude and
 longitude, you might be in error by this much.

 UTM refers to a series of Transverse Mercator with central meridians at 6
 degrees of longitude spacing.  That is to say it is a set of functions for
 converting latitude and longitude to and from easting and northing.  The
 UTM coordinate of a point therefore depends upon the latitude and
 longitude of that point, and as noted above, that depends on the datum
 (ITRF,GDA94) used to define the latitude and longitude.

 I haven't reread the specification for a while, but some (many) years ago
 the datum used for UTM was somewhat ambiguously defined to be the
 something like the most significant or dominant datum in the zone in which
 it applied.  However that may have changed to be more specific in these
 days of global reference frames.  If this definition remains then UTM
 zones over Australia could be in terms of GDA94.  However that seems
 unlikely, maybe someone with more current can confirm or deny!

 The main point is that if you care about accuracies of the order of 1m,
 then you need to know what datum you are using.

 The second main point is that the relationship between datums is time
 dependent (ie it is not the same in 1994 as 2014).  This is currently not
 handled by GIS coordinate system metadata, which only handles constant (in
 time) relationships between reference systems.

 Cheers
 Chris Crook

 From: Matt Boyd [mailto:mattsli...@gmail.commailto:mattsli...@gmail.com]
 Sent: Tuesday, 30 September 2014 5:17 p.m.
 To: qgis-user
 Subject: [Qgis-user] OT: IRTF to GDA94 difference

 Hi fellow QGIS people,
 I'd like an easy (as in if it's too hard I probably won't have time to do
 it) way to confirm the drift on GDA94 compared to UTM. I've done a little
 digging and haven't been able to find anything except Australia is moving
 approximately NE at a rate of 7cm per year and in 2005 it was 77cm.
 Having said that, I'm a little hazy on if UTM is the worldwide reference
 and how it's related to IRTF.

 Is there anywhere online that works this out automatically?

 Thanks
 Matt

 
 This message contains information, which may be in confidence and may be
 subject to legal privilege. If you are not the intended recipient, you
 must not peruse, use, disseminate, distribute or copy this message. If you
 have received this message in error, please notify us immediately (Phone
 0800 665 463 or i...@linz.govt.nzmailto:i...@linz.govt.nz) and destroy the 
 original message. LINZ
 accepts no responsibility for changes to this email, or for any
 attachments, after its transmission from LINZ. Thank You.

--
Spatialys - Geospatial professional services
http://www.spatialys.com


This 

[Qgis-user] Serial map from template composer. Working with QGIS 2.2, problems with QGIS 2.4

2014-10-01 Thread Andrea Amparore
Dear QGIS users community,

I'm a new member and I am stuck on a problem since few days, maybe someone
can help me with this.

I have developed a stand-alone python script for making serial maps using
PyQGIS library.

The maps should follow a specific format that is indicated by a template
.qpt file.

This template file is opened and edited with lxml library in order to add
information about the map (title, date, source, etc).

The modified .qpt is then loaded into a new composition, the layers are
added and the map exported.

Everything was working perfectly since I’ve been using QGIS 2.2. Few days
ago I have updated QGIS to the latest version 2.4 and now the output is
sadly empty: map elements are displayed (frame, legend, title..), but no
layer appears on the map.

The script is correct, because it still run correctly on another machine
having QGIS 2.2. Is there anything that I have to modify for running it
with QGIS 2.4?

This is a very basic version of the script.

import os
from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtXml import *
import lxml.etree as etree

print setting prefix
QgsApplication.setPrefixPath(/usr, True)
print initiating qgis
QgsApplication.initQgis()
print 'creating new app'
app = QgsApplication([], True)
#removing old layers
QgsMapLayerRegistry.instance().removeAllMapLayers()

script_folder = os.path.dirname(__file__)
project_folder = os.path.dirname(script_folder)
output_folder = os.path.join(project_folder, 'map_outputs')
xml_folder = os.path.join(project_folder, 'project_outputs')
shapefile_folder = os.path.join(project_folder, 'shapefile_folder')

template_composer = os.path.join(project_folder,
'basic_composer_template_QGIS24.qpt')
polyg_shapefile = os.path.join(shapefile_folder, 'polygon.shp') # crs
EPSG:4326 - WGS 84
point_shapefile = os.path.join(shapefile_folder, 'point.shp') # crs
EPSG:32615 - WGS 84 / UTM zone 15N

mapname = Test Map
srid = 4326
provider_name = 'ogr'
layerset = []

#add layer 1
vlayer_name= 'polygon layer'
vdata_source = polyg_shapefile
print Loading EQ buffers
layer = QgsVectorLayer(vdata_source, vlayer_name, provider_name)
print Buffers loaded
QgsMapLayerRegistry.instance().addMapLayer(layer)
layerset.append(layer.id())

#add layer 2
point_layer_name= 'point layer'
point_data_source = point_shapefile
point_layer = QgsVectorLayer(point_data_source, point_layer_name,
provider_name)
QgsMapLayerRegistry.instance().addMapLayer(point_layer)
layerset.append(point_layer.id())

# Set up the map renderer that will be assigned to the composition
map_renderer = QgsMapRenderer()
#preparing the map the extent - 3 times wider than the polygon layer's
extent
rect = layer.extent()
rect.scale(3)
# Set the labelling engine for the canvas
labelling_engine = QgsPalLabeling()
map_renderer.setLabelingEngine(labelling_engine)
# Enable on the fly CRS transformations
map_renderer.setProjectionsEnabled(True)
# Now set up the composition
composition = QgsComposition(map_renderer)
#set WGS84 as destination crs
map_projection = QgsCoordinateReferenceSystem(srid,
QgsCoordinateReferenceSystem.PostgisCrsId)
map_projection_descr = map_projection.description()
map_renderer.setDestinationCrs(map_projection)

#open the composer template and edit it
with open(template_composer, 'r') as f:
tree  = etree.parse(f)
#setting extent
for elem in tree.iter(tag = 'Extent'):
elem.attrib['xmax'] = str(rect.xMaximum())
elem.attrib['xmin'] = str(rect.xMinimum())
elem.attrib['ymax'] = str(rect.yMaximum())
elem.attrib['ymin'] = str(rect.yMinimum())
#editing the title
for elem in tree.iter(tag = 'ComposerLabel'):
for child in elem:
if child.tag == 'ComposerItem':
if child.attrib['id'] == __maintitle__:
elem.attrib['labelText'] = mapname
#save the edited composer as a new file
new_composer = os.path.join(xml_folder, mapname + _composer.qpt)
tree.write(new_composer)

#open the newly created composer
new_composerfile = file(new_composer, 'rt')
new_composer_content = new_composerfile.read()
new_composerfile.close()
document = QDomDocument()
document.setContent(new_composer_content)
result = composition.loadFromTemplate(document)

# Get the main map canvas on the composition and set the layers
composerMap = composition.getComposerMapById(0)
composerMap.renderModeUpdateCachedImage()
map_renderer.setLayerSet(layerset)

#legend
legend = QgsComposerLegend(composition)
legend.model().setLayerSet(map_renderer.layerSet())
legend.model().setLayerSet
composition.addItem(legend)
legend.setItemPosition (25,122)
legend.setFrameEnabled(True)
legend.setScale(.7)

#save image
print 'saving image'
image = composition.printPageAsRaster(0)
image.save(os.path.join(output_folder,mapname) + .png)

In this link you can find the 2 shapefiles and the composer template that
you need for running the script, and the example of failed 

Re: [Qgis-user] qgis in feature freeze: announcement on qgis.org?

2014-10-01 Thread Anita Graser
Thanks for bringing this up Filipe!

Here is the updated banner image for the call for testing:
https://dl.dropboxusercontent.com/u/42637169/qgisorg_banner_test25.png

Please put it up.

Best wishes,
Anita


On Wed, Oct 1, 2014 at 10:30 AM, Filipe Dias filipesd...@gmail.com wrote:
 Hi

 Since QGIS is in feature freeze shouldn't there be a banner announcing it to
 all users and encouraging them to test it? I see there's a small notice in
 the opening page but it's not very obvious.

 Also, it might be good to say QGIS will have daily Release Candidates
 available for all or most OS until its release date.

 Cheers
 F.



 ___
 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] Serial map from template composer. Working with QGIS 2.2, problems with QGIS 2.4

2014-10-01 Thread Andreas Neumann

Hi Andrea,

Are you aware that QGIS already supports serial printing out of the box 
without scripting? I would first test if that works fine for you before 
bothering with scripts. QGIS 2.2 had serial printing in core, 2.4 has it 
improved and 2.6 has a lot more improvements. I am pretty sure that many 
(most?) cases can now be handled out of the box.


Andreas

On 01.10.2014 10:54, Andrea Amparore wrote:

Dear QGIS users community,

I'm a new member and I am stuck on a problem since few days, maybe 
someone can help me with this.


I have developed a stand-alone python script for making serial maps 
using PyQGIS library.


The maps should follow a specific format that is indicated by a 
template .qpt file.


This template file is opened and edited with lxml library in order to 
add information about the map (title, date, source, etc).


The modified .qpt is then loaded into a new composition, the layers 
are added and the map exported.


Everything was working perfectly since I’ve been using QGIS 2.2. Few 
days ago I have updated QGIS to the latest version 2.4 and now the 
output is sadly empty: map elements are displayed (frame, legend, 
title..), but no layer appears on the map.


The script is correct, because it still run correctly on another 
machine having QGIS 2.2. Is there anything that I have to modify for 
running it with QGIS 2.4?


This is a very basic version of the script.

import os
from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtXml import *
import lxml.etree as etree

print setting prefix
QgsApplication.setPrefixPath(/usr, True)
print initiating qgis
QgsApplication.initQgis()
print 'creating new app'
app = QgsApplication([], True)
#removing old layers
QgsMapLayerRegistry.instance().removeAllMapLayers()

script_folder = os.path.dirname(__file__)
project_folder = os.path.dirname(script_folder)
output_folder = os.path.join(project_folder, 'map_outputs')
xml_folder = os.path.join(project_folder, 'project_outputs')
shapefile_folder = os.path.join(project_folder, 'shapefile_folder')

template_composer = os.path.join(project_folder, 
'basic_composer_template_QGIS24.qpt')
polyg_shapefile = os.path.join(shapefile_folder, 'polygon.shp') # crs 
EPSG:4326 - WGS 84
point_shapefile = os.path.join(shapefile_folder, 'point.shp') # crs 
EPSG:32615 - WGS 84 / UTM zone 15N


mapname = Test Map
srid = 4326
provider_name = 'ogr'
layerset = []

#add layer 1
vlayer_name= 'polygon layer'
vdata_source = polyg_shapefile
print Loading EQ buffers
layer = QgsVectorLayer(vdata_source, vlayer_name, provider_name)
print Buffers loaded
QgsMapLayerRegistry.instance().addMapLayer(layer)
layerset.append(layer.id http://layer.id())

#add layer 2
point_layer_name= 'point layer'
point_data_source = point_shapefile
point_layer = QgsVectorLayer(point_data_source, point_layer_name, 
provider_name)

QgsMapLayerRegistry.instance().addMapLayer(point_layer)
layerset.append(point_layer.id http://point_layer.id())

# Set up the map renderer that will be assigned to the composition
map_renderer = QgsMapRenderer()
#preparing the map the extent - 3 times wider than the polygon layer's 
extent

rect = layer.extent()
rect.scale(3)
# Set the labelling engine for the canvas
labelling_engine = QgsPalLabeling()
map_renderer.setLabelingEngine(labelling_engine)
# Enable on the fly CRS transformations
map_renderer.setProjectionsEnabled(True)
# Now set up the composition
composition = QgsComposition(map_renderer)
#set WGS84 as destination crs
map_projection = QgsCoordinateReferenceSystem(srid, 
QgsCoordinateReferenceSystem.PostgisCrsId)

map_projection_descr = map_projection.description()
map_renderer.setDestinationCrs(map_projection)

#open the composer template and edit it
with open(template_composer, 'r') as f:
tree  = etree.parse(f)
#setting extent
for elem in tree.iter(tag = 'Extent'):
elem.attrib['xmax'] = str(rect.xMaximum())
elem.attrib['xmin'] = str(rect.xMinimum())
elem.attrib['ymax'] = str(rect.yMaximum())
elem.attrib['ymin'] = str(rect.yMinimum())
#editing the title
for elem in tree.iter(tag = 'ComposerLabel'):
for child in elem:
if child.tag == 'ComposerItem':
if child.attrib['id'] == __maintitle__:
elem.attrib['labelText'] = mapname
#save the edited composer as a new file
new_composer = os.path.join(xml_folder, mapname + _composer.qpt)
tree.write(new_composer)

#open the newly created composer
new_composerfile = file(new_composer, 'rt')
new_composer_content = new_composerfile.read()
new_composerfile.close()
document = QDomDocument()
document.setContent(new_composer_content)
result = composition.loadFromTemplate(document)

# Get the main map canvas on the composition and set the layers
composerMap = composition.getComposerMapById(0)
composerMap.renderModeUpdateCachedImage()
map_renderer.setLayerSet(layerset)

#legend
legend = 

[Qgis-user] Fwd: Style widget ergonomics

2014-10-01 Thread Vincent Mora

Hi all,

It would be nice to have the same interface for data defined properties 
in the 'Style' widget and in the 'Labels' widget.


The 'Labels' widget has a small icon on the side of each property that 
allows to specify a field or expression. The 'Style' widget has the 
'Advanced' combobox and the 'Symbol selector' has the big button 'Data 
defined properties...'


The 'Labels' small icon is my preferred option. It could be added beside 
the symbol selector properties. This would replace both the 'Advanced' 
comboboxes and 'Data defined properties...' button.


A step further would be to link this icon with the text/button/combo of 
the property it's related to. If the text/button/combo is big enough, 
the field/expression could take its place (easier to see than overing 
over the yellowed icon). If the text/button/combo is too small, it could 
be grayed out.


I would be happy to have your feedback.

V.


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


Re: [Qgis-user] [Qgis-developer] Fwd: Style widget ergonomics

2014-10-01 Thread Nathan Woodrow
On Wed, Oct 1, 2014 at 10:17 PM, Vincent Mora vincent.m...@oslandia.com
wrote:

 The 'Labels' small icon is my preferred option. It


Hey Vincent,

This is the plan as far as I know.  Both features landed by two different
devs at the same time so it would be good to unify them now that the base
code is good.

Regards,
Nathan
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] qgis_mapserver - Error NetCDF

2014-10-01 Thread Ronaldo palmeira
Dear all,

I was trying to use a qgis project in qgis_mapserver following a tutorial.
The project with simple layers using shape files works fine!! But when I
tried to use a project with NetCDF raster layer, it no shows and apache
complaint about netcdfdataset.cpp:

/var/log/apache2/error.log
ERROR 1: netcdf error #-33 : NetCDF: Not a valid ID .
at (netcdfdataset.cpp,~netCDFDataset,1549)

Is that a problem with qgis_mapserver compilation? Is there some compiled
with theses libraries?

regards,

*Ronaldo Maia de Jesus Palmeira*
*Doutorando em Engenharia Oceânica *
*Grupo de Processos Oceânicos - GruPO*
*palme...@gmail.com palme...@gmail.com*
*  |  palme...@ufrj.br palme...@ufrj.brUFRJ | Universidade Federal do Rio
de Janeiro*

*A percepção do desconhecido é a mais fascinante das experiências. O homem
que não tem os olhos abertos para o misterioso passará pela vida sem ver
nada.*
*Albert Einstein*
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Spatialite-Layer with Z-coordinate

2014-10-01 Thread Gang Yang
Hello!

 

I'm using QGIS 2.4.0. Is it possible to create a Spatialite layer  with
Z-coordinate, for example a point layer with x, y and z value? According to
Spatialite documentation this 2.5D-Layer seems to be supported, but I found
no possibilities to create  such  geometry layer type in QGIS.

 

I would be happy to hear any suggestions or workaround from you. Thank you.

 

Gang

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

Re: [Qgis-user] Serial map from template composer. Working with QGIS 2.2, problems with QGIS 2.4

2014-10-01 Thread Andrea Amparore
Thanks Andreas!

Actually I need to do it with a script, because the serial printing is a
part of a much more complex script.

It works on QGIS 2.2, but on QGIS 2.4 it drives me crazy…

Should I go back to the previous version and forget about the new releases?

Regards,

Andrea

On Wed, Oct 1, 2014 at 12:43 PM, Andreas Neumann a.neum...@carto.net
wrote:

  Hi Andrea,

 Are you aware that QGIS already supports serial printing out of the box
 without scripting? I would first test if that works fine for you before
 bothering with scripts. QGIS 2.2 had serial printing in core, 2.4 has it
 improved and 2.6 has a lot more improvements. I am pretty sure that many
 (most?) cases can now be handled out of the box.

 Andreas


 On 01.10.2014 10:54, Andrea Amparore wrote:

  Dear QGIS users community,

  I'm a new member and I am stuck on a problem since few days, maybe
 someone can help me with this.

  I have developed a stand-alone python script for making serial maps
 using PyQGIS library.

  The maps should follow a specific format that is indicated by a template
 .qpt file.

  This template file is opened and edited with lxml library in order to
 add information about the map (title, date, source, etc).

  The modified .qpt is then loaded into a new composition, the layers are
 added and the map exported.

  Everything was working perfectly since I’ve been using QGIS 2.2. Few
 days ago I have updated QGIS to the latest version 2.4 and now the output
 is sadly empty: map elements are displayed (frame, legend, title..), but no
 layer appears on the map.

  The script is correct, because it still run correctly on another machine
 having QGIS 2.2. Is there anything that I have to modify for running it
 with QGIS 2.4?

  This is a very basic version of the script.

  import os
 from qgis.core import *
 from qgis.gui import *
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 from PyQt4.QtXml import *
 import lxml.etree as etree

  print setting prefix
 QgsApplication.setPrefixPath(/usr, True)
 print initiating qgis
 QgsApplication.initQgis()
 print 'creating new app'
 app = QgsApplication([], True)
 #removing old layers
 QgsMapLayerRegistry.instance().removeAllMapLayers()

  script_folder = os.path.dirname(__file__)
 project_folder = os.path.dirname(script_folder)
 output_folder = os.path.join(project_folder, 'map_outputs')
 xml_folder = os.path.join(project_folder, 'project_outputs')
 shapefile_folder = os.path.join(project_folder, 'shapefile_folder')

  template_composer = os.path.join(project_folder,
 'basic_composer_template_QGIS24.qpt')
 polyg_shapefile = os.path.join(shapefile_folder, 'polygon.shp') # crs
 EPSG:4326 - WGS 84
 point_shapefile = os.path.join(shapefile_folder, 'point.shp') # crs
 EPSG:32615 - WGS 84 / UTM zone 15N

  mapname = Test Map
 srid = 4326
 provider_name = 'ogr'
 layerset = []

  #add layer 1
 vlayer_name= 'polygon layer'
 vdata_source = polyg_shapefile
 print Loading EQ buffers
 layer = QgsVectorLayer(vdata_source, vlayer_name, provider_name)
 print Buffers loaded
 QgsMapLayerRegistry.instance().addMapLayer(layer)
 layerset.append(layer.id())

  #add layer 2
 point_layer_name= 'point layer'
 point_data_source = point_shapefile
 point_layer = QgsVectorLayer(point_data_source, point_layer_name,
 provider_name)
 QgsMapLayerRegistry.instance().addMapLayer(point_layer)
 layerset.append(point_layer.id())

  # Set up the map renderer that will be assigned to the composition
 map_renderer = QgsMapRenderer()
 #preparing the map the extent - 3 times wider than the polygon layer's
 extent
 rect = layer.extent()
 rect.scale(3)
 # Set the labelling engine for the canvas
 labelling_engine = QgsPalLabeling()
 map_renderer.setLabelingEngine(labelling_engine)
 # Enable on the fly CRS transformations
 map_renderer.setProjectionsEnabled(True)
 # Now set up the composition
 composition = QgsComposition(map_renderer)
 #set WGS84 as destination crs
 map_projection = QgsCoordinateReferenceSystem(srid,
 QgsCoordinateReferenceSystem.PostgisCrsId)
 map_projection_descr = map_projection.description()
 map_renderer.setDestinationCrs(map_projection)

  #open the composer template and edit it
 with open(template_composer, 'r') as f:
 tree  = etree.parse(f)
 #setting extent
 for elem in tree.iter(tag = 'Extent'):
 elem.attrib['xmax'] = str(rect.xMaximum())
 elem.attrib['xmin'] = str(rect.xMinimum())
 elem.attrib['ymax'] = str(rect.yMaximum())
 elem.attrib['ymin'] = str(rect.yMinimum())
 #editing the title
 for elem in tree.iter(tag = 'ComposerLabel'):
 for child in elem:
 if child.tag == 'ComposerItem':
 if child.attrib['id'] == __maintitle__:
 elem.attrib['labelText'] = mapname
 #save the edited composer as a new file
 new_composer = os.path.join(xml_folder, mapname + _composer.qpt)
 tree.write(new_composer)

  #open the newly created composer
 new_composerfile = 

[Qgis-user] unable to open Attribute Table

2014-10-01 Thread Jane Kogelschatz
Hello,

 

I am unable to open Attribute Table in QGIS Browser or Desktop 2.4.0 

 

Browser error:  qgis-browser-bin.exe has stopped working

 

Just feature id appears

 

Thank you for any suggestions.

 

Computer is free of viruses and registry is clean.

 

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

Re: [Qgis-user] Serial map from template composer. Working with QGIS 2.2, problems with QGIS 2.4

2014-10-01 Thread Nyall Dawson
On 02/10/2014 2:55 am, Andrea Amparore andrea.ampar...@gmail.com wrote:

 Thanks Andreas!

 Actually I need to do it with a script, because the serial printing is a
part of a much more complex script.

 It works on QGIS 2.2, but on QGIS 2.4 it drives me crazy…

Two things:
- QgsMapRenderer is deprecated in 2.4 and above. You should update your
code to use the new replacement QgsMapSettings object.

- Why don't you try saving the XML templates from your script to qpt files
and then try loading them manually into QGIS? That might give you a better
idea where your script is breaking.

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

Re: [Qgis-user] Serial map from template composer. Working with QGIS 2.2, problems with QGIS 2.4

2014-10-01 Thread Andrea Amparore
Thanks Nyall!
I did what you have suggested: in fact opening manually the new XML as a
.qpt file into QGIS everything works perfectly, and I can manually export a
map.
But it doesn't work in the stand-alone script, which is what I need.
I didn't know that QgsMapRenderer is deprecated in 2.4, this is probably
causing the problem.
I will try to use the QgsMapSettings object instead of it!
Thanks for the hints!
Andrea

On Wed, Oct 1, 2014 at 10:12 PM, Nyall Dawson nyall.daw...@gmail.com
wrote:


 On 02/10/2014 2:55 am, Andrea Amparore andrea.ampar...@gmail.com
 wrote:
 
  Thanks Andreas!
 
  Actually I need to do it with a script, because the serial printing is a
 part of a much more complex script.
 
  It works on QGIS 2.2, but on QGIS 2.4 it drives me crazy…

 Two things:
 - QgsMapRenderer is deprecated in 2.4 and above. You should update your
 code to use the new replacement QgsMapSettings object.

 - Why don't you try saving the XML templates from your script to qpt files
 and then try loading them manually into QGIS? That might give you a better
 idea where your script is breaking.

 Nyall

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

[Qgis-user] OpenStreetMap - Cannot load open ways

2014-10-01 Thread Tony Bazeley

Many thanks to the author of the new OpenStreetMap loading arrangements.

It looks like an excellent tool but I'm having some trouble using it in 
v2.4 under Ubuntu 14.04.
In short the osm data attached appears to be loaded correctly into the 
spatialite database, but extraction from the database into qgis is 
incomplete.


This image 
https://www.dropbox.com/s/sv9nwif19ko5txe/OSMComparison.png?dl=0 shows 
the open(red) and closed (green) ways loaded in relation to the OSM 
background. Purple shows the extraction mask used.


Paraphrasing the three qgis menu steps involved

1. VectorOpenStreetMapDownload data -  I can download the required 
data from OSM
2. VectorOpenStreetMapImport topology from XML - The data seems to be 
loaded correctly into a database
3. VectorOpenStreetMapExport Topology To Spatialite - fails to load 
open ways as expected.


Querying with the Spatialite Gui indicates that open ways are loaded 
into the database 
%3Chttps://www.dropbox.com/s/n9dhtt04ccnysw9/TestOSMWays01.db?dl=0%3E 
but fail to be extracted into the display table.
It looks like the same issue holds for closed ways, although I haven't 
examined them in detail.


I haven't tried accessing OSM data in this way and am a beginner when it 
becomes to spatial databases so would appreciate any guidance before 
filing what I believe is a bug.


Thanks
Tony

?xml version=1.0 encoding=UTF-8?
osm version=0.6 generator=Overpass API
noteThe data included in this document is from www.openstreetmap.org. The data is made available under ODbL./note
meta osm_base=2014-09-30T02:20:02Z/

  node id=31394066 lat=-34.8410322 lon=138.4831456/
  node id=31394068 lat=-34.8441378 lon=138.4818423/
  node id=31394070 lat=-34.8444356 lon=138.4820106/
  node id=31394071 lat=-34.8444829 lon=138.4818943/
  node id=31394072 lat=-34.8444319 lon=138.4817106/
  node id=31394073 lat=-34.8443490 lon=138.4816561/
  node id=31394074 lat=-34.8442061 lon=138.4816938/
  node id=31394075 lat=-34.8441424 lon=138.4818105/
  node id=31394076 lat=-34.8441415 lon=138.4819109/
  node id=31394077 lat=-34.8442818 lon=138.4820718/
  node id=31394078 lat=-34.8443812 lon=138.4820567/
  node id=31394079 lat=-34.8444563 lon=138.4817465/
  node id=31394305 lat=-34.8385261 lon=138.4814637/
  node id=31394312 lat=-34.8387409 lon=138.4833622/
  node id=250023618 lat=-34.8446147 lon=138.4832133/
  node id=250023620 lat=-34.8445013 lon=138.4826021/
  node id=250023622 lat=-34.8444700 lon=138.4828349/
  node id=250023623 lat=-34.8447531 lon=138.4843855/
  node id=279545994 lat=-34.839 lon=138.4849686/
  node id=497392027 lat=-34.8444700 lon=138.4819485/
  node id=497392030 lat=-34.8441726 lon=138.4817343/
  node id=497392032 lat=-34.8441923 lon=138.4820179/
  node id=696734135 lat=-34.8390614 lon=138.4846924/
  node id=696734138 lat=-34.8390242 lon=138.4846602/
  node id=696734145 lat=-34.8389856 lon=138.4846588/
  node id=696734181 lat=-34.8388960 lon=138.4842298/
  node id=696734186 lat=-34.8389513 lon=138.4845201/
  node id=696740155 lat=-34.8387589 lon=138.4834089/
  node id=696740156 lat=-34.8388018 lon=138.4834183/
  node id=696740158 lat=-34.8388539 lon=138.4834041/
  node id=696742842 lat=-34.8395639 lon=138.4837037/
  node id=696742843 lat=-34.8393625 lon=138.4837413/
  node id=696742844 lat=-34.8389479 lon=138.4839102/
  node id=696742845 lat=-34.8388455 lon=138.4839471/
  node id=696742849 lat=-34.8388598 lon=138.4840275/
  node id=696742850 lat=-34.8389608 lon=138.4839840/
  node id=696742851 lat=-34.8393779 lon=138.4838137/
  node id=903629385 lat=-34.8451741 lon=138.4836534/
  node id=916531466 lat=-34.8438288 lon=138.4815682/
  node id=916531467 lat=-34.8439085 lon=138.4818623/
  node id=916531468 lat=-34.8437528 lon=138.4819230/
  node id=916531469 lat=-34.8437042 lon=138.4816172/
  node id=938094190 lat=-34.8439305 lon=138.4820894
tag k=highway v=bus_stop/
tag k=name v=43a/
  /node
  node id=938106285 lat=-34.8402696 lon=138.4822610
tag k=man_made v=water_tower/
  /node
  node id=1005014080 lat=-34.8389235 lon=138.4837848/
  node id=1005014123 lat=-34.8389971 lon=138.4847229/
  node id=1252175664 lat=-34.8386711 lon=138.4838876
tag k=addr:housenumber v=51/
tag k=addr:postcode v=5019/
tag k=addr:street v=Semaphore Road/
tag k=name v=IGA/
tag k=shop v=supermarket/
tag k=website v=www.iga.com.au/
  /node
  node id=1252178338 lat=-34.8388784 lon=138.4825493
tag k=amenity v=post_office/
  /node
  node id=1378107238 lat=-34.8441793 lon=138.4812820/
  node id=1706922886 lat=-34.8391335 lon=138.4813421/
  node id=1706922889 lat=-34.8392826 lon=138.4812998/
  node id=1706922890 lat=-34.8394386 lon=138.4812605/
  node id=1706922893 lat=-34.8397608 lon=138.4811345/
  node id=1839455561 lat=-34.8441993 lon=138.4814738/
  node id=1839455579 lat=-34.8442036 lon=138.4816484/
  node id=1839455583 lat=-34.8442656 lon=138.4815025/
  node id=1839455586 lat=-34.8442746 lon=138.4816556/
  node id=1839455601 lat=-34.852 lon=138.4822243/