Re: [Qgis-user] Export Map Information to Google Maps

2021-07-20 Thread C Hamilton
You might try the KML Tools plugin
https://plugins.qgis.org/plugins/kmltools/. For some data it is a little
more robust in its conversions than the default QGIS KML importer /
exporter and it will preserve KML styling when exporting as long as only
simple, graduated, or categorized symbology is used.

Calvin

On Tue, Jul 20, 2021 at 6:16 PM James Cobban 
wrote:

> I run a genealogical web site one feature of which is displaying a Google
> Map on request for a geographical location.  For example
> https://www.jamescobban.net/FamilyTree/Person.php?idir=42118.  Hold the
> mouse over any of the addresses and a popup gives you the option to view a
> Google Map.  I obtained the boundary information from the Ontario
> Ministry of Mines and Resources database 
> in the form of a KML file.  I am now trying to add the county and district
> boundaries but there appears to be a bug in the website which fails
> creating the KML file.  The Ministry is in the process of addressing this
> problem, but meanwhile I tried downloading the Geodatabase and opening it
> with QGIS.  This works, and displays the overview map of the database, but
> I cannot see any option to export the information as a set of polygons that
> I can pass to Google Maps.  How do I export to KML or any other file format
> that I already understand.
>
> --
> James Cobban
> 911-500 Springbank Dr
> London, ON, Canada
> N6J 4G6
> mailto: webmas...@jamescobban.net
> +1-226-504-7603
>
> ___
> 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 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] Symbology using an expression to find a field with known suffix

2021-07-20 Thread Andrew Hughes
Hi All,

Any help would be much appreciated,  sorry for just throwing this out
there... QGIS is very new to me.

I have lots of tables that I would like to apply common symbology and best
I explain with an example:

table_a.foo_blah
table_b.boo_blah
table_c.whatever_blah
table_d.i_cant_believe_its_not_butter_blah

Q: What would the expression be to find the field ending with "_blah" and
use/return that fields value (as the symbology's categorical value)? I will
never know what the field is called, just that it always ends in _blah.

Big thanks in advance,
Andrew
___
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] Export Map Information to Google Maps

2021-07-20 Thread Nicolas Cadieux

Hi,

Select the layer in the layer panel, right click, export, change the 
format to KML. You can select the symbology to export in the file.  If 
you need more control, use Processing/Gdal/Vector Conversion/Convert format.


Nicolas


On 2021-07-20 5:46 p.m., James Cobban wrote:


I run a genealogical web site one feature of which is displaying a 
Google Map on request for a geographical location. For example 
https://www.jamescobban.net/FamilyTree/Person.php?idir=42118 
. Hold 
the mouse over any of the addresses and a popup gives you the option 
to view a Google Map.  I obtained the boundary information from the 
Ontario Ministry of Mines and Resources database 
 in the form of a KML file.  I am now 
trying to add the county and district boundaries but there appears to 
be a bug in the website which fails creating the KML file.  The 
Ministry is in the process of addressing this problem, but meanwhile I 
tried downloading the Geodatabase and opening it with QGIS.  This 
works, and displays the overview map of the database, but I cannot see 
any option to export the information as a set of polygons that I can 
pass to Google Maps.  How do I export to KML or any other file format 
that I already understand.


--
James Cobban
911-500 Springbank Dr
London, ON, Canada
N6J 4G6
mailto:webmas...@jamescobban.net
+1-226-504-7603

___
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


--
Nicolas Cadieux
https://gitlab.com/njacadieux

___
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] Export Map Information to Google Maps

2021-07-20 Thread James Cobban
I run a genealogical web site one feature of which is displaying a 
Google Map on request for a geographical location.  For example 
https://www.jamescobban.net/FamilyTree/Person.php?idir=42118 
. Hold the 
mouse over any of the addresses and a popup gives you the option to view 
a Google Map.  I obtained the boundary information from the Ontario 
Ministry of Mines and Resources database  
in the form of a KML file.  I am now trying to add the county and 
district boundaries but there appears to be a bug in the website which 
fails creating the KML file.  The Ministry is in the process of 
addressing this problem, but meanwhile I tried downloading the 
Geodatabase and opening it with QGIS.  This works, and displays the 
overview map of the database, but I cannot see any option to export the 
information as a set of polygons that I can pass to Google Maps.  How do 
I export to KML or any other file format that I already understand.


--
James Cobban
911-500 Springbank Dr
London, ON, Canada
N6J 4G6
mailto: webmas...@jamescobban.net
+1-226-504-7603

___
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] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Nicolas Cadieux
Hi,

I see where this is going.  Good idea. I will think more like a python 
programmer here.  I will test and report back.  It may take a few days as I 
will simplify the model first and break it down. I might take you up on your 
offer for help and share the model and a test file. 
Thanks!

Nicolas Cadieux
https://gitlab.com/njacadieux

> Le 20 juill. 2021 à 05:53, Charles Dixon-Paver  a écrit :
> 
> to_string
___
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] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Charles Dixon-Paver
Hi Nicholas,

I haven't had time to dig into this extensively or encountered this
particular issue, but I would suggest trying to "force" the expression to
retrieve the correct info regardless of context using something like this:

with_variable('Length2',  to_string(@NamelengthField) || '2',
if(attribute(to_string(@NamelengthField)) != attribute(@Length2), TRUE,
FALSE))

That's probably an extreme example but hopefully it illustrates my point.
If you want to share a sample dataset/ model I can try to have a look at
how to resolve it.

Regards

On Tue, 20 Jul 2021 at 10:46, Richard McDonnell 
wrote:

> Nicolas,
>
> I have not looked at this in too much detail, but at a quick glance, could
> it not be the fact that you should be using the newly created fields? As in
> instead of *@NamelengthField != @NamelengthField || '2'*, should it not
> be more like your previous example *Length != Length2*
>
>
>
> Regards,
>
>
>
> Richard
>
>
>
>
>
> ——
> Richard McDonnell MSc GIS, FME Certified Professional
> *FRM Data Management*
>
> ——
> Oifig na nOibreacha Poiblí
> Office of Public Works
>
> Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
> Jonathan Swift Street, Trim, Co Meath, C15 NX36
> ——
> M +353 87 688 5964 T +353 46 942 2409
> https://gov.ie/opw
>
> ——
> To send me files larger than 30MB, please use the link below
> https://filetransfer.opw.ie/filedrop/richard.mcdonn...@opw.ie
>
> Email Disclaimer:
> https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
>
> *From:* Qgis-user  *On Behalf Of *Nicolas
> Cadieux
> *Sent:* 20 July 2021 09:27
> *To:* Qgis Users List 
> *Subject:* Re: [Qgis-user] Problem using Model Inputs variable in an
> Select by expression in the model Designer
>
>
>
> Hi,
>
> Does anyone have an idea?
>
> Nicolas Cadieux
>
> https://gitlab.com/njacadieux
>
>
>
> Le 8 juill. 2021 à 01:17, Nicolas Cadieux  a
> écrit :
>
> 
>
> Hi,
>
> I am creating a model that fixes Network files before they are used in the
> QGIS Network analysis (Shortest path) tools.
>
> This is my work flow:
>
>1. Create a "Length" field (value) and calculate $length in the field
>calculator
>2. Split the Multipart lines into Singlepart lines
>3. Create a "Length*2*" field (value) and calculate $length in the
>field calculator
>4. Select by expression Length != Length2.  This basically gives me a
>selection of line that have been modified by the Multipart to Singlepart
>algorithm. (I get 8 results)
>
> This works well
>
> The problem is when I create and Input String to let the user create a
> "Length" field.  This become a variable called @NamelengthField. My work
> flow become:
>
>1. User input "Length" in the Model input. (@NamelengthField)
>2. Create a "Length" field using  @NamelengthField (as pre-calculated
>value) and calculate $length in the field calculator: This is OK
>3. Split the Multipart lines into Singlepart lines: This is OK
>4. Create a "Length2" field using  @NamelengthField ||'2'  (as
>pre-calculated value) and calculate $length in the field calculator: This
>is OK this field (Length2) is created and calculated properly.
>5. I get stuck  when I try Select by expression using
>@NamelengthField != @NamelengthField || '2' (as pre-calculated value) (I
>get all lines back) and the test does not work.
>
> I tried stuff like
>
> @NamelengthField != (@NamelengthField || '2')
>
> '@NamelengthField != @NamelengthField || '2''
>
> "@NamelengthField != @NamelengthField || '2'"
>
> "@NamelengthField"|| !=|| "@NamelengthField || '2'"
>
> Even simple @NamelengthField = 5.286365157529550 (which should extract
> exactly one value).
>
> Any ideas?
>
> Nicolas
>
> QGIS 3.18.2 on Windows 10
>
>
>
>
>
>
>
> --
>
> Nicolas Cadieux
>
> https://gitlab.com/njacadieux
>
> ___
> 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 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] Raster to Vector without losing the symbology

2021-07-20 Thread Andy Harfoot

Hi Krishna,

It's hard to say what might be happening without seeing the data, but 
the issues with the union output may be due to invalid geometries being 
created by the polygonise. Check that the polygonise outputs are 
correctly capturing the band values and run them through the 'Check 
validity' tool.


If there are a lot of invalid polygons, then it will probably be easier 
to follow a raster approach such as outlined by Nicolas Cadieux, ie 
Raster Calculator: R * 100 + G * 1000 + B, followed by polygonise 
and then use an expression to extract the colour components again to 
colour the polygons.


Cheers,

Andy

On 19/07/2021 21:09, krishna Ayyala wrote:

*CAUTION:* This e-mail originated outside the University of Southampton.
Dear Andy,
Thanks for your reply. I did extract the image into three separate 
vectors using the Polygonize (Raster to vector) tool. I got three 
vector files which I named as Band1, Band2 and Band3. I did the union 
of Band1 and Band2 the result of which I named as "Band1_and_Band2". 
Again ran union tool with "Band1_and_Band2" and Band3. I named the 
result as Band1_and_Band2_and_Band3". This resultant vector file is 
not showing the entire area of the image. It is showing only part of 
the image. Lot of DN values for each band show null values.


Regards.

On Mon, Jul 19, 2021 at 7:40 AM Andy Harfoot > wrote:


Or extract the three bands into three separate vector files and
then union the three together to get the unique combinations of
RGB values.

Cheers,

Andy

On 18/07/2021 19:56, Nicolas Cadieux wrote:

*CAUTION:* This e-mail originated outside the University of
Southampton.
Hi,
You could create a style that could apply to both raster and
vector layers but that would not help much here.  The problem is
that you need to create the vector based on one of the raster
Bands and not all three.  One way could be to combine all three
fields into one.  If your RGB is 155 025 255, make this a raster
band with 155025255. Then, I guess you could use that 4th band to
make the vector layer, then resplit the data into 3 fields and
use that to create the colour profile.

Nicolas Cadieux
https://gitlab.com/njacadieux




Le 18 juill. 2021 à 12:51, krishna Ayyala
  a écrit :


I have an image on my qgis map that has 3 bands. Band1 (red),
Band2(green) and Band3(blue). This image has different colors.Is
it possible to convert this image into a vector which should
look exactly like the image.

That means; Is it possible to have the vector file that
should have the same colors as that of the image.

Regards.
___
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 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] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Richard McDonnell
Nicolas,
I have not looked at this in too much detail, but at a quick glance, could it 
not be the fact that you should be using the newly created fields? As in 
instead of @NamelengthField != @NamelengthField || '2', should it not be more 
like your previous example Length != Length2

Regards,

Richard



——
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

——
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
——
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

——
To send me files larger than 30MB, please use the link below 
https://filetransfer.opw.ie/filedrop/richard.mcdonn...@opw.ie

Email Disclaimer: 
https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
From: Qgis-user  On Behalf Of Nicolas Cadieux
Sent: 20 July 2021 09:27
To: Qgis Users List 
Subject: Re: [Qgis-user] Problem using Model Inputs variable in an Select by 
expression in the model Designer

Hi,
Does anyone have an idea?
Nicolas Cadieux
https://gitlab.com/njacadieux


Le 8 juill. 2021 à 01:17, Nicolas Cadieux 
mailto:njacadieux.git...@gmail.com>> a écrit :


Hi,

I am creating a model that fixes Network files before they are used in the QGIS 
Network analysis (Shortest path) tools.

This is my work flow:

  1.  Create a "Length" field (value) and calculate $length in the field 
calculator
  2.  Split the Multipart lines into Singlepart lines
  3.  Create a "Length2" field (value) and calculate $length in the field 
calculator
  4.  Select by expression Length != Length2.  This basically gives me a 
selection of line that have been modified by the Multipart to Singlepart 
algorithm. (I get 8 results)

This works well

The problem is when I create and Input String to let the user create a "Length" 
field.  This become a variable called @NamelengthField. My work flow become:

  1.  User input "Length" in the Model input. (@NamelengthField)
  2.  Create a "Length" field using  @NamelengthField (as pre-calculated value) 
and calculate $length in the field calculator: This is OK
  3.  Split the Multipart lines into Singlepart lines: This is OK
  4.  Create a "Length2" field using  @NamelengthField ||'2'  (as 
pre-calculated value) and calculate $length in the field calculator: This is OK 
this field (Length2) is created and calculated properly.
  5.  I get stuck  when I try Select by expression using  @NamelengthField != 
@NamelengthField || '2' (as pre-calculated value) (I get all lines back) and 
the test does not work.

I tried stuff like

@NamelengthField != (@NamelengthField || '2')

'@NamelengthField != @NamelengthField || '2''

"@NamelengthField != @NamelengthField || '2'"

"@NamelengthField"|| !=|| "@NamelengthField || '2'"

Even simple @NamelengthField = 5.286365157529550 (which should extract exactly 
one value).

Any ideas?

Nicolas

QGIS 3.18.2 on Windows 10







--

Nicolas Cadieux

https://gitlab.com/njacadieux
___
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] Problem using Model Inputs variable in an Select by expression in the model Designer

2021-07-20 Thread Nicolas Cadieux
Hi,
Does anyone have an idea?

Nicolas Cadieux
https://gitlab.com/njacadieux

> Le 8 juill. 2021 à 01:17, Nicolas Cadieux  a 
> écrit :
> 
> 
> Hi,
> 
> I am creating a model that fixes Network files before they are used in the 
> QGIS Network analysis (Shortest path) tools.
> 
> This is my work flow:
> 
> Create a "Length" field (value) and calculate $length in the field calculator
> Split the Multipart lines into Singlepart lines
> Create a "Length2" field (value) and calculate $length in the field calculator
> Select by expression Length != Length2.  This basically gives me a selection 
> of line that have been modified by the Multipart to Singlepart algorithm. (I 
> get 8 results)
> This works well
> 
> The problem is when I create and Input String to let the user create a 
> "Length" field.  This become a variable called @NamelengthField. My work flow 
> become:
> 
> User input "Length" in the Model input. (@NamelengthField)
> Create a "Length" field using  @NamelengthField (as pre-calculated value) and 
> calculate $length in the field calculator: This is OK
> Split the Multipart lines into Singlepart lines: This is OK
> Create a "Length2" field using  @NamelengthField ||'2'  (as pre-calculated 
> value) and calculate $length in the field calculator: This is OK this field 
> (Length2) is created and calculated properly. 
> I get stuck  when I try Select by expression using  @NamelengthField != 
> @NamelengthField || '2' (as pre-calculated value) (I get all lines back) and 
> the test does not work.
> I tried stuff like
> 
> @NamelengthField != (@NamelengthField || '2')
> 
> '@NamelengthField != @NamelengthField || '2''
> 
> "@NamelengthField != @NamelengthField || '2'"
> 
> "@NamelengthField"|| !=|| "@NamelengthField || '2'"
> 
> Even simple @NamelengthField = 5.286365157529550 (which should extract 
> exactly one value).  
> 
> Any ideas?
> 
> Nicolas
> 
> QGIS 3.18.2 on Windows 10 
> 
> 
> 
> 
> 
> 
> 
> -- 
> Nicolas Cadieux
> https://gitlab.com/njacadieux
___
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