Re: [QGIS-Developer] saving a layer with the world_map.shp

2019-06-11 Thread Nathan Woodrow
Hey Tim,

Yes I yanked that file from Natural Earth and I think it might have
simplified it a little bit to reduce the file size but it's the same file.

Regards,
Nathan

On Fri, Jun 7, 2019 at 7:25 PM Tim Sutton  wrote:

> Hi
>
> If I am not mistaken, the world map comes from Nathan Woodrow (he added it
> for the projection selector widget):
>
> [timlinux@sandstone ~/dev/cpp/QGIS/resources/data (master)]$ git log
> world_map.shp
> commit cf241f51ae2ae4ae225c9af65690aa2a5524df04
> Author: Nathan Woodrow 
> Date:   Mon Oct 16 10:40:05 2017 +1000
>
> [FEATURE][needs-docs] Show projection bounds in projection widget
> (#5356)
>
>
> - Script to pull bounds from EPSG.org Postgres dump
> - Add resources/data/world_map.shp for reference
> - Show canvas bounds for reference
>
> I’m guessing it comes from Natural Earth, but he would need to confirm.
> Nathan can you add a license for that file?
>
> Regards
>
> Tim
>
> On 7 Jun 2019, at 09:53, Áron Gergely  wrote:
>
> Hi Tim,
>
> With Raymond we are planning on using your great ester egg data in the
> overview box within map layouts.
> I am looking for the license of the data,  do you perhaps know it / know
> where to find it?
> Or does it fall under QGIS' license?
>
> Thanks,
>
> Best Regards,
> Aron Gergely
>
> I am also a fan of the ester egg, learned it from Raymond.
>
> On 28/05/2019 10:50, Tim Sutton wrote:
>
> Hi
>
> I don’t have any immediate fix for your issue, but I am glad you are
> enjoying my Easter egg :-) I also use it ALL THE TIME and it is really
> great in training courses etc. to get people quickly started with panning
> and zooming or putting their data in context. One day maybe we can elevate
> it’s status to have a button on the file toolbar that adds it to the canvas
> without the need for bunnies and chocolate :-)
>
> PS for those that don’t know about the Easter egg, type ‘world’ into the
> coordinate box in the status bar as shown below, then press ENTER.
>
> 
> Regards
>
> Tim
>
> On 27 May 2019, at 14:58, Raymond Nijssen  wrote:
>
> I know it was introduced as an easter egg, but I'm very happy with the
> built in world map in qgis. I'm using it in a plugin to automatically add a
> layer for the overview map in my layout. This layer points to a shapefile
> in my qgis install directory:
>
> /home/raymond/programs/qgis-master/share/qgis/resources/data/world_map.shp
>
> Now, when saving my project and somebody else opening it, the layer is
> invalid (of course). Is there a way to make the project point to the right
> file, using some kind of variable pointing to the qgis installation path?
>
> like this:
> {QGIS_RESOURCE_PATH}/data/world_map.shp
>
> or I could copy the world.shp into my plugin and do this:
>
> {QGIS_PLUGIN_PATH}/my-plugin/data/world_map.shp
>
> These paths should then be saved including the variable in the project
> file.
>
>
>
> Another option would be to save the shp-file in the .qgz somehow but I'm
> not too sure if that is the way to go..
>
>
>
> This is the way I create the path now:
>
> worldShp = os.path.join(QgsApplication.pkgDataPath(), 'resources', 'data',
> 'world_map.shp')
>
>
>
> To make the question more general, is it possible to add resources to a
> plugin in a way that projects point to these resources and make that work
> for other users too?
>
>
> Hope anyone can help!
>
> Kind regards,
> Raymond
>
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> —
>
>
> 
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:* Kartoza
> *Ex Project chair:* QGIS.org 
>
> Visit http://kartoza.com to find out about open source:
>
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
>
> *Skype*: timlinux
> *IRC:* timlinux on #qgis at freenode.net
>
> I'd love to connect. Here's my calendar link
>  to make finding time easy.
>
>
> ___
> QGIS-Developer mailing listqgis-develo...@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> —
>
>
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:* Kartoza
> *Ex Project chair:* QGIS.org
>
> Visit http://kartoza.com to find out about open source:
>
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
>
> *Skype*: timlinux
> *IRC:* timlinux on #qgis at freenode.net
>
> I'd love to connect. Here's my calendar link
>  to make finding time easy.
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: 

Re: [QGIS-Developer] saving a layer with the world_map.shp

2019-06-11 Thread Raymond Nijssen
A topologically more correct map is not easily to find, especially not 
in a tiny (shp) file size. Here are some links to examples:


http://www.statsilk.com/maps/download-free-shapefile-maps

But for educating CRS, for quickly finding out where your just opened 
dataset is, and for layout overview maps the current one is already very 
useful.


To improve it we could:
1. Generalize a correct map in a topological way
2. Remove all administrative boundaries from the current map to avoid 
people getting offended by disputed territories for example.


We should also watch out not to start shipping data packages with the 
software! Before we know there might be world boundaries at different 
scales and people starting to wonder why we do not provide cities, 
rivers, roads, coffee corners, ... :)


But a good resource platform (for data, svg, png, styles) in QGIS could 
make it easy to ship this kind of data in plugins and make it work for 
all users. Which was my original question.


Kind regards,
Raymond



On 12-06-19 06:00, Tim Sutton wrote:
If you can find a better one or want to clean it I will be happy to 
replace it. Just provide some metadata with it this time so we know the 
provenance.


Thanks!

Regards

Tim

On 11 Jun 2019, at 18:10, Bernd Vogelgesang > wrote:


This is a really nice easter egg and could be of great use for quickly 
showing new users the differences of different crs in a course, if the 
shape wastn't that full of topology errors :(


Isn't there maybe a less buggy shape available?

Bernd


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info:https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-developer

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


—








*Tim Sutton*

*Co-founder:*Kartoza
*Ex Project chair:*QGIS.org 

Visit http://kartoza.com  to find out about open 
source:


Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

*Skype*: timlinux
*IRC:*timlinux on #qgis at freenode.net 

I'd love to connect. Here's my calendar link 
 to make finding time easy.



___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] saving a layer with the world_map.shp

2019-06-11 Thread Tim Sutton
If you can find a better one or want to clean it I will be happy to replace it. 
Just provide some metadata with it this time so we know the provenance.

Thanks!

Regards

Tim

> On 11 Jun 2019, at 18:10, Bernd Vogelgesang  wrote:
> 
> This is a really nice easter egg and could be of great use for quickly 
> showing new users the differences of different crs in a course, if the shape 
> wastn't that full of topology errors :(
> 
> Isn't there maybe a less buggy shape available?
> 
> Bernd
>> 
>> ___
>> QGIS-Developer mailing list
>> QGIS-Developer@lists.osgeo.org 
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer 
>> 
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer 
>> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

—









Tim Sutton

Co-founder: Kartoza
Ex Project chair: QGIS.org

Visit http://kartoza.com  to find out about open source:

Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

Skype: timlinux 
IRC: timlinux on #qgis at freenode.net

I'd love to connect. Here's my calendar link  to 
make finding time easy.

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] How to update change the datasource of already existing layer

2019-06-11 Thread Ivan Ivanov
I fixed it. Sorry for the inconvenience:

layer1 = QgsVectorLayer('Polygon?crs=epsg:32612', 'layer2', 'memory')
layer2 = QgsVectorLayer('Polygon?crs=epsg:32612', 'layer1', 'memory')

print(layer1.source())
print(layer2.source())
layer1.setDataSource(layer2.source(), layer2.name(),
layer2.dataProvider().name())
print(layer1.source())

On Wed, 12 Jun 2019 at 00:28, Nyall Dawson  wrote:

> On Tue, 11 Jun 2019 at 15:06, Ivan Ivanov  wrote:
> >
> > Hello,
> >
> >
> > Can you give me some idea why I'm getting two uids in the layer's
> source? And also how I can fix this because now the layer just disappears
> from the map canvas. (all layers are isValid() = True)
> >
> > oldLayer.source()
> > #
> MultiLineString?crs=EPSG:32737=fid:integer(0,0)={6cd1f176-9c05-4d2a-961a-3143a8fa422b}
> >
> > newLayer = processing.run('save:selectedfeatures', {
> > 'INPUT': oldLayer,
> > 'OUTPUT': 'memory:newLayer'
> > )
> >
> > oldLayer.setDataSource(newLayer.source(), oldLayer.name(),
> newLayer.dataProvider().name())
> >
> > newLayer.source()
> > #
> MultiLineString?crs=EPSG:32737=fid:integer(0,0)={d36aff88-4248-4ffb-be2f-2ac1891ac26d}
> > oldLayer.source()
> >
> > # WRONG, I would expect the same as above. Also, the uid is completely
> new.
> > #
> MultiLineString?crs=EPSG:32737=fid:integer(0,0)={d36aff88-4248-4ffb-be2f-2ac1891ac26d}={3422de07-cf38-4249-af55-23c7d9779daf}
>
> Hi Ivan,
>
> Your code seems incomplete and has some syntax errors -- maybe it
> wasn't copied correctly? Can you repost please?
>
> Nyall
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] How to update change the datasource of already existing layer

2019-06-11 Thread Nyall Dawson
On Tue, 11 Jun 2019 at 15:06, Ivan Ivanov  wrote:
>
> Hello,
>
>
> Can you give me some idea why I'm getting two uids in the layer's source? And 
> also how I can fix this because now the layer just disappears from the map 
> canvas. (all layers are isValid() = True)
>
> oldLayer.source()
> # 
> MultiLineString?crs=EPSG:32737=fid:integer(0,0)={6cd1f176-9c05-4d2a-961a-3143a8fa422b}
>
> newLayer = processing.run('save:selectedfeatures', {
> 'INPUT': oldLayer,
> 'OUTPUT': 'memory:newLayer'
> )
>
> oldLayer.setDataSource(newLayer.source(), oldLayer.name(), 
> newLayer.dataProvider().name())
>
> newLayer.source()
> # 
> MultiLineString?crs=EPSG:32737=fid:integer(0,0)={d36aff88-4248-4ffb-be2f-2ac1891ac26d}
> oldLayer.source()
>
> # WRONG, I would expect the same as above. Also, the uid is completely new.
> # 
> MultiLineString?crs=EPSG:32737=fid:integer(0,0)={d36aff88-4248-4ffb-be2f-2ac1891ac26d}={3422de07-cf38-4249-af55-23c7d9779daf}

Hi Ivan,

Your code seems incomplete and has some syntax errors -- maybe it
wasn't copied correctly? Can you repost please?

Nyall
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] QGIS Server 2.x and caching question

2019-06-11 Thread Régis Haubourg
Hi Andreas,
Wow good catch finding the causes of such an issue!
I can't answer myself on the technical part.

> The "human readable" nature of qgs/qml files naturally seduce people to
> copy / paste and mix project stuff together in text editors ...
>
Well, I don't quite agree here. Doing copy paste with our wml structure is
not human, it's a proof that human can be very ingenious :) !  I wouldn't
ever recommend that. I have just tried to play with git and diff for a long
time with QGS project files, and I wouldn't ever recommand to do that.
Replacing datasources is probably the only safe thing to do in this XML
file.
I would just wait to see if we see that ever again before tackling this.
Best regards
Régis

Le mar. 11 juin 2019 à 18:28, Andreas Neumann  a
écrit :

> Hi all,
>
> At my new work place we are running a 2.x QGIS server  which in two
> projects behaves very strange: sometimes colors display in the color we
> expected, sometimes really light. Then my colleagues discovered that more
> than rules share the same UUID identifier, because the QGS files have been
> copy pasted into a anew project and then aggregated again into the same
> single project.
>
> Not knowing about the internals of QGIS server 2x (and 3x) I wonder if
> this something we need to avoid? Are the UUID identifiers of a symbology
> rule relevant and absolutely need to be unique? Do we have to avoid such id
> clashes?
>
> The "human readable" nature of qgs/qml files naturally seduce people to
> copy / paste and mix project stuff together in text editors ...
>
> Thank you for your feedback on this topic.
>
> Andreas
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] QGIS Server 2.x and caching question

2019-06-11 Thread Andreas Neumann
Hi all, 


At my new work place we are running a 2.x QGIS server  which in two
projects behaves very strange: sometimes colors display in the color we
expected, sometimes really light. Then my colleagues discovered that
more than rules share the same UUID identifier, because the QGS files
have been copy pasted into a anew project and then aggregated again into
the same single project. 


Not knowing about the internals of QGIS server 2x (and 3x) I wonder if
this something we need to avoid? Are the UUID identifiers of a symbology
rule relevant and absolutely need to be unique? Do we have to avoid such
id clashes? 


The "human readable" nature of qgs/qml files naturally seduce people to
copy / paste and mix project stuff together in text editors ... 

Thank you for your feedback on this topic. 


Andreas___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] saving a layer with the world_map.shp

2019-06-11 Thread Bernd Vogelgesang

This is a really nice easter egg and could be of great use for quickly
showing new users the differences of different crs in a course, if the
shape wastn't that full of topology errors :(

Isn't there maybe a less buggy shape available?

Bernd


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] QGIS Server 3.4.7 and WFS Filtering PropertyIsLike

2019-06-11 Thread Luca Manganelli
Addendum.

I discovered what problem was.

OWSLib generates an URL like this:

http:// WFSHOST .../=nome_viaVIA
A%

but it seems that QGIS Server doesn't like this. We should add 
and  at start and the end of the FILTER value:

http:// WFSHOST .../=nome_viaVIA
A%

with the last URL, the WFS query works!




Il giorno mar 11 giu 2019 alle ore 14:18 Luca Manganelli <
luca.mangane...@comune.trento.it> ha scritto:

> Hello,
>
> I'm trying to make this python 3 code with OwsLib working.
> In particular, I'm searching a road with the name starting by "VIA F.",
> but QGIS Server returns me a road named VIA MATTEOTTI...
>
> Does QGIS Server support PropertyIsLike in WFS?
>
>
> #!/usr/bim/python3
> from owslib.wfs import WebFeatureService
> from owslib.etree import etree
> from owslib.fes import PropertyIsEqualTo, PropertyIsLike, BBox
>
> wfs = WebFeatureService(url='https://cartografia.comunelavis.it/wms/cbase
> ')
>
> filt = PropertyIsLike(propertyname='nome_via', literal='VIA F.%',
> wildCard='%', matchCase=False)
> filterxml = etree.tostring(filt.toXML()).decode("utf-8")
>
> feature = wfs.getfeature(typename=['Civici'], maxfeatures=1,
> filter=filterxml)
> gml = etree.parse(feature)
> print(etree.tostring(gml))
>


-- 
Luca Manganelli
Assistente informatico
Servizio Innovazione e Sistemi digitali
Via Ezio Maccani 148
38121 Trento (TN)
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] Plugin [135] mmqgis approval notification.

2019-06-11 Thread noreply

Plugin mmqgis approval by zimbogisgeek.
The plugin version "[135] mmqgis 2019.6.11" is now approved
Link: http://plugins.qgis.org/plugins/mmqgis/
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] QGIS Server 3.4.7 and WFS Filtering PropertyIsLike

2019-06-11 Thread Luca Manganelli
Hello,

I'm trying to make this python 3 code with OwsLib working.
In particular, I'm searching a road with the name starting by "VIA F.", but
QGIS Server returns me a road named VIA MATTEOTTI...

Does QGIS Server support PropertyIsLike in WFS?


#!/usr/bim/python3
from owslib.wfs import WebFeatureService
from owslib.etree import etree
from owslib.fes import PropertyIsEqualTo, PropertyIsLike, BBox

wfs = WebFeatureService(url='https://cartografia.comunelavis.it/wms/cbase')

filt = PropertyIsLike(propertyname='nome_via', literal='VIA F.%',
wildCard='%', matchCase=False)
filterxml = etree.tostring(filt.toXML()).decode("utf-8")

feature = wfs.getfeature(typename=['Civici'], maxfeatures=1,
filter=filterxml)
gml = etree.parse(feature)
print(etree.tostring(gml))
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] GSoC QGIS 3D Improvement: Week 2 Report

2019-06-11 Thread Martin Dobias
On Sun, Jun 9, 2019 at 7:43 AM Ismail Sunni  wrote:

> Yes, that issue was a blocker in week 1 [1]. I have discussed with Martin
> and Peter. Martin suggests 3 alternatives for it:
>
>1. Using QtQuick --> Adding dependencies, it will need to go through
>QEP and so on
>2. Render it as a 3D object (like Tim said) --> too much work
>3. Doing as normal QWidget (like current implementation, the
>alternative that we chose)
>
> I also feel that the current implementation is not what I expect. The
> first proposal was also a floating widget. Unfortunately, I didn't know
> that it's not possible by using QWidget on top of Qt3DWindow at that time I
> wrote the proposal.
>

As Ismail says, we have discussed that but couldn't come up with a simple
solution that would not take a lot of time. Both alternatives (rendering
controls with Qt3D / rendering controls with QtQuick) would be heavy on
extra code changes. 3D windows are quite special because they are being
rendered in a different way, so one can't just easily embed other QWidgets
on top of 3D window (and this will be probably OS-specific as well).

For the time being we could maybe make a good use of the space - e.g. show
coordinates of the points towards which the camera is looking or optionally
show some debugging information.

Cheers
Martin
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer