Opened 5 years ago

Closed 5 years ago

#2185 closed enhancement (fixed)

rasql - project() to specified geo axes resolutions

Reported by: Bang Pham Huu Owned by: apercov
Priority: major Milestone: 10.0
Component: rasql Version: 9.8
Keywords: Cc: Peter Baumann, Vlad Merticariu
Complexity: Medium

Description (last modified by Dimitar Misev)

project operator should support projecting a 2D array to a target CRS with specified axes resolutions for the target CRS (like the -tr option in gdalwarp).

The new project() signature would look like

project( mddExpr, boundsIn, crsIn, boundsOut, crsOut,
         axisResolution1, axisResolution2, resampleAlg, errThreshold )

This should be implemented in qlparser (oql.yy, qtproject.cc).

Change History (14)

comment:1 by Dimitar Misev, 5 years ago

How should the signature of project() look like, what parameters does it have in this case?

comment:2 by Bang Pham Huu, 5 years ago

It can be like this:

project( mddExpr, boundsIn, crsIn, crsOut, geoAxesResolutions )

with geoAxesResolutions: a string pair of 2 values, e.g: "20.3434, 35.324234"

comment:3 by Peter Baumann, 5 years ago

if we know we always have a fixed number of two parameters why not have 2 float numbers:

project( mddExpr, boundsIn, crsIn, crsOut, axisResolution1, axisResolution2 )

comment:4 by Bang Pham Huu, 5 years ago

It should be as one parameter by convention as:

boundsIn - geographic bounding box given as a string of comma-separated
floating-point values of the format: "xmin, ymin, xmax, ymax".

comment:5 by Dimitar Misev, 5 years ago

I'm still not sure why the boundsIn was designed as a string.. wouldn't take it as a model.

Two float parameters sounds good, similar to widthOut and heightOut.

comment:6 by Bang Pham Huu, 5 years ago

Just an opinion: I prefer to group related values as 1 parameter (e.g: boundsIn) as it is getting harder when you have too many parameters to put in this project() operator.

comment:7 by Peter Baumann, 5 years ago

indeed, it's a bad habit and error prone to establish micro syntax. In case of explicit typing the compiler does checks for us, makes it safer.

in reply to:  7 comment:8 by Peter Baumann, 5 years ago

Replying to pbaumann:

indeed, it's a bad habit and error prone to establish micro syntax. In case of explicit typing the compiler does checks for us, makes it safer.

I understand your concern, and we should indeed see that we will not have 20 or more parameters at some time. But I see that we are careful when adding, so let's continue being hesitatnt with adding parameters.

comment:9 by Dimitar Misev, 5 years ago

The problem is that project developed quite a few variants with many parameters; just look at the number of options that gdalwarp has: https://gdal.org/programs/gdalwarp.html

It's becoming kind of similar like the format parameters of encode/decode, I'm inclined to think it will benefit from a similar treatment (key/value pair syntax should be enough).

comment:10 by Peter Baumann, 5 years ago

indeed, saw that now when looking up project() documentation. However, we have started using separate parameters, we should not break that within a given function.

Complication: optional parameters are somewhat involved (such as leaving out parameters earlier in the list than a desired parameter).

comment:11 by Dimitar Misev, 5 years ago

Description: modified (diff)
Owner: changed from Dimitar Misev to dkamov
Status: newassigned

comment:12 by Dimitar Misev, 5 years ago

Owner: changed from dkamov to apercov

comment:13 by apercov, 5 years ago

Status: assignedaccepted

comment:14 by Dimitar Misev, 5 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.