368 Commits

Author SHA1 Message Date
Sandro Mani
6fd34ca92b Add sip5/sip6 sip-build support 2021-09-24 08:56:40 +10:00
Francesco Bursi
d602f77a33
Add if() function to raster calculator (#44839)
* start to work on new branch for conditional statement

* adjust the layout

* some pseudocode

* start to design the type tFunct, that should lead to the conditional statement

* modify the raw with a smart pointer

* change the test method and some other parts in the tFunct type

* complete the conditional statement option and update the test

* change evaluation method

* some optimization in the evaluation method

* minor adjustment

* minor adjustmentto test method

* add the button to the ui and some change to the code

* add a comment

* modify the parser and lexer in order to let the raster calc work with case-insensitive IF/if/If/iF

* change some parts according to the review and simplify the test method

* minor changes

* modify comment

* minor changes to enum type (tFunction)

* add some parts to test toString()  method

* add the possibility to use scalar condition in eveluationFunction() method and the corresponding test code

* update toString method

* update and optimize toString method

Co-authored-by: franc <Franc-Brs>
2021-09-07 09:48:12 +02:00
Francesco Bursi
179cb1d951
[feature] virtual raster data provider (#44195)
* try to commit some changes in the branch

* addedd 3 file, cmake, vrp .h and .cpp

* updating VRP, no good results

* try to solve some issue to the virtual raster provider

* metadata class added, it should be developed

* registred in qgsproviderregistry the new VRP

* on line to test debug in the  new VRP

* chenge of 1_06

* minor change 2 06

* updating VRP, it can add some useless color to map canvas

* add baseclass test fro new provider

* Delete testqgsvirtualrasterprovider.cpp

* move VRP to src/providers

* Delete src/core/providers/virtualrasterprovider directory

* little change to cmake

* added as dynamic provider

* move the VRP to src/providers and let it work

* move the VRP to src/providers and let it work

* including qgis analysis

* updating block function with some calc tools

* delete block function, updating readblock function

* modified block method, used setValue --> to update with bits

* modified block method

* modified block method, adding takedata to the resultmatrix

* modified test for the new provider

* Add some checks in the block method, for raster entries

* tries for the calculator tool

* work on the hardcoded part and test

* work on the hardcoded test

* minor change in order to make the calc functionaltiy work

* minor change to the loop in which the computation occurs

* try to understand how qgsrastermatrixworks

* work on debugging new class

* work on debugging new class

* updating test and block method

* updating test and and block, now it works running in test mode

* updating test and and block, now it works running in test mode with bits

* updating test and and block, now it works running in test mode with bits

* update test

* update test and provider class

* add decodeuri and encodeui in metadata, at the moment they do nothing

* modify qgsrasterdataprovider by adding decoding and encoding uri methods

* workin on encode and decode funct

* work on encode/decode after Martin advices

* work on encode/decode after Martin advices, and update unit test

* work on encode/decode and update Cmakelist of provider test

* work on encode/decode and update Cmakelist and provider test

* work on encode/decode and update test + constructor

* work on encode/decode and constructor

* decode is now non trivial, he same as constructor

* working on encoding

* working on encoding/decoding

* change a little the code/decode mehods in order to return and get a struct as output/input

* change of decode method

* change the encode method, I should polish the code and optimize the encode for raster layers

* add flag ptr bool to decode mehod

* add flag ptr and modified the constructor of vrprovider

* work on the constructor and deconstructor, the flag does not work properly

* work on the constructor anf decoder

* work on the constructor and decoder

* work on the constructor and add some lines to popoluta mRasterEntries

* delete hardcoded data

* work on constructor and copy constructor 2

* add the parsing of the formula in the constructor, I should make a private var with calcnode

* add the parsing of the formula in the constructor, I should make a private var with calcnode2

* add some checks in the constructor2

* modify the copy constructor, add some code to adjust the qgsrasterdataprovider.sip

* modify checks in the constructor and in the decode method, in order to avoid nested if stat

* delete the logic in the decode method and add in the constructor

* delete the logic in the decode method and add in the constructor, add some redundant check in the constructor

* delete the logic in the decode method and add in the constructor, add some redundant check in the constructor 2

* test is now more general

* test is now more general2

* delete of a comment

* banned keywords check

* little error

* add copyright

* add copyright2

* add assignment operator= delete

* add documentation in qgsrasterprovider

* documentation

* modify qgsstringutils

* little modifications

* add the checkbox to the ui

* come back to old ui for raster calc

* adjust some qt::endl in the test of vrprovider

* start to work on the ui dialog

* layot of the code

* add some logic to the dialog of the raster calc

* add some test to qgisapp, need to modify the encoder and maybe put it in the qgrastercalcdialog

* modify some logic in rastercalcdialog and in the app, I should modify and move the encode method

* modify the comment

* add method to calcnode, modify the constructor of the provider and the open of the dialog

* add documentation

* some modifications according to the first review

* sadd some changes according to Martin's review

* change qgsrastercalcnode methods that returns raster names, small change to ui

* change the ui

* change the ui - using QString instead of QStringLiteral

* change the ui - using QString instead of QStringLiteral

* change name of subdirectory containing the virtual raster provider

* change name of subdirectory containing the virtual raster provider2

* change name of subdirectory containing the virtual raster provider3

* minor changes to makefiles

* minor change to dialog, to hide and show the output format and path

* provider key changed to the shorter virtualraster

* add some code to QgsRasterLayer::encodedSource and decodedSource

* delete some comments

* updating VRP, no good results

* made some change after the the second review

* delete the comments

* change some part of the code (delete of comments and cleaning the code)

* correct some layout errors

* change the mail contatct in my prvider

* change details on the method in qgsrastercalcnode

* change some method of the test class of my provider

* delete some leakage in the virtual raster provider

* modify some parts according to the review + change two lines of code for encoding/decoding methods

* modify a line of qgisapp.cpp

* small change according to the comments on th PR

* add a test method for second generation virtual raster and modify checks in qgisapp

* correction of the test method

Co-authored-by: franc <Franc-Brs>
2021-08-17 10:00:16 +02:00
Nyall Dawson
c2e1ea3b39 QgsGeometry::Change operator== should be const 2021-07-20 17:25:48 +10:00
Nyall Dawson
81b934d9d1 Rework API and improve memory handling of graph objects
Instead of QgsGraphBuilder::graph() taking the ownership of the graph
and leaving the QgsGraphBuilder in an unpredictable state, add an
explicit "takeGraph" method which takes the existing graph and
make the existing "graph" method just return a copy of the graph.

Also fix corresponding memory leaks in network analysis processing
algorithms.

Fixes #44079
2021-07-20 13:54:46 +10:00
Vincent Cloarec
8cd8bec5f2
[mesh] mesh frame editing part 3 - Advanced editing (#44169)
[mesh] [feature] Delaunay triangulation and face refinement for advanced mesh editing tools
2021-07-19 08:21:31 +02:00
nirvn
09760f07f0 Preserve python compatibility 2021-07-07 13:46:11 +07:00
nirvn
4b52b7be7f Move QgsExifTools utility class to core 2021-07-07 13:46:11 +07:00
Nyall Dawson
c8156b0106 Add c++20 todo for replacing equality operators with default implementations 2021-07-02 12:19:58 +10:00
Vincent Cloarec
d326d38660
[mesh] mesh frame editing part-1 (qgis_core) (#43828)
[feature] qgis_core changes to allow mesh layer editing (part-1 or QEP#228)
2021-06-25 16:17:13 +02:00
nirvn
54e8d80513 Add missing SIP bits 2021-06-01 13:49:56 +07:00
Alessandro Pasotti
d06f1e6467 Fix SIP issue with return results from calculateStatistics
Fixes #43245

SIP failed to convert the QMap<QgsZonalStatistics::Statistic, QVariant>
so we give it an QMap<int, QVariant>.
2021-05-22 07:04:16 +10:00
Nyall Dawson
eaf70803b0
Cleanup auto generated sip files and remove orphaned files (#43240) 2021-05-17 08:09:27 +02:00
Mathieu Pellerin
c259a408a4
Merge pull request #42781 from nirvn/snap_opti
Big optimization gains to the geometry snapper class
2021-04-22 14:26:14 +07:00
nirvn
2436f82bdf [optimization][geometry snapper] Get rid of custom tree, use GEOS 2021-04-19 13:37:21 +07:00
Nyall Dawson
ffa99b7b64 Fix doxygen blocks which don't use the * prefix on all lines, which
prevents the auto format and sipify scripts from doing their full
formatting magic
2021-04-19 12:54:13 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
e18584239f Force c++14 only for sip builds, as sip generated code uses deprecated c++ removed in c++17 2021-02-25 11:08:56 +10:00
Nyall Dawson
a7fd8e07f5 Revert 2021-02-25 11:08:56 +10:00
Nyall Dawson
d8a6d36780 Nice and friendly API 2021-02-21 15:18:57 +10:00
Nyall Dawson
fd7149ac97 Create class QgsGcpGeometryTransformer, which allows transformation
of geometry objects via a ground control points based transformation
2021-02-21 15:18:57 +10:00
Nyall Dawson
ce54321220 Rename pixel/layer/map coordinates to "source" and "destination", to
make classes more generic and avoid confusion with non-raster based
GCPs

Also flip function arguments to source, destination order instead
of destination, source
2021-02-21 15:18:57 +10:00
Nyall Dawson
ef78bf9a51 Add public transform method 2021-02-21 15:18:57 +10:00
Nyall Dawson
30245eef4d Add clone method 2021-02-21 15:18:57 +10:00
Nyall Dawson
ff195b373d Pixel -> layer 2021-02-21 15:18:57 +10:00
Nyall Dawson
f2f1d70fa7 Add factory method which creates an initialized transformer from method and list of GCPs 2021-02-21 15:18:57 +10:00
Nyall Dawson
125c33bf5c Move factory method to base class 2021-02-21 15:18:57 +10:00
Nyall Dawson
6628d5d27a Move method to string to QgsGcpTransformerInterface class 2021-02-21 15:18:57 +10:00
Nyall Dawson
fe8c768682 Move transform enum to base class 2021-02-21 15:18:57 +10:00
Nyall Dawson
8bf253d6ef Move classes representing GCP based transformations from app to analysis,
and make ready for exposure to public API
2021-02-21 15:18:57 +10:00
Alessandro Pasotti
7b2fc4c1f8 More doxy nonsense, pt 2 2021-02-19 08:15:29 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Nyall Dawson
578813ac78 Geocoder algorithms can be run in in-place mode too 2020-12-14 16:49:48 +10:00
Nyall Dawson
6ae7a17bf0 [API] Add an adapter class QgsBatchGeocodeAlgorithm which creates
a batch geocoding algorithm from a QgsGeocoderInterface

Example usage:

  # create a class which implements the QgsGeocoderInterface interface:
  class MyGeocoder(QgsGeocoderInterface):

     def geocodeString(self, string, context, feedback):
        # calculate and return results...

  my_geocoder = MyGeocoder()

  # create an algorithm which allows for batch geocoding operations using the custom geocoder interface
  # and implement the few required pure virtual methods
  class MyGeocoderAlgorithm(QgsBatchGeocodeAlgorithm):

      def __init__(self):
          super().__init__(my_geocoder)

      def displayName(self):
          return "My Geocoder"

      def name(self):
          return "my_geocoder_alg"

      def createInstance(self):
          return MyGeocoderAlgorithm()

      # optionally, the group(), groupId(), tags(), shortHelpString() and other metadata style methods can be overridden and customized:
      def tags(self):
          return 'geocode,my service,batch'
2020-12-14 16:49:48 +10:00
vcloarec
0a2af53c28 fix spelling doc ans SIP 2020-11-10 15:11:48 +01:00
Nyall Dawson
4f6f163ead Move geocoder classes to core 2020-10-30 14:31:04 +10:00
Nyall Dawson
d484beb7f3 Spelling 2020-10-30 09:19:48 +10:00
Nyall Dawson
0725112196 Spelling, since updates 2020-10-30 09:19:48 +10:00
Nyall Dawson
94f3ea0d14 Add interface API for geocoders 2020-10-30 09:19:48 +10:00
Matthias Kuhn
6ec342b4c0 Fix dox 2020-10-22 21:09:49 +02:00
vcloarec
abc112befc typo and spelling 2020-10-19 14:53:08 +10:00
vcloarec
b5c787bd06 fix feedback of TIN mesh creation 2020-10-19 14:53:08 +10:00
Nyall Dawson
746ee315bd Fix boolean literal presentation in dox/PyQGIS docs 2020-10-16 16:03:26 +10:00
vcloarec
89e4d4925a enable QgsMeshTriangulation with SIP and change SIP_CONCAT_PARTS 2020-09-10 20:16:44 -04:00
vcloarec
0f60631711 disable analysis/mesh/QgsMeshTriangulation with SIP 2020-09-10 14:50:25 -04:00
vcloarec
5ffc4f298a some fixes and add tests 2020-09-10 14:03:11 -04:00
vcloarec
07714f3931 port alg to c++
and minor fixes
2020-09-10 14:03:11 -04:00
vcloarec
9db4032d59 fix sip and doc 2020-09-10 14:03:11 -04:00
vcloarec
d2f4c40f8a TIN Mesh creation 2020-09-10 14:03:11 -04:00
Matthias Kuhn
3df789f8ff Sipdate 2020-09-09 19:22:55 +02:00