Re: [Qgis-user] Select by Expression with Subquery

2019-06-17 Thread Martin Bain
Hi Randy,
This might work in QGIS 3 - it's untested because I'm currently on a machine 
with QGIS 2.18 (where the @parent variable is unavailable)

aggregate( 'LAYER2','count',"NAME","NAME"=attribute(@parent, 'NAME')) > 0

The other way might be to create a join to your target layer and then select 
the rows where the value of joined column is not null.

Cheers,
Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
Altergott, Randy (CCI-Southwest)
Sent: Tuesday, 18 June 2019 3:41 AM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Select by Expression with Subquery

Hi QGIS users,
I'm new to QGIS and this is my first question.
Can I use QGIS "Select by Expression" to select all features in a vector layer 
where the "name" field value is also found within another layer (delimited text 
layer with no geometry)? I get a syntax error when using the following SQL.

"NAME" IN (SELECT "NAME" FROM 'LAYER2')

I'm using the "Map Layers" menu to add the layer name, so it actually displays 
something like 'LAYER2_ca36271a_8ec7_4aa7_a36c_67418104f66c' instead of just 
'LAYER2'.

Thanks,
Randy

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Query cross-table "similar" time stamps?

2019-05-20 Thread Martin Bain
Hi Bernd,
I replied to your question on stack exchange (with a similar expression to 
Harrissou)

I initially started with a virtual layer (because I’m a database guy – you know 
the expression “when you only have hammer everything looks like nail”) but then 
I thought I should try to find a more accessible, QGIS way to do it.

Here is the SQL I used in the DB Manager which could be loaded as a layer:

SELECT  *, (select "Tracks"."fid" as PositionId
  FROM "Tracks"
  where julianday("Sightings"."ObsTime" ) 
-julianday("Tracks"."PositionTime")>=0
  order by "Tracks"."PositionTime" DESC LIMIT 1) as 
PositionID
FROM "Sightings"

My two test tables where Sightings(fid,ObsTime) and Tracks(fid, PositionTime).

It creates a look alike of the Sightings layer with an additional column for 
the id of the Position.

I also made another SQL statement which created Line geometries connecting the 
Sighting and the associated position.  That’s on my computer at home which I 
don’t have access to ATM.


Regards,
Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of DelazJ
Sent: Tuesday, 21 May 2019 1:51 PM
To: Bernd Vogelgesang 
Cc: qgis-user 
Subject: Re: [Qgis-user] Query cross-table "similar" time stamps?

Hi Bernd

I did not understand that you were looking for a way to create a virtual layer. 
Virtual layers require SQL instructions and in this particular case, I think 
you'll need window function (I don't know if supported by the SpatiaLite 
provider in the backend and don't have time to give it a try). This is quite a 
different thing.

From what I understood you wanted to be able to join both layers. This is what 
the expression I'm suggesting is meant to do:
#. Open the birds layer attribute table
# Use the field calculator button to add a new (virtual?) field (it will be 
used store the track id)
#. Populate the field using the provided expression

attribute(get_feature ('track_points','time', aggregate( layer:='track_points',

aggregate:='max',

expression:="time",

filter:="time"< attribute(@parent, 'time'))),'fid')

#. Apply



This expression is a kind of WHERE clause so basically we say update bird_layer 
set yournewfield=fid from track_points where whatisinget_featureparenthesis. 
@parent indeed is a imho hidden variable that refers to the feature in the bird 
layer. [0]

What dialect is it? QGIS' (highly inspired from sql... (and python?)). I don't 
know if it has a proper name and there's no better doc as far as I know than 
looking at the functions' help in the expression dialog and practice. You 
quickly get the logic. You also have some samples in the user manual [2]. And 
probably in some tutorials out there.

Yes single or double quotes are important and have their meaning [3]



Then you can do whatever you want with this field (label, symbolize with 
geometry generator [1] eg line connecting track_point and bird, the usual join 
of layers...)


PS: I did not test your data since the date formatting I had in the temporary 
layers I used was the same as in your picture (that i only viewed after I sent 
my first reply)


[0] 
https://docs.qgis.org/3.4/en/docs/user_manual/working_with_vector/expression.html#variables-functions
 actually polished at https://github.com/qgis/QGIS-Documentation/pull/3753
[1] 
https://docs.qgis.org/3.4/en/docs/user_manual/working_with_vector/style_library.html#the-geometry-generator
[2] 
https://docs.qgis.org/3.4/en/docs/user_manual/working_with_vector/expression.html
[3] http://osgeo-org.1560.x6.nabble.com/SQL-Expressions-tp5190508p5196052.html

Hope that helps,
Harrissou

Le lun. 20 mai 2019 à 19:42, Bernd Vogelgesang 
mailto:bernd.vogelges...@gmx.de>> a écrit :
Am 18.05.19 um 11:42 schrieb DelazJ:
Hi Bernd,
Hum.. interesting. Assuming you have two layers: tracks (id_track, date_track) 
and birds(id_bird, date_bird), the idea is to get the id of the highest among 
the date_track(s) lower than the date_bird for each bird. Am I right?
I gave it a shot and i think i have some working expression. Here I display the 
matching track id in birds labels

attribute(
  get_feature ( 'tracks',
  'date_track',
  aggregate( layer:='tracks',
  aggregate:='max',
  expression:="date_track",
  filter:="date_track"< attribute(@parent, 
'date_bird')
  )
 ),
  'id_track'
)

I used temporary layers with datetime field.
Now, without sample of dataset to actually see the date formatting issue you 
were afraid of...

Hope that helps,
Harrissou


Hi Harrissou,

I tried your expression in a virtual layer, but it throws an error

Query execution error on CREATE TEMP VIEW _tview AS attribute(get_feature 
('track_points','time', aggregate( layer:='track_points',

aggregate:='max',

expression:="time",

filter:="time"< 

Re: [Qgis-user] script filegdb to spatial lite

2017-11-08 Thread Martin Bain
Matt,
Have a look into the ogr2ogr.exe which is installed with QGIS.

It’s a command line program that converts formats.  You could make a batch 
script to get the data you want one layer at a time into a single spatialite 
db.  I’m afraid you got a bit of work to do to figure out the options for your 
input and output formats.

Here’s a sample I found on my hard drive that I did some time ago to get data 
from a SQL Server table into Spatialite, to give you an idea of what’s 
involved.  I don’t remember what all options are :P

C:\OSGeo4W\bin\ogr2ogr.exe -f SQlite "C:\output7.sqlite" 
"MSSQL:server=;database=;trusted_connection=yes;" -sql "SELECT * FROM 
lOT" -a_srs "EPSG:28356" -dsco SPATIALITE=yes -nln "LOT" -nlt PROMOTE_TO_MULTI 
-geomfield SP_GEOMETRY –append

Good luck.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Matt 
Boyd
Sent: Thursday, 9 November 2017 2:53 PM
To: qgis-user 
Subject: [Qgis-user] script filegdb to spatial lite

Hi QGISers,
I'm working from a corporate dataset, mostly geodatabases located on a network 
drive.
I'd like to make a portable version of the datasets that I use that's updated 
either automaticaly, or whenever I run a script.
I'm not 100% sure how spatialite works. Is everything in a single file 
database? I'd like to just create a script only grabbing the data I specify 
from the network drive and save that locally.
I don't do the database updating so it's only a one way process.

Has anyone done something like this? are there shortcuts?

Thanks
Matt

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Linking coordinates between layers

2017-10-12 Thread Martin Bain
Hi Simon,
One way would be to add the line layer as a virtual layer with the query text:

SELECT make_line(A.geometry,B.geometry) AS geom, 
st_distance(A.geometry,B.geometry) AS dist
FROM LayerA AS A, LayerB AS B

Just substitute LayerA and LayerB with the names of your layers.

This would create a dynamic layer with one attribute "dist" - the distance 
between the points, and the geometry would be a line connecting the two points. 
 Whenever you move a point the line layer will update, if you labelled the line 
layer with the distance attribute, the label position and text would also 
update.

It gets quite funky if you have multiple points in each layer - there are lines 
drawn between all points.  If there are m points in layer A and n points in 
layer B there will be m*n points in the dynamic layer (a "cross join" in SQL 
parlance).  I imagine performance would be dreadful on layers with many points 
- but not an issue for your use case.

Cheers,
Martin.

-Original Message-
From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of simonc8
Sent: Friday, 13 October 2017 3:22 AM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Linking coordinates between layers

I have two point layers each with a single point in them. I want to draw a line 
joining the points to use to measure the distance apart. I have found various 
plug-ins which allow this, but is there a way I can actually link the point 
coordinates to the line layer so that if I move one of the points the line will 
update automatically?

Grateful for advice.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Point Fill Polygon

2017-10-08 Thread Martin Bain
Hi Tyler,
Good question.  I couldn’t see how to do it with a “Point Pattern Fill”

But you could do it with a “Geometry Generator” style and a custom function.

Here’s a custom function I wrote to generate a grid of points from the feature 
polygon’s bounding box.

It intersects the point grid with the polygon to return a multipoint object of 
all the points within the polygon.
-
"""
Define new functions using @qgsfunction. feature and parent must always be the
last args. Use args=-1 to pass a list of values as arguments
"""

from qgis.core import *
from qgis.gui import *

@qgsfunction(args='auto', group='Custom')
def pointGrid(step, feature, parent):
geom=feature.geometry()
mbr=feature.geometry().boundingBox()
x1=mbr.xMinimum()
x2=mbr.xMaximum()
y1=mbr.yMinimum()
y2=mbr.yMaximum()
gPnt =[]
while x1mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Tyler 
Veinot
Sent: Saturday, 7 October 2017 5:08 AM
To: QGIS User List >
Subject: [Qgis-user] Point Fill Polygon

Hi;
In a point/symbol fill polygon is there anyway to allow the point/svg symbol to 
extrude over the polygon border and not be cut off. Or only show symbols that 
are completely contained by the polygon? The polygon is only a rough area of 
forest and I am trying to fill it with little tree triangles but I don't want 
symbol slivers at the polygon edge.
Tyler


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Browser Panel Import

2017-09-06 Thread Martin Bain
Thank you Alessandro and Richard for your replies, I didn’t know what the 
expected behaviour was.

Thank you Steven for alerting me to the already logged ticket.

From: Steven Evans [mailto:steven.ev...@parkes.nsw.gov.au]
Sent: Wednesday, 6 September 2017 8:55 AM
To: Alessandro Pasotti <apaso...@gmail.com>; Richard Duivenvoorde 
<rich...@duif.net>; Martin Bain <martin.b...@lismore.nsw.gov.au>
Cc: qgis-user@lists.osgeo.org; Shaun Goodenough 
<shaun.goodeno...@lismore.nsw.gov.au>
Subject: RE: [Qgis-user] Browser Panel Import

Hi;
An issues log has been created a couple of months ago.
https://issues.qgis.org/issues/16805

I too fell for the same trap…
I'm encouraging my end users to stick to double click not drag-drop until this 
can be resolved…
Regards
Steve

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
Alessandro Pasotti
Sent: Tuesday, 5 September 2017 7:33 PM
To: Richard Duivenvoorde
Cc: qgis-user@lists.osgeo.org<mailto:qgis-user@lists.osgeo.org>; Shaun 
Goodenough
Subject: Re: [Qgis-user] Browser Panel Import

On Tue, Sep 5, 2017 at 9:14 AM, Richard Duivenvoorde 
<rdmaili...@duif.net<mailto:rdmaili...@duif.net>> wrote:

While it's nice to impress new users to use this 'drag a file into a
database' feature :-)  I think it's also a 'shoot and run' solution:
either OK or nothing...

Would it be an idea to (sorry dialog haters) have a summary/confirmation
dialog in between this action? Telling the user that 'this file/table
with such columns be copied/moved to that file/table with these columns'?

In this case, it would also have made it possible to stop this overwrite
action?

I don't think it's a good design: if the result of the action is reversible a 
confirm dialog is unnecessary, and we are trying to elminate all unnecessary 
modals.
I'd stick to the confirm dialog for all potentially destructive actions.

I recommend to follow the new geopackage implementation behavior:
- if the drop is on self: abort
- if the drop overrides an existing table: confirm
- if the drop does not override and hence creates a new table: notify on 
success or error

If you've done a wrong drop, you can easily delete the imported layer (at least 
now it's implemented for geopackage and all ogr/gdal, provided it's supported 
by the gdal/ogr provider)

Regards.



Regards,

Richard Duivenvoorde

On 05-09-17 09<tel:05-09-17%2009>:04, Alessandro Pasotti wrote:
> It looks like a bug.
>
> Did you file a ticket?
>
> The expected behavior is that the layer you are dragging is imported
> (without overwriting!) into the destination DB (the drop target).
>
> In case of overwriting, a confirm dialog should appear.
>
> I've recently worked on that for geopackage and I've also added some
> logic to prevent dropping onto itself (that could lead to data loss).
>
> Cheers
>
>
>
> On Tue, Sep 5, 2017 at 8:39 AM, Martin Bain
> <martin.b...@lismore.nsw.gov.au<mailto:martin.b...@lismore.nsw.gov.au> 
> <mailto:martin.b...@lismore.nsw.gov.au<mailto:martin.b...@lismore.nsw.gov.au>>>
> wrote:
>
> Hi List,
>
> I just discovered a brutal feature of the Browser Panel.
>
> __ __
>
> When browsing SQL Server if you happen to click and drag on a table
> then when you release the mouse button a dialog box will pop up
> saying “Import Competed”.
>
> __ __
>
> The table under the cursor when mouse button is released gets
> overwritten with an empty table, without any sort of prompt!
>
> __ __
>
> Within SQL Server I have now revoked DDL permissions from the user
> that did this (and myself).
>
> __ __
>
> But was wondering, Is there a way to prevent or modify this
> behaviour in QGIS?
>
> __ __
>
> Thanks,
>
> Martin.
>
>
> This email is intended for the named recipient only. The information
> it contains may be confidential. If you are not the intended
> recipient you must not reproduce or distribute any part of this
> email, disclose its contents to any other party or take any action
> in reliance on it. If you have received this email in error, please
> contact the sender immediately and delete the message.
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org<mailto:Qgis-user@lists.osgeo.org> 
> <mailto:Qgis-user@lists.osgeo.org<mailto:Qgis-user@lists.osgeo.org>>
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> <https://lists.osgeo.org/mailman/listinfo/qgis-user>
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> <https://lists.osgeo.org/mailman/listinfo/qgis-user>
>
>
>
>

[Qgis-user] Browser Panel Import

2017-09-05 Thread Martin Bain
Hi List,
I just discovered a brutal feature of the Browser Panel.

When browsing SQL Server if you happen to click and drag on a table then when 
you release the mouse button a dialog box will pop up saying "Import Competed".

The table under the cursor when mouse button is released gets overwritten with 
an empty table, without any sort of prompt!

Within SQL Server I have now revoked DDL permissions from the user that did 
this (and myself).

But was wondering, Is there a way to prevent or modify this behaviour in QGIS?

Thanks,
Martin.

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Spatial join with QGIS 2.18.6

2017-09-04 Thread Martin Bain
I had this issue too - it went away after I uninstalled the "QGIS2compat" 
plugin.

Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
Jan-Eric Oskarsson
Sent: Tuesday, 5 September 2017 11:46 AM
To: 'Parodi Ulderica' ; 
qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Spatial join with QGIS 2.18.6

Hi Ulderica!

I don't think you are doing anything wrong.
I tried to install refFunctions to but it seems as the refFunctions plugin is 
broken. Maybe it's not updated for the latest QGIS versions.
I tried to find this Pluginbuilders ,Enrico Ferreguti, email-address, to report 
this problem to him, but can't find it. Maybe someone else can find it.

/Jan-Eric


Från: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] För Parodi Ulderica
Skickat: den 4 september 2017 18:33
Till: 'qgis-user@lists.osgeo.org' 
>
Ämne: [Qgis-user] Spatial join with QGIS 2.18.6

Today I tried to install the plugin for spatial joins but I can't install the 
needed refFunctions plugin because during installation it tells me that the 
plgin is corrupt. The python message is: cannot import name uic.

What am I doing wrong?
Can you please give me a hint?

Thanks,

Ulderica


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Geology symbols

2017-08-08 Thread Martin Bain
Hi Allan,
I’m not a geologist, but I wonder if you have seen this recent QGIS blog post:
https://ieqgis.wordpress.com/2017/07/14/using-trigonometry-to-place-and-orientate-labels/

I hope it might be of some use.
Cheers,
Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Allan 
Younger
Sent: Tuesday, 8 August 2017 8:08 PM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Geology symbols

How do you insert mapped structural symbols into a plan?
These have a compass orientation & inclination direction.
These can be any orientation but I cannot see how you can have in one layer.
Only close success I have had putting single symbols in a layer, must be a 
better way.
Allan Younger

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Mini dump when adding SQL layers QGIS 2.18.8

2017-06-25 Thread Martin Bain
Hi Johanna,
2.18.8 was quickly replaced by 2.18.9 I think it had some issues - I don't know 
if any of them relate to your problem.

Are you adding the layers from the browser window or the add layer menu?

Are you using a named ODBC DSN or putting the SQL Server Host details directly 
into QGIS?  I had mini dumps when I was using named ODBC connections.

I'm afraid the only thing I can suggest, if you haven't already tried, is to 
try switching the way you are connecting and adding the layers.

Cheers,
Martin.



From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Johanna 
Botman
Sent: Monday, 26 June 2017 8:18 AM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Mini dump when adding SQL layers QGIS 2.18.8

We have recently upgraded to 2.18.8 and I am struggling with adding data from 
MS SQL. I get a mini dump every time.

I still have 2.14 installed on my Windows 7 64 bit machine and I don't have the 
same issue with that version. Any tips for troubleshooting?





Johanna Botman
Asset & GIS Officer | Melton City Council
[Melton logo colour - low res]   P: 03 9747 7209
   E: johan...@melton.vic.gov.au
   W: melton.vic.gov.au


***
The information in this message is privileged and confidential, intended only 
for the use of the individual or entity named above. If you are not the 
intended recipient you are hereby notified to delete the message and that any 
dissemination, copying or use of its content is strictly prohibited. If you 
have received this message in error please notify the Melton City Council.
***

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Joining polylines with overlapping points to 1 polyline with merged points

2017-06-14 Thread Martin Bain
Hi Jens,
I guess there is more than one way to combine your lines into a single object – 
you could end up with a multipart object (multilinestring) or a single polyline.

Have you tried the Dissolve command?  I quick test for me produced a single 
polyline with no duplicate points from two separate lines.
Cheers,
Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Jens 
Verwaerde | Natuurpunt CVN
Sent: Tuesday, 13 June 2017 11:49 PM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Joining polylines with overlapping points to 1 polyline 
with merged points

I have a walking route, that I've digitized in 18 polylines, of which the 
endpoint is the exact same location as the beginning point of the next polyline.

When I merge these 18 polylines, the overlapping points stay, unfortunately, 
overlapping points. Visually there's no problem: they behave as 1 polyline, but 
... this causes all sorts of problems:
-- exporting to gpx gives faulty routes
-- combining these polylines to a polygon gives polygon rubbish
-- double (or even more) points stay, although I want them to be joined to one 
point
-- tracing always stops when I reach the end or beginning of a polyline part

How can this be solved?

The only thing that actually worked for me is to make a new layer/shapefile 
("traced.shp") and then manually trace the polylines (using the autotrace). In 
Mapinfo this operation is way much more efficient.


So I'm looking for a way to make 1 polyline with non-overlapping points out of 
a series of polylines in Qgis.



Jens Verwaerde


[http://www.natuurpunt.be/sites/default/files/images/inline/logohandtekening.png]


Website: http://cvn.natuurpunt.be



This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Selecting displaced symbols

2017-05-31 Thread Martin Bain
My mum always said I had an overactive imagination  :P  

-Original Message-
From: Nyall Dawson [mailto:nyall.daw...@gmail.com] 
Sent: Thursday, 1 June 2017 9:38 AM
To: Martin Bain <martin.b...@lismore.nsw.gov.au>
Cc: Neumann, Andreas <a.neum...@carto.net>; qgis-user 
<qgis-user@lists.osgeo.org>
Subject: Re: [Qgis-user] Selecting displaced symbols

On 1 June 2017 at 09:26, Martin Bain <martin.b...@lismore.nsw.gov.au> wrote:
> Cool!  Maybe I didn't imagine it after all.

No - you did ;) That commit isn't merged into master, it's sitting orphaned and 
alone and rotting away along with a bunch of other abandoned experiments...

Nyall

>
> -Original Message-
> From: Nyall Dawson [mailto:nyall.daw...@gmail.com]
> Sent: Thursday, 1 June 2017 9:21 AM
> To: Neumann, Andreas <a.neum...@carto.net>
> Cc: Martin Bain <martin.b...@lismore.nsw.gov.au>; qgis-user 
> <qgis-user@lists.osgeo.org>
> Subject: Re: [Qgis-user] Selecting displaced symbols
>
> On 30 May 2017 at 19:11, Neumann, Andreas <a.neum...@carto.net> wrote:
>> Hi Martin,
>>
>> As far as I know, picking is totally independent of the rendering. So 
>> the "Info tool" doesn't know about the displacement renderer. I know 
>> it is not ideal, but it is a technical limitation and there are no known 
>> workarounds.
>
> Well - there's this half finished commit I wrote but never merged:
> https://github.com/nyalldawson/QGIS/commit/2405c9cc2c9d07bd0975d60ce36
> db5c5e8d8b612
>
> I can't remember exactly why I didn't complete this. I think it was written 
> during feature freeze once and I never got around to verifying that it didn't 
> cause regressions in the rendering speed after freeze was lifted. From memory 
> it worked well for info tool and rotate point symbol tool.
>
> From the commit message:
>
> "Register rendered point features into a spatial index so that we can later 
> retrieve features by their actual rendered location.
> (The rendered location may be different in numerous circumstances, eg when 
> using the displacement renderer, or when marker symbols have an offset set) 
> This index could then be used to later retrieve the features for a specific 
> canvas coordinate, for use eg in identify tool, rotate point symbols, etc."
>
> Theoretically this could be cleaned up, finished off and tested, and then 
> later extended to apply to selections also.
>
> Nyall
>
> This email is intended for the named recipient only.  The information it 
> contains may be confidential.  If you are not the intended recipient you must 
> not reproduce or distribute any part of this email, disclose its contents to 
> any other party or take any action in reliance on it.  If you have received 
> this email in error, please contact the sender immediately and delete the 
> message.

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Selecting displaced symbols

2017-05-31 Thread Martin Bain
Cool!  Maybe I didn't imagine it after all.

-Original Message-
From: Nyall Dawson [mailto:nyall.daw...@gmail.com] 
Sent: Thursday, 1 June 2017 9:21 AM
To: Neumann, Andreas <a.neum...@carto.net>
Cc: Martin Bain <martin.b...@lismore.nsw.gov.au>; qgis-user 
<qgis-user@lists.osgeo.org>
Subject: Re: [Qgis-user] Selecting displaced symbols

On 30 May 2017 at 19:11, Neumann, Andreas <a.neum...@carto.net> wrote:
> Hi Martin,
>
> As far as I know, picking is totally independent of the rendering. So 
> the "Info tool" doesn't know about the displacement renderer. I know 
> it is not ideal, but it is a technical limitation and there are no known 
> workarounds.

Well - there's this half finished commit I wrote but never merged:
https://github.com/nyalldawson/QGIS/commit/2405c9cc2c9d07bd0975d60ce36db5c5e8d8b612

I can't remember exactly why I didn't complete this. I think it was written 
during feature freeze once and I never got around to verifying that it didn't 
cause regressions in the rendering speed after freeze was lifted. From memory 
it worked well for info tool and rotate point symbol tool.

From the commit message:

"Register rendered point features into a spatial index so that we can later 
retrieve features by their actual rendered location.
(The rendered location may be different in numerous circumstances, eg when 
using the displacement renderer, or when marker symbols have an offset set) 
This index could then be used to later retrieve the features for a specific 
canvas coordinate, for use eg in identify tool, rotate point symbols, etc."

Theoretically this could be cleaned up, finished off and tested, and then later 
extended to apply to selections also.

Nyall

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Snapping: Move Features vs Node Tool

2017-05-31 Thread Martin Bain
Hi Randy,

I've come to accept that's just the way it is.  It would be nice if the move 
tool did snapping.  I guess it might be tricky to implement - with the node 
tool the cursor position and node being moved are one and the same, but with 
the move tool that’s not always the case.

As an aside are you using the wonderful CAD Node Tool plugin, 
https://github.com/qgis/QGIS-Enhancement-Proposals/issues/69 ?  The built node 
tool became quite sluggish for me after QGIS 2.8 for some reason.  The plugin 
is much more fluid and the best thing is it does topological editing across 
layers.  Its not perfect though - you can't select a sequence of nodes and move 
them at the same time.

Cheers,
Martin.


-Original Message-
From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Randal 
Hale
Sent: Tuesday, 30 May 2017 11:53 PM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Snapping: Move Features vs Node Tool

A question. 

In an attempt to help a client I'm doing some data cleanup - which is good. I 
spend too much time talking and not enough doing. I need to snap points to the 
endpoints of lines. If I set snapping up and use the move features tool the 
point doesn't snap to the line. If I move the point using the node tool the 
point snaps to the line. 

I've been looking for an option or something to change. I'm not seeing one. Is 
this expected behavior? To me it would make more sense for both tools to snap 
data - but I may be missing something. If I add data, the data snaps as I would 
expect it. The good people I'm helping immediately started moving data and it 
didn't snap - and I've instructed them to use the node tool to make the edits. 

QGIS 2.18.9 - Linux

Thanks
Randy


--
Randal Hale
rjh...@northrivergeographic.com
https://www.northrivergeographic.com
(423) 653-3611
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Selecting displaced symbols

2017-05-31 Thread Martin Bain
Thanks for the discussion gentlemen.

I too think your idea is a good one Karl_Magnus.  Andreas, thanks for your 
suggestion with the info tool.  I set the mode to “Top Down stop at first” long 
ago and hadn’t changed it since.  Layer Choice works well in this situation and 
I didn’t realise the individual symbols are highlighted as you hover over the 
list.

Cheers,
Martin.


From: Neumann, Andreas [mailto:a.neum...@carto.net]
Sent: Tuesday, 30 May 2017 9:40 PM
To: Karl Magnus Jönsson <karl-magnus.jons...@kristianstad.se>
Cc: Martin Bain <martin.b...@lismore.nsw.gov.au>; qgis-user@lists.osgeo.org
Subject: Re: SV: [Qgis-user] Selecting displaced symbols


Hi Karl-Magnus,

I think this is a good idea. It could either be a separate selection mode (we 
already have different modes for selection on the drop-down button) or it could 
be toggled with a keyboard combination on the existing "click" mode. Can you 
open a feature request at https://issues.qgis.org/<http://issues.qgis.org/> ?

Greetings,

Andreas

On 2017-05-30 12:00, Karl Magnus Jönsson wrote:
Hi!
When talking about this. I've had a thought of improvement of the select tool. 
When there is several features in the same (or almost the same) location in one 
layer it is difficult to select one particular feature. Could we have the same 
functionality with select tool as with identify? Right click gets you a 
pull-down menu with potential features and you can select one from the list 
that gets selected. Understandable? Has this already been thought of? A 
workaround is to use the identify tool with right click. At the bottom of the 
list you can open the attribute table and select the desired features from the 
table. Works but one step more.

Karl-Magnus

Från: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] För Neumann, Andreas
Skickat: den 30 maj 2017 11:11
Till: Martin Bain
Kopia: qgis-user@lists.osgeo.org<mailto:qgis-user@lists.osgeo.org>
Ämne: Re: [Qgis-user] Selecting displaced symbols


Hi Martin,

As far as I know, picking is totally independent of the rendering. So the "Info 
tool" doesn't know about the displacement renderer. I know it is not ideal, but 
it is a technical limitation and there are no known workarounds.

You can, however, display the central point (with a separate symbol) so the 
user knows where to pick. Also, you can easily access each individual point by 
changing the identify mode to "Layer choice" - where you get a pull-down menu 
and you can identify each individual point by its "display attribute".

Maybe a dev knows a solution to this problem - but currently I think there are 
no known workarounds.

Andreas

On 2017-05-30 03:39, Martin Bain wrote:
Hi,
I have the familiar situation of a layer with multiple points at the same 
coordinates.  The points have data defined SVG symbols

I'm using the Point Displacement renderer to overcome having overlapping 
symbols.  This definitely makes for an improved appearance.

However if you want to use the info tool or the select tool you cant click on 
the displaced symbol.  You can only select all points via the central point.

Is there a trick to select a point by its offset symbol instead of the true 
coordinates?  I have half a memory of reading something about this once before 
but maybe I imagined it :P

I would prefer to leave the points in their original position – the data is of 
traffic accidents, provided by the state government.

Thank you,
Martin.

This email is intended for the named recipient only. The information it 
contains may be confidential. If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it. If you have received this 
email in error, please contact the sender immediately and delete the message.


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org<mailto:Qgis-user@lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user







This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Selecting displaced symbols

2017-05-29 Thread Martin Bain
Hi,
I have the familiar situation of a layer with multiple points at the same 
coordinates.  The points have data defined SVG symbols

I'm using the Point Displacement renderer to overcome having overlapping 
symbols.  This definitely makes for an improved appearance.

However if you want to use the info tool or the select tool you cant click on 
the displaced symbol.  You can only select all points via the central point.

Is there a trick to select a point by its offset symbol instead of the true 
coordinates?  I have half a memory of reading something about this once before 
but maybe I imagined it :P

I would prefer to leave the points in their original position - the data is of 
traffic accidents, provided by the state government.

Thank you,
Martin.

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Creating Excel from processing toolbox

2017-04-26 Thread Martin Bain
Hi Pat,
Not sure if this is what you are looking for, but the processing toolbox 
contains the OGR Convert format algorithm.  The output formats include CSV and 
XLSX.
Cheers,
Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
ph...@gmx.de
Sent: Wednesday, 26 April 2017 6:24 PM
To: QGIS User List 
Subject: [Qgis-user] Creating Excel from processing toolbox

Hello

i am writing an own script for processing toolbox and would like
to write my final data to an Excel sheet.

There are several libraries outside for Python to do that but from
your point of view what is the best for?
Or is there already on in QGIS i am not aware of? I refer to an
Excel library to use within of Python.
QGIS itself has it already as i know

thank you

pat


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Number of vertices

2017-04-23 Thread Martin Bain
Hi Anke,
The asPolyline() function of a geometry returns a list of points.  You can then 
simply get the length of the list:


lyr=iface.activeLayer()
sel=lyr.selectedFeatures()
obj=sel[0].geometry()
verts=obj.asPolyline()
print verts
[(526002,6.81305e+06), (526011,6.81309e+06), (526016,6.81311e+06)]

print len(verts)
3

Cheers,
Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Anke 
zur Gölden
Sent: Sunday, 23 April 2017 4:39 PM
To: QGIS User List 
Subject: [Qgis-user] Number of vertices

Good morning

is there a way to get the number of vertices for a Polyline?
I am looking for the python method to get if possible

thx
Anke


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Bug copying features

2017-04-20 Thread Martin Bain
Hi Reginald,
I experience this regularly, I'm yet to work out what causes it to happen.  I 
have not raised an issue because I'm still not able to reproduce it.  Most 
times I see it happen is right at the start of a session - restarting QGIS 
generally fixes it, but sometimes it starts to happen after many successful 
copy pastes.

By chance did you see my post from a few weeks ago: "Last Y coordinate 
sometimes dropped on pasted geometries"?  Usually when I get the pasted NULL 
values I also experience the last Y coordinate turning to zero.

Most of my layers are MS SQL spatial. I'm using 2.18.4 on Win 7 32 bit

I haven't identified the use of any particular action or plugin that triggers 
the problem.  I thought it may be some contention for the clipboard, if I have 
excel open I usually see that message in excel about being unable to clear the 
clipboard because another app is using it.  But I've now had it happen when 
excel is not running.

I've always had to restart QGIS once the problem begins. However just yesterday 
I started to get the pasted NULLs, I clicked a few different parts of the QGIS 
interface - menus, changed the active layer, etc, then hit Control-C a few more 
times, switched layers and pasted successfully!  That was a first, no restart 
required.  I have a heavy editing session coming up, so I'll see what happens 
today.

Regards,
Martin.

-Original Message-
From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Richard 
Duivenvoorde
Sent: Thursday, 20 April 2017 10:42 PM
To: Reginald Carlier ; 
'qgis-user@lists.osgeo.org' 
Subject: Re: [Qgis-user] Bug copying features

On 20-04-17 09:26, Reginald Carlier wrote:
> Hello,
> 
>  
> 
> I am using QGIS 2.18.6 on Windows 7 (OSGEO).
> 
> I am encountering a bug everytime I want to copy features from one 
> layer to another. Some fields of layer 1 are the same in layer 2.
> 
> As I add the layers to the project, I then set the two layers editable.
> Then I open the attribute table of layer 1 and select all the features.
> Then I copy all the features. Then I select layer2 and I paste all the 
> features. As a result the features are copied to layer 2 but in the 
> attribute table I can only see null values.
> 
> The solution for this problem is to save the project and reopen the 
> project and then do the steps mentioned here above again. Then the 
> features are copied in a correct way.

Hi Reginald,

I tried to reproduce your problem here with 2.18.6 (on Debian though).
And I cannot reproduce it. I:

- opened a dataset and saved it as a 2nd shape
- removed all features from the 2nd shape (to have a shape with exact the same 
attributes)
- openend both shapes in QGIS
- copied one feature from 1 to 2
- stopped editing of both layers
- note: still not a saved project
- and see the right features in 2...

So question: is your second dataset maybe ANOTHER shape with a subset of the 
attributes of the first one?

Anyway, this looks like an issue, feel free to create an issue for it, BUT make 
it as reproducable as possible: add small datasets to it.
Because as you can see it's not easy to reproduce apparently :-(

Regards,

Richard Duivenvoorde

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Detecting node valences

2017-04-12 Thread Martin Bain
Pat,
Too much time on my hands today.  Here’s a more accessible way to get much the 
same result. It takes three QGIS algorithms from the processing toolbox:
1. Extract nodes.
2. Join attributes by location.  (join the layer from step 1 to itself, for the 
“Attribute Summary” choose “Take Summary of Intersecting Features” – this will 
add a “Count” [valence] column to the resulting table )
3. Delete duplicate geometries.

Should also pick up where lines meet each other at any node, not just the first 
or last node.  Step 2 has a tolerance option which might be useful if your 
lines aren’t perfectly snapped together.

Martin.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Martin 
Bain
Sent: Thursday, 13 April 2017 12:45 PM
To: 'ph...@gmx.de' <ph...@gmx.de>; QGIS User List <qgis-user@lists.osgeo.org>
Subject: Re: [Qgis-user] Detecting node valences

Hi Pat,
I saw your previous question went unanswered.  I’m not familiar with the term 
valence, I’m guessing you want the number of lines that meet at a point.  If 
you had like a roads layer then three streets would meet at a T intersection – 
the node would have a valence of three, for a cross intersection the valence 
would be four.

I’ll start the ball rolling by offering a possible solution, then maybe some 
bigger brained folks might give a better way of doing it.

There’s probably a sequence of steps you could do to get your end result, maybe 
something in the processing toolbox?  Being a bit of a database guy, I reached 
for the DB Manager and came up with the SQL below which can be loaded as a 
point layer.  THIS QUERY ASSUMES YOUR LINES ONLY MEET AT THE ENDS, IF ONE LINE 
INTERSECTS ANOTHER IN THE MIDDLE IT WONT BE COUNTED.

The inner select statement returns a set of points. It is a UNION query of two 
parts, the first part selects each line’s start point and its X and Y 
coordinates and the second part does the same for the end point of each line.

The outer select statement groups the matching points together and gives a 
count.  The last line in the query “HAVING VALENCE>2”  filters out any results 
with a valence less than three, you can adjust the number for your needs or 
leave it out altogether and filter the rows in QGIS.

Cheers,
Martin.

SELECT GEOMX,GEOMY, GEOM, COUNT(*) AS VALENCE
FROM
(
SELECT "LCC_WATER_PIPES"."Namecompon",
"LCC_WATER_PIPES"."MI_PRINX",start_point(
"LCC_WATER_PIPES"."geometry") AS GEOM ,
X(start_point("LCC_WATER_PIPES"."geometry")) AS GEOMX,
Y(start_point("LCC_WATER_PIPES"."geometry")) AS GEOMY
FROM "LCC_WATER_PIPES"
UNION
SELECT "LCC_WATER_PIPES"."Namecompon",
"LCC_WATER_PIPES"."MI_PRINX",end_point(
"LCC_WATER_PIPES"."geometry") AS GEOM ,
X(end_point("LCC_WATER_PIPES"."geometry")) AS GEOMX,
Y(end_point("LCC_WATER_PIPES"."geometry")) AS GEOMY
FROM "LCC_WATER_PIPES"
)
GROUP BY GEOMX, GEOMY, GEOM
HAVING VALENCE>2




select A.MI_PRINX,B.MI_PRINX ,intersectION(A.geometry,B.geometry) AS GEOM
from LCC_WATER_PIPES as A, LCC_WATER_PIPES as B
WHERE A.MI_PRINX<>B.MI_PRINX
AND intersects(A.geometry,B.geometry)=1

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
ph...@gmx.de<mailto:ph...@gmx.de>
Sent: Wednesday, 12 April 2017 11:03 PM
To: QGIS User List <qgis-user@lists.osgeo.org<mailto:qgis-user@lists.osgeo.org>>
Subject: [Qgis-user] Detecting node valences

Hello to all,

is there a way i QGIS to run a select over a map to get
all the nodes with a specific node valence?

If not i would be happy about a shortchanged reply too :)

thanks
pat


This email is intended for the named recipient only. The information it 
contains may be confidential. If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it. If you have received this 
email in error, please contact the sender immediately and delete the message.

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Detecting node valences

2017-04-12 Thread Martin Bain
Hi Pat,
I saw your previous question went unanswered.  I’m not familiar with the term 
valence, I’m guessing you want the number of lines that meet at a point.  If 
you had like a roads layer then three streets would meet at a T intersection – 
the node would have a valence of three, for a cross intersection the valence 
would be four.

I’ll start the ball rolling by offering a possible solution, then maybe some 
bigger brained folks might give a better way of doing it.

There’s probably a sequence of steps you could do to get your end result, maybe 
something in the processing toolbox?  Being a bit of a database guy, I reached 
for the DB Manager and came up with the SQL below which can be loaded as a 
point layer.  THIS QUERY ASSUMES YOUR LINES ONLY MEET AT THE ENDS, IF ONE LINE 
INTERSECTS ANOTHER IN THE MIDDLE IT WONT BE COUNTED.

The inner select statement returns a set of points. It is a UNION query of two 
parts, the first part selects each line’s start point and its X and Y 
coordinates and the second part does the same for the end point of each line.

The outer select statement groups the matching points together and gives a 
count.  The last line in the query “HAVING VALENCE>2”  filters out any results 
with a valence less than three, you can adjust the number for your needs or 
leave it out altogether and filter the rows in QGIS.

Cheers,
Martin.

SELECT GEOMX,GEOMY, GEOM, COUNT(*) AS VALENCE
FROM
(
SELECT "LCC_WATER_PIPES"."Namecompon",
"LCC_WATER_PIPES"."MI_PRINX",start_point(
"LCC_WATER_PIPES"."geometry") AS GEOM ,
X(start_point("LCC_WATER_PIPES"."geometry")) AS GEOMX,
Y(start_point("LCC_WATER_PIPES"."geometry")) AS GEOMY
FROM "LCC_WATER_PIPES"
UNION
SELECT "LCC_WATER_PIPES"."Namecompon",
"LCC_WATER_PIPES"."MI_PRINX",end_point(
"LCC_WATER_PIPES"."geometry") AS GEOM ,
X(end_point("LCC_WATER_PIPES"."geometry")) AS GEOMX,
Y(end_point("LCC_WATER_PIPES"."geometry")) AS GEOMY
FROM "LCC_WATER_PIPES"
)
GROUP BY GEOMX, GEOMY, GEOM
HAVING VALENCE>2




select A.MI_PRINX,B.MI_PRINX ,intersectION(A.geometry,B.geometry) AS GEOM
from LCC_WATER_PIPES as A, LCC_WATER_PIPES as B
WHERE A.MI_PRINX<>B.MI_PRINX
AND intersects(A.geometry,B.geometry)=1

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
ph...@gmx.de
Sent: Wednesday, 12 April 2017 11:03 PM
To: QGIS User List 
Subject: [Qgis-user] Detecting node valences

Hello to all,

is there a way i QGIS to run a select over a map to get
all the nodes with a specific node valence?

If not i would be happy about a shortchanged reply too :)

thanks
pat


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS custom feature forms with python logic - passed in feature

2017-03-27 Thread Martin Bain
Hi Jen,
Its funny, I happened to be playing around with the same sample code from 
NathanW when I saw your post.  I meant to reply earlier but got distracted.  I 
was able to change an attribute of the passed in feature with the modified 
sample below.  (In my case I was curious about dynamically adding controls to 
the form at runtime and getting them to display attribute data.  The upshot of 
that was the data in the dynamically added control was not automatically saved 
(which is understandable), I needed to add code in the validate() routine to 
write the data.


from PyQt4.QtCore import *
from PyQt4.QtGui import *

nameField = None
myDialog = None

def formOpen(dialog,layerid,featureid):
global myDialog
myDialog = dialog
global nameField

#store a reference to the selected layer
global lyr
lyr=layerid

#store a reference to the selected feature
global fid
fid=featureid

buttonBox = dialog.findChild(QDialogButtonBox,"buttonBox")

# Disconnect the signal that QGIS has wired up for the dialog to the button 
box.
buttonBox.accepted.disconnect(myDialog.accept)

# Wire up our own signals.
buttonBox.accepted.connect(validate)
buttonBox.rejected.connect(myDialog.reject)

#dynamically add a control to the form at runtime and populate with the 
value of the "Road_Name" field
nameField = QtGui.QLineEdit(myDialog)
nameField.setObjectName("Road_Name")
myDialog.layout().addWidget(nameField)
nameField.show()
nameField.setText(featureid["Road_Name"])

def validate():
  # Make sure that the name field isn't empty.
if not len(nameField.text()) > 0:
msgBox = QMessageBox()
msgBox.setText("Name field can not be null.")
msgBox.exec_()
else:
# Return the form as accpeted to QGIS.
myDialog.accept()

#update the value of the "Road_Name" field for the selected feature
fid["Road_Name"]=nameField.text()
lyr.updateFeature(fid)

#Call commit to save the changes
#layer.commitChanges()



From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Jen 
Swiger
Sent: Thursday, 16 March 2017 8:00 AM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] QGIS custom feature forms with python logic - passed in 
feature

Hello,
I hope I am asking this question in the right email list. I may ask in the qgis 
stack exchange as well.
I am working off this example 
https://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/
 and adjusting to meet my needs.
When the formOpen function is called, the dialog, layer, and feature is passed 
in.
I want to edit the feature that is passed in but code like
mylayer.changeAttribute(myfeature.id(), 10, 1)
doesn't seem to be working because myfeature.id() returns 
0.
What code should I be using instead to edit a field in the feature?
Thanks!
Jen

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Last Y coordinate sometimes dropped on pasted geometries

2017-03-15 Thread Martin Bain
Hi group,
I have an intermittent problem, sometimes when I copy and paste a geometry the 
last Y coordinate of the pasted geometry is lost and replaced by zero.

I have seen it happen with points and polylines.  When pasting multiple objects 
the last Y coordinate of the each geometry is lost.  It can happen when pasting 
within one layer, between layers or into a new scratch layer.

All layers and the project have the same CRS (EPSG:28356).

Once it starts happening QGIS needs a restart.

Has anybody else experienced this?  Any ideas of the cause, or a fix other than 
a restart?

Using 2.18.4 on Win 7 32 bit.

Thanks,
Martin.

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] select by radius [v2.18.4, possible bug]

2017-03-12 Thread Martin Bain
Hi Tobias,
Its working for me on 2.18.4 32 bit Win 7.  Select by radius creates a new 
selection, with the shift key it adds to existing selection, control key 
removes from selection, alt key changes to select only objects fully within 
radius.
Cheers,
Martin.

-Original Message-
From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Tobias 
Wendorff
Sent: Monday, 13 March 2017 3:00 AM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] select by radius [v2.18.4, possible bug]

Hi there!

Before writing a bug-report, could anyone please verify that "select by radius" 
isn't working?

Right now, it deselects an existing selection only, but doesn't select any new 
items. All other selection types seem to work.

Best regards,
Tobias

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Field Calculator behavior

2017-03-01 Thread Martin Bain
+ 1  See Feature request #15971:

https://hub.qgis.org/issues/15971

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Carlos 
Cerdán
Sent: Wednesday, 1 March 2017 11:38 PM
To: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Field Calculator behavior

+1

Yes! it would be pretty handy

2017-03-01 5:52 GMT-05:00 Andreas Wicht 
>:
Hi,

the current default behavior of the field calculator is that once it
finishes a calculation it closes.
Is there a possibility to prevent this from happening and keep it open?
That is particularly useful when several columns need to be updated.

If there is no such option currently available, would it be feasible
to introduce a checkbox "keep open" to the field calculator?

Cheers
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] qgis 2.18.3 not installing on win 10

2017-02-26 Thread Martin Bain
Is there any chance it's the 32 bit OSGEO4W running on a 64 bit Windows?

I got a similar error trying to run a portable install on USB of 2.18, 32 bit 
on 64 bit Win 7 (2.14 ran just fine)

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
Michael.Dodd
Sent: Monday, 27 February 2017 9:01 AM
To: Andre Joost ; qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] qgis 2.18.3 not installing on win 10


I tried uninstalling and installing again using the stand alone installer.  
This gave the same error so I uninstalled it.



Then I tried the OSGEO4W installer but it did not install exactly where I asked 
it to, instead it made its own directory on Y (Y:\osgeo_download). It did start 
up once but after that it failed to start and instead gave the same error about 
missing .dll's even though they were present.  I think I had a problem similar 
to this several qgis versions ago but it was then resolved, now the issue seems 
to be back.



This is the \QGIS 2.18\bin\qgis.bat file:


@echo off
call "%~dp0\o4w_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis
set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=100
set 
QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
start "QGIS" /B "%OSGEO4W_ROOT%"\bin\qgis-bin.exe %*

and this is the directory where the relevant .dll's are 
Y:\osgeo_download\apps\qgis\bin
but it says they are missing even though they are present in this directory.


From: Qgis-user 
> 
on behalf of Andre Joost 
>
Sent: 26 February 2017 16:23:38
To: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] qgis 2.18.3 not installing on win 10

Am 25.02.2017 um 21:58 schrieb Michael.Dodd:
> Have been using qgis for years.  Just uninstalled 2.14 and installed
> 2.18.3 but it refused to start saying that qgis_app.dll,
> qgis_core.dll and qgis_gui.dll are all missing.
>
>
> Infact they are not missing, they are all present.  However it seems
> to be looking in the wrong place, think similar problem has occurred
> with one or two previous versions.  I am NOT installing on c: drive
> as it has little space but instead installing on y: drive.  This
> worked fine for version 2.14 and various other programs but with
> version 2.18.3 it does not work.
>
>

You could try the OSGEO4W installer. It lets you choose the root
directory where everything is installed to.

Or have a look at \QGIS 2.18\bin\qgis.bat and o4w_env.bat. The variable
OSGEO4W_ROOT might be set wrongly. You get it when you type set inside
the OSGEO4W Shell. Override the definition if necessary.

HTH
André Joost

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS Crash Message

2016-08-07 Thread Martin Bain
I finally fixed my crash on every exit of QGIS 2.16.

Since my previous post my PC was replaced and I tried a fresh install of 2.16.1 
but still got the crash every exit.

I ended up deleting the HKEY_CURRENT_USER\Software\QGIS branch from the 
registry.

Even though it was a fresh install of QGIS I think my user profile meant the 
old registry values followed me to my new computer.  This fixed the issue but 
was a bit heavy handed as I lost a lot of customs settings.  I exported the 
branch from the registry before I deleted it.  Merging it back into the 
registry caused the problem to reappear.  I tried deleting a few of the more 
complex looking sub branches but didn't find the registry value causing the 
crash.  Finally I deleted the whole HKEY_CURRENT_USER\Software\QGIS branch 
again, then started QGIS and with GIS running I merged the branch back  into 
the registry, I then exited QGIS without getting a crash!  I no longer get a 
crash on exit and I retained almost all of my settings - active plugins, 
recently used paths, expressions etc.  I lost a couple of thing that must be 
saved on exit such as the layout of the layers panel and the browser panel, but 
all good.

Cheers,
Martin

From: Martin Bain
Sent: Friday, 22 July 2016 9:01 AM
To: qgis-user@lists.osgeo.org
Subject: RE: [Qgis-user] QGIS Crash Message

I also get a crash every time exiting 2.16.  (On Windows 7 32 bit, OSGeo 
installer).

I deleted the .qgis2 folder from C:\Users\ but still got a crash on 
every exit, also tried running the OSGeo installer and selecting "Reinstall" 
for every item, currently using 2.14.3

Nice to know (sort of) that I'm not the only one.

Cheers,
Martin

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Grant 
Boxer
Sent: Thursday, 21 July 2016 5:40 PM
To: qgis-user@lists.osgeo.org<mailto:qgis-user@lists.osgeo.org>
Subject: [Qgis-user] QGIS Crash Message

Why do I get a crash - mini-dump message when exiting QGIS 2.16?
[cid:image001.png@01D1F16B.067D88A0]

Grant Boxer
Perth, Western Australia


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS Crash Message

2016-07-21 Thread Martin Bain
I also get a crash every time exiting 2.16.  (On Windows 7 32 bit, OSGeo 
installer).

I deleted the .qgis2 folder from C:\Users\ but still got a crash on 
every exit, also tried running the OSGeo installer and selecting "Reinstall" 
for every item, currently using 2.14.3

Nice to know (sort of) that I'm not the only one.

Cheers,
Martin

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Grant 
Boxer
Sent: Thursday, 21 July 2016 5:40 PM
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] QGIS Crash Message

Why do I get a crash - mini-dump message when exiting QGIS 2.16?
[cid:image001.png@01D1E3F7.4CCAEE50]

Grant Boxer
Perth, Western Australia


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS 2.14 with MS SQL Server

2016-03-03 Thread Martin Bain
Thank you for the info Nyall.

From: Nyall Dawson [mailto:nyall.daw...@gmail.com]
Sent: Friday, 4 March 2016 12:08 PM
To: Martin Bain <martin.b...@lismore.nsw.gov.au>
Cc: qgis-user <qgis-user@lists.osgeo.org>
Subject: Re: [Qgis-user] QGIS 2.14 with MS SQL Server


On 4 Mar 2016 11:58 AM, "Martin Bain" 
<martin.b...@lismore.nsw.gov.au<mailto:martin.b...@lismore.nsw.gov.au>> wrote:
>
> Is anyone using QGIS 2.14 with MS SQL Server?  I just upgraded from 2.12 to 
> 2.14 and encountered some very strange behaviours.

Yes, there was a bug in 2.14. It's been fixed in master and will be included in 
2.14.1 when it's released.

Nyall

>
>
>
> These include: Whole columns of data displaying as NULL in the attribute 
> table (even though there are no nulls in the table in SQL Server).
>
>
>
> And:  Numeric strings in text fields being treated as numbers.  For example I 
> have a text field in a record that contains the string “2.0” (without the 
> inverted commas) but it is being displayed as “2” in the attribute table, the 
> info tool and as a label.  I tried to edit the text by retyping “2.0” but 
> when I tabbed out of the textbox it was converted to “2”. The layer 
> properties show the field type as QString.
>
>
>
> I have only had the chance to test it on one machine so far, so I don’t want 
> generate unnecessary noise posting a bug report if it is just my machine that 
> has a problem.
>
>
>
> So, is anyone here successfully using QGIS 2.14 and SQL Server (2008)?
>
>
>
> Thanks,
>
> Martin.
>
>
> This email is intended for the named recipient only. The information it 
> contains may be confidential. If you are not the intended recipient you must 
> not reproduce or distribute any part of this email, disclose its contents to 
> any other party or take any action in reliance on it. If you have received 
> this email in error, please contact the sender immediately and delete the 
> message.
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org<mailto:Qgis-user@lists.osgeo.org>
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Creating Geometries for tabular data

2015-11-25 Thread Martin Bain
I just had a chance to install master and try out the geometry type override, 
nice.  I see "GeometryCollection" is an option - have I been mistaken in 
thinking QGIS can't work with GeometryCollections?

The "force multi-type" option is a nice feature too - I'm currently struggling 
with a similar issue.
Regards,
Martin.

-Original Message-
From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Nyall 
Dawson
Sent: Tuesday, 24 November 2015 7:32 AM
To: Matthias Kuhn
Cc: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Creating Geometries for tabular data

On 17 November 2015 at 06:59, Matthias Kuhn  wrote:
> I use the process on a postgis DB, but Shapefiles are also capable of 
> having tabular data without geometries attached.
> However I do not know how you would create such a file (easily) from 
> an existing geometry-less layer.
>
> Maybe something like this:
> http://gis.stackexchange.com/questions/327/how-can-i-convert-an-excel-
> file-with-x-y-columns-to-a-shapefile
>
> Or try with adding a dummy geometry column in a csv so it loads as 
> points and then save as shapefile.

Ok, with improvements that just landed in QGIS master (see [1]) this is now 
MUCH easier. Now, you can right click the geometryless table in the legend and 
select "Save as". In the save vector layer dialog there's a new option to 
override the geometry type for the saved file.
So you can choose to save the geometryless table with a Point/Line/Polygon 
geometry, which will obviously all initially be empty. Then, you can select 
features from the attribute table and use the "add part" tool to attach 
geometries to these records.

The new option also lets you force the saved file to be multipart, which is 
also useful in some circumstances.

Nyall

[1] https://github.com/qgis/QGIS/commit/ffebfd9bb719daf1ffa9bf7dde68c6e5892dcb89

>
> Best,
> Matthias
>
>
> On 11/16/2015 03:00 PM, DelazJ wrote:
>
> Hi,
> Matthias, what kind of format can this file be?
> This is not the first time I see MapInfo user asking about this 
> feature. I personnaly had last week to add geometries to features that 
> were in a tabular file (csv) and couldn't find how to do this except 
> giving an unique ID to the table data, and in another shapefile 
> digitizing, filling ID after each drawing and, at the end joining 
> layers. It was possible because there was not so many features but it's 
> unfriendly.
> I thought I could save the csv into shapefile (even empty)  and 
> proceed with the "add part" tool but "saving as" failed.
> It would be nice if we could find a way to address this "issue"...
>
> 2015-11-16 7:22 GMT+01:00 Matthias Kuhn :
>>
>> Hi,
>>
>> IIRC you can use the "add part" tool to create geometries for 
>> existing objects. Just use the attribute table to select the proper 
>> object and then digitize with the add part tool. Of course the 
>> selected layer has to be capable of saving geomtries in the format 
>> you like (i.e. you cannot geometrizise an excel table).
>>
>> Cheers,
>> Matthias
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Convert to Offline Project problems with multi-part geometries

2015-11-25 Thread Martin Bain
The convert to offline project looks like a really quick, simple way to create 
a portable copy of our database layers for disconnected use.

The problem I have is a lot of layers contain some multipart geometries.  In 
this situation the geometry type for the offline table will get set incorrectly 
for single part geometries.  I'm guessing the geometry type is inferred from 
the first record (or maybe the first n records).  When it attempts the copy all 
the rows to the offline table it throws an error when it encounters a multipart 
geometry, causing the whole transaction to be rolled back, resulting in an 
empty offline table.

Can anyone suggest a way I could get this to work?  Or an alternative method to 
quickly cache a lot of database layers locally.  The one-click convert to 
offline is appealing - if only it worked.

Thanks,
Martin.


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Creating Geometries for tabular data

2015-11-23 Thread Martin Bain
Very nice work Nyall!

Thank you very much,
Martin.

-Original Message-
From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Nyall 
Dawson
Sent: Tuesday, 24 November 2015 7:32 AM
To: Matthias Kuhn
Cc: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Creating Geometries for tabular data

On 17 November 2015 at 06:59, Matthias Kuhn  wrote:
> I use the process on a postgis DB, but Shapefiles are also capable of 
> having tabular data without geometries attached.
> However I do not know how you would create such a file (easily) from 
> an existing geometry-less layer.
>
> Maybe something like this:
> http://gis.stackexchange.com/questions/327/how-can-i-convert-an-excel-
> file-with-x-y-columns-to-a-shapefile
>
> Or try with adding a dummy geometry column in a csv so it loads as 
> points and then save as shapefile.

Ok, with improvements that just landed in QGIS master (see [1]) this is now 
MUCH easier. Now, you can right click the geometryless table in the legend and 
select "Save as". In the save vector layer dialog there's a new option to 
override the geometry type for the saved file.
So you can choose to save the geometryless table with a Point/Line/Polygon 
geometry, which will obviously all initially be empty. Then, you can select 
features from the attribute table and use the "add part" tool to attach 
geometries to these records.

The new option also lets you force the saved file to be multipart, which is 
also useful in some circumstances.

Nyall

[1] https://github.com/qgis/QGIS/commit/ffebfd9bb719daf1ffa9bf7dde68c6e5892dcb89

>
> Best,
> Matthias
>
>
> On 11/16/2015 03:00 PM, DelazJ wrote:
>
> Hi,
> Matthias, what kind of format can this file be?
> This is not the first time I see MapInfo user asking about this 
> feature. I personnaly had last week to add geometries to features that 
> were in a tabular file (csv) and couldn't find how to do this except 
> giving an unique ID to the table data, and in another shapefile 
> digitizing, filling ID after each drawing and, at the end joining 
> layers. It was possible because there was not so many features but it's 
> unfriendly.
> I thought I could save the csv into shapefile (even empty)  and 
> proceed with the "add part" tool but "saving as" failed.
> It would be nice if we could find a way to address this "issue"...
>
> 2015-11-16 7:22 GMT+01:00 Matthias Kuhn :
>>
>> Hi,
>>
>> IIRC you can use the "add part" tool to create geometries for 
>> existing objects. Just use the attribute table to select the proper 
>> object and then digitize with the add part tool. Of course the 
>> selected layer has to be capable of saving geomtries in the format 
>> you like (i.e. you cannot geometrizise an excel table).
>>
>> Cheers,
>> Matthias
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Creating Geometries for tabular data

2015-11-16 Thread Martin Bain
I had a bit of play with this last night and came up with this script:

layer = iface.activeLayer()  #active layer should be your CSV file
newname = layer.name() + '_Map'
otype = "Point"  # could be "Polygon" or "LineString"
resultlayer = QgsVectorLayer(otype, newname, "memory")
resultlayer.startEditing()
dp=resultlayer.dataProvider()
dp.addAttributes(list(layer.dataProvider().fields()))
resultlayer.updateFields()
dp.addFeatures(list(layer.dataProvider().getFeatures()))
QgsMapLayerRegistry.instance().addMapLayer(resultlayer)

You can paste the script into the python console editor

If you open a CSV file with no geometry and run the script it will create a 
copy of the CSV in a Memory layer with the specified object type (Point, 
LineString or Polygon)

You can then select individual rows in the attribute table and use the “Add 
Part” tool to digitise them.

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
Matthias Kuhn
Sent: Tuesday, 17 November 2015 6:59 AM
To: DelazJ
Cc: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] Creating Geometries for tabular data

I use the process on a postgis DB, but Shapefiles are also capable of having 
tabular data without geometries attached.
However I do not know how you would create such a file (easily) from an 
existing geometry-less layer.

Maybe something like this:
http://gis.stackexchange.com/questions/327/how-can-i-convert-an-excel-file-with-x-y-columns-to-a-shapefile

Or try with adding a dummy geometry column in a csv so it loads as points and 
then save as shapefile.

Best,
Matthias
On 11/16/2015 03:00 PM, DelazJ wrote:
Hi,
Matthias, what kind of format can this file be?
This is not the first time I see MapInfo user asking about this feature. I 
personnaly had last week to add geometries to features that were in a tabular 
file (csv) and couldn't find how to do this except giving an unique ID to the 
table data, and in another shapefile digitizing, filling ID after each drawing 
and, at the end joining layers. It was possible because there was not so many 
features but it's unfriendly.
I thought I could save the csv into shapefile (even empty)  and proceed with 
the "add part" tool but "saving as" failed.
It would be nice if we could find a way to address this "issue"...

2015-11-16 7:22 GMT+01:00 Matthias Kuhn 
>:
Hi,

IIRC you can use the "add part" tool to create geometries for existing
objects. Just use the attribute table to select the proper object and
then digitize with the add part tool. Of course the selected layer has
to be capable of saving geomtries in the format you like (i.e. you
cannot geometrizise an excel table).

Cheers,
Matthias
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user




--

Matthias Kuhn

OPENGIS.ch - https://www.opengis.ch

Spatial • (Q)GIS • PostGIS • Open Source

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Creating Geometries for tabular data

2015-11-15 Thread Martin Bain
Hi,
I'm after your suggestions for the best work flow for adding spatial data to 
existing tabular data.
Say we have a tabular list of playground equipment - I want to associate a 
point object with each row in the list - so I end up with spatial and attribute 
data in the one table.

I used to do this in MapInfo, you could open a table of purely tabular data, 
select a row in the attribute table, adding a point in the map window would 
create a map object for the selected row (rather than adding a whole new row to 
the table).  I don't think I can do it like that with QGIS - am I right in 
thinking if there is no geometry for a row it will be excluded from the 
attribute table?

How do people do this in QGIS?

Thanks,
Martin.

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] QGIS 2.12 Node editing very laggy with snapping enabled

2015-10-28 Thread Martin Bain
Has anyone else found editing object vertices with the node tool in 2.12 to be 
very laggy?
For me it doesn't update the screen in real time, if I move the node to a new 
location I get no visual feedback until after a couple of seconds when node 
abruptly appears in the new location.  It is smooth when snapping is "off" but 
with the same snapping settings as in 2.10 (all layers, vertex only, no 
topological, no snap on intersection) it is unusably slow.

This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] rivers growing in size as they go downhill

2015-07-15 Thread Martin Bain
Ciao Carlo,
I’m a new QGIS user, I’m intrigued by your last paragraph:

You may also assume some intelligence in the tools you use may provide som 
help. It's more convenient to keep your streams in a network conscious database 
like spatialite instead of storing into shapefiles.

Can you elaborate on the meaning of  “network conscious database” or point me 
to some links to get me started, this sounds like a very useful capability.

Martin.


From: qgis-user-boun...@lists.osgeo.org 
[mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of Carlo A. Bertelli 
(Charta s.r.l.)
Sent: Wednesday, 15 July 2015 4:24 PM
To: qgis-user@lists.osgeo.org
Subject: Re: [Qgis-user] rivers growing in size as they go downhill

Ciao Luca,
if you mean cutting the stream and manually assigning a width to every arc, 
well, it's not the right procedure anyway, but if you deal with a network as a 
network you should allow waterflow grow for other reasons besides going 
downhill. Every node brings affluents so more water becomes a bigger stream. So 
classifying the rank of the network is the proper thing to do. You don't have 
to do it manually, it's a directed planar graph so there are tools to deal with 
it (plugings and processing).
If you look at old cartography, you may argue streams grow gradually and that 
is true, but there are tiny gutters and invisible kennels feeding them...
Yes you may desire to kill all hydrologists, but this is a graph and the 
easiest thing is assuming the size of the stream depends on the rank of the 
starting node.
You may also assume some intelligence in the tools you use may provide som 
help. It's more convenient to keep your streams in a network conscious database 
like spatialite instead of storing into shapefiles.
c

On Tue, 14 Jul 2015 at 22:08:45, 
luca.galupp...@gmail.commailto:luca.galupp...@gmail.com wrote:
Dear all
i have this idea of rendering a river network so that each river starts as
a very thin blue line, and the line width increases little by little as the
river goes.
i wouldn't like to modify the original file (eg cutting rivers in pieces
and give a different width to each piece) but all rivers are digitized with
the right direction so i was wondering if there is an expression to teach
qgis what is the start end of a river, and assign a wider line for any
given distance, for example:
from start to 200m - line width 0.1
from 200m to 400m - line width 0.2
from 400m and over - line width 0.3
i think this is an interesting problem because i cannot find a from - to
command in qgis expression language, neither i know how to properly exploit
the line direction with code, which would come useful in many other ways...
any python expert out there can help?
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.osgeo.org/pipermail/qgis-user/attachments/20150714/53ba1c74/attachment-0001.html



This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] SQL Server Layer - field values not retrieved when using named ODBC DSN

2015-07-06 Thread Martin Bain
Our organisation has just migrated from MapInfo TAB files to MS SQL Server 
Spatial.

I'm using QGIS 2.8.2 to connect with data in a SQL Server 2008 R2 database.

I have noticed unique field values are not retrieved when I create a connection 
using a previously created ODBC DSN.

When I say unique field values are not retrieved  I'm referring to the 
expression builder window, fields and values, where you have the option to load 
all unique values or 10 samples.  The same behaviour is also seen in the 
Attribute Editor form if you set the edit widget for a field to Unique Values 
- the drop down list is empty.

If I create a connection by specifying the Host server name and the Database 
name it works correctly.

We are using integrated windows authentication.

Perhaps QGIS creates a different connection (different driver?) when you 
specify the Host server name and the Database name rather than using a premade 
ODBC connection.

I have three different SQL Server drivers that I can choose from when creating 
an ODBC connection (SQL Server; SQL Server Native Client 10.0; SQL Server 
Native Client 11.0) it didn't make a difference which one I used.

I don't know if this is a bug or just the way it works.  Perhaps the work 
around of not using a named DSN will be helpful to others in some situations.

Cheers,
Martin.


This email is intended for the named recipient only.  The information it 
contains may be confidential.  If you are not the intended recipient you must 
not reproduce or distribute any part of this email, disclose its contents to 
any other party or take any action in reliance on it.  If you have received 
this email in error, please contact the sender immediately and delete the 
message.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user