Re: [QGIS-Developer] QDateTimeEdit: setting a useful minimum Date

2017-07-11 Thread John Layt
On 11 July 2017 at 17:28, Mark Johnson  wrote:

> While working on an overhaul of the QgsSpatiaLiteProvider (for Spatialite
> 4.5.0), I just completed the portion for setting the default DATE/DATETIME
> etc. only to find that for the QDateTimeEdit class, the beginning or the
> world is determined by the Act of Parliament of 1751 (Calendar Act) - which
> is a disaster for any Historical Database for any event before 1752-09-14.
>

Fortunately, historical dates and time zones are are two of QDateTime
'bugs' I fixed for Qt5. To that extent, the future is brighter for the past
in QGIS 3 :-) Sadly at the time there was no QtWidgets maintainer so the
QDateTimeEdit patch to use it didn't get in. It may have been fixed in a
recent Qt5 release though, I think I saw a patch float past sometime in the
the last year or so...

Of course, that doesn't help you right now :-)

John.
___
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] [WIP] project snapping settings

2016-09-02 Thread John Layt
On 2 September 2016 at 12:51,   wrote:
>> Hi all,
>>
>> Just to let you know, I am working on a new design to handle snapping
>> settings.
>>
>> Settings are now handled in a core class attached to the project,
>> similarly to QgsRelationManager. It will provide a nice API to deal with
>> the settings and some useful signals.
>>
>> This means one will no longer have to change the project settings
>> manually and take care of emitting the proper signal.
>>
>> Besides, there will be a new widget to define the settings. It will be
>> quite flexible and can be shown in the status bar, tool bar, dock or
>> dialog. Per layer config will use the legend layer tree.
>>
>>
>> If the old snapper class is removed in the mean time, it will save me
>> some time ;)
>

Hi,

I've been working on something similar as a plugin, which is almost ready, see:

http://ark.lparchaeology.com/wiki/index.php/QGIS#ARK_Snapping
https://github.com/lparchaeology/libarkqgis/blob/master/snapping.py

Feel free to borrow any ideas / code :-)

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

Re: [Qgis-developer] Problem definig snapping options programmatically

2016-06-24 Thread John Layt
On 24 June 2016 at 12:06, John Stevenson  wrote:
> Hi Christian,
>
> Yes, my problem is exactly the same as yours, and so I have the same 
> questions, too:
>
> - is it a bug or a feature that the settings are not applied immediately by 
> setSnapSettingsToLayer()?
> - is there a way to change snapping settings to Advanced via Python?

Have a look at my code for doing lots of snapping stuff like that,
feel free to borrow it under GPLv2+:

https://github.com/lparchaeology/libarkqgis/blob/master/snapping.py

Really must get around to releasing that plugin I wrote to configure
snapping using a single toolbar button...

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

Re: [Qgis-developer] GEOS error Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4

2016-05-14 Thread John Layt
> On 13/05/2016 11:08, A Huarte wrote:
>
> Hi, I think this pull https://github.com/qgis/QGIS/pull/2900 fixes the
> error.
>
> But it is pending to merge, It needs to fix some tests to be accepted
> finally.
> Meanwhile you can disable the on-the-fly simplification of the layer.

Ah, now that would make sense why I could never find a bad geometry in
my data if if was the simplified geometry that was in error. Won't
waste anymore time chasing that one then :-)

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

Re: [Qgis-developer] GEOS error Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4

2016-05-14 Thread John Layt
On 13 May 2016 at 08:53, Janneke van Dijk  wrote:
> Using QGIS 2.14.2 on Windows 7 I get the following error message when
> zooming out on a shapefile layer that has labels switched on:
>
> GEOS
> Exception: IllegalArgumentException: Invalid number of points in LinearRing
> found 3 - must be 0 or >= 4

We get this a *lot* using 2.12 on OSX, and possibly on 2.8 as well.
I've not been able to consistently pin it down to any one geometry
though so haven't been able to open a bug report. Will be really
interested to hear of any solutions.

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

Re: [Qgis-developer] QGIS PDF export options

2016-03-19 Thread John Layt
On 18 March 2016 at 15:31, johnrobot  wrote:
> Hi
> I would like to see a few options when exporting a layout to PDF:
>
> - PDF version, such as archive PDF/A-1a
> - Support for layers/geospatial PDF as discussed in
> https://hub.qgis.org/issues/9362
> - Resolution, compression
> - Password protection
> - Disable printing
> - Enable/disable content copy
> - Fit window, fit visible etc.
>
> Any thoughts? Should I open a ticket for each one of the above or a general
> ticket?

I assume you mean exporting a layout from the composer to PDF? In that
case QGIS uses the Qt's built-in print-to-PDF support, and as the
sometimes/former maintainer of print support in Qt5 I know that none
of those options (except resolution) are supported in Qt so QGIS is
unable to provide them. All those features would be very welcome
contributions to Qt 5 though, it's just we lack someone with the PDF
standard knowledge and time to do so. If anyone here has those skills
I'd be happy to help guide them through the process (or be paid to
find the time myself!).

Rather than raise tickets on QGIS, you'll need to check if Qt already
has tickets open (I think most do, see bugreports.qt.io) and if not
raise them yourself, then perhaps open a single QGIS ticket pointing
to the upstream issues so they can be tracked?

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

Re: [Qgis-developer] QGIS georeferencer / vector georeferencer

2015-11-26 Thread John Layt
On 26 November 2015 at 07:41, Andreas Neumann  wrote:

> Hi,
>
> Is there a reason why the QGIS georeferencer is still a plugin and not
> part of QGIS core?
>
> Do you think that the existing QGIS raster georeferencer could be
> enhanced/extended to also allow the georeferencing of one or more vector
> layers?
>
> I know that there is a Python plugin to do vector georeferencing - but I
> really think that both raster and vector georeferencing is an integral part
> of any GIS and shouldn't be optional or a second class citizen. And it is
> also rather suboptimal that the raster and vector georeferencers have two
> different interfaces ...
>

As someone who has written custom georeferencers for both raster and vector
data in a QGIS plugin [1], I would greatly appreciate if the core
georeferencing functions are moved into core or processing to save me
duplicating it, with the gui being left as a plugin. At the moment I have
to execute GDAL on the command line working directly on the raster files,
and have copied/modified the vector bending code to achieve what I need.
Separating the two would also allow people to experiment with different gui
ideas without duplicating the core code, because to be honest the current
gui options are not as easy to use as they could be.

John.

[1] If you're wondering, the plugin is for digitizing archaeological plans
drawn on grid paper to a fixed 5m by 5m local grid, we semi-automatically
georeference the rasters for a grid-square to the known grid points (only 5
clicks required versus the 42 clicks needed in the standard georeferencer).
The vector bender code is used to initially create the local grid and then
to covert survey data between the local and national co-ords. I hope to
release a preview some time soon.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Plugin migratin -> mailing list?

2015-11-08 Thread John Layt
On 8 November 2015 at 08:40, Tom Chadwin  wrote:

> I can only speak about UK legislation. That only allows the use of
> collected
> personal data for purposes explicitly stated at the time of collection. I
> don't believe such permission is sought when plugins are submitted. Are
> there any terms and conditions which bind plugin authors?
>

I would think that listing yourself in the metadata as the author for a
plugin is rather explicitly agreeing to be contacted regarding that plugin,
why else would someone put their email there? I would expect to hear from
the admins on that address, and even from users, and so set an appropriate
address for that purpose.

Personally, I would like to see a proper mailing list for plugin devs, as
neither the users nor developers lists seem quite the right place to be
asking questions or receiving advice on plugin development. Do an initial
mail-out to all the contact addresses telling about the list, but don't
auto-subscribe, that will act as a natural filter on those plugins no
longer actively developed. Then when important milestones arrive in the 3.x
release use the full author list for announcement emails only pointing to
the plugin list or wiki for further details.

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

Re: [Qgis-developer] Plugin migratin -> mailing list?

2015-11-08 Thread John Layt
On 8 November 2015 at 08:40, Tom Chadwin  wrote:

> I can only speak about UK legislation. That only allows the use of
> collected
> personal data for purposes explicitly stated at the time of collection. I
> don't believe such permission is sought when plugins are submitted. Are
> there any terms and conditions which bind plugin authors?
>

In the "I am not a layer" category, it strikes me that it doesn't matter
what the law is in your or my jurisdiction, whether that is the UK or Italy
or the US, what matters is the law in the jurisdiction of the collecting
party at the point(s) of collection and storage? Which for QGIS plugins
would be?

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

Re: [Qgis-developer] A common set of functions for QGIS plugins

2015-11-02 Thread John Layt
On 2 November 2015 at 12:52, Victor Olaya  wrote:

> Hi all,
>
> We have discussed sometimes in here about the need of having some
> common functions for plugin developers, to avoid all plugins having to
> reimplement those functions, sometimes not in the most correct way. It
> will also bring some homogeneity to plugins, which I think it is a
> good thing.
>
> With the changes that will be coming to QGIS soon, I think this is a
> good idea to work on, and I have started a small project here to
> create a set of Python modules with those common functions.
>
> https://github.com/volaya/qgiscommons
>
> Not much yet, but I plan to work on that and make it grow during this
> week. With the Hackfest coming, I think it is a good time to ask other
> devs to contribute...


We have a similar library for our internal company plugins (some soon to be
made public) that we include as a git submodule to save code duplication.
Lots of simple stuff, but also some obvious missing API and functions, like
map tools that snap (am I ever glad to see that as public api in 2.12!).
See https://github.com/lparchaeology/libarkqgis.

I'm in two minds as to whether it would be a good thing to have an
'official' one. While I can see the use, surely if these things are useful
then they should be included in the mainline API with proper API
guarantees? I'm not sure I'd want to rely on a library that doesn't have an
API guarantee, and if you're making the guarantee then why not in core? If
they are *required* for a plugin to be accepted, then they must be in core
and have an API guarantee.

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

Re: [Qgis-developer] Georeferencing using PyQGIS

2015-10-11 Thread John Layt
On 11 October 2015 at 21:03, Chris Schaffer  wrote:
> Hello,
>
> I would like to georeference a raster using PyQGIS.  If I want to
> georeference a raster manually (loaded from an ascii file), I can use the
> Georeferencer plugin, but I don't see a way to access this core C++ plugin
> using PyQGIS.
>
> When I tried using GDAL to georeference a raster, using the script created
> by selecting "Generate GDAL Script" in the Georeferencer, the raster was
> incorrectly georeferenced when I loaded it in QGIS. It looks like there may
> be differences between how GDAL and QGIS handle the georeferencing offsets.
>
> Do you have any advice for georeferencing a raster using PyQGIS, using the
> Georeferencer or otherwise?  I'm using QGIS 2.4.
>
> Thanks!
>
> Chris

You can't access the georeferencer from pyQGIS as it is a plugin
itself. You can find the plugin code at [1]. I would like to see it
all tidied up and exposed as public api, especially seeing as the
Helmert 2-point transform is not available in GDAL but is only
implemented in QGIS itself.

I did write my own georeferencer for our specialised purposes [2]
seeing as the QGIS gui is rather poor (45 clicks to 3-point georef
versus 5 in mine). There are Python bindings to gdal that you could
use instead [3], but I found it just easier to call the binaries
directly.

John.

[1] https://github.com/qgis/QGIS/tree/master/src/plugins/georeferencer
[2] https://github.com/jlayt/ArkPlan/tree/master/georef
[3] https://pypi.python.org/pypi/GDAL/
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer