Details
Description
Our Filter Functions could use sin, cos, sqrt, ect. Add to the MakeFunctionClasses.java to autogenerate the additional functions.
-
Hide
- FunctionWriter.zip
- 24/May/06 6:20 PM
- 11 kB
- Chris Holmes
-
- FunctionWriter/.classpath 0.4 kB
- FunctionWriter/.project 0.4 kB
- FunctionWriter/.../MakeFunctionClasses.class 14 kB
- FunctionWriter/.../MakeFunctionClasses.java 16 kB
-
Hide
- math.zip
- 24/May/06 6:20 PM
- 40 kB
- Chris Holmes
-
- math/FilterFunction_abs.java 1 kB
- math/FilterFunction_abs_2.java 1 kB
- math/FilterFunction_abs_3.java 1 kB
- math/FilterFunction_abs_4.java 1 kB
- math/FilterFunction_acos.java 1 kB
- math/FilterFunction_asin.java 1 kB
- math/FilterFunction_atan.java 1 kB
- math/FilterFunction_atan2.java 2 kB
- math/FilterFunction_cbrt.java 1 kB
- math/FilterFunction_ceil.java 1 kB
- math/FilterFunction_cos.java 1 kB
- math/FilterFunction_cosh.java 1 kB
- math/FilterFunction_exp.java 1 kB
- math/FilterFunction_expm1.java 1 kB
- math/FilterFunction_floor.java 1 kB
- math/FilterFunction_hypot.java 2 kB
- math/FilterFunction_IEEEremainder.java 2 kB
- math/FilterFunction_log.java 1 kB
- math/FilterFunction_log10.java 1 kB
- math/FilterFunction_log1p.java 1 kB
- math/FilterFunction_max.java 2 kB
- math/FilterFunction_max_2.java 2 kB
- math/FilterFunction_max_3.java 2 kB
- math/FilterFunction_max_4.java 2 kB
- math/FilterFunction_min.java 2 kB
- math/FilterFunction_min_2.java 2 kB
- math/FilterFunction_min_3.java 2 kB
- math/FilterFunction_min_4.java 2 kB
- math/FilterFunction_pow.java 2 kB
- math/FilterFunction_random.java 1 kB
-
- org.geotools.filter.FunctionExpression
- 24/May/06 6:20 PM
- 7 kB
- Chris Holmes
Issue Links
- is depended upon by
-
GEOS-625
Add support for more Math functions in Filters
-
Activity
Hide
Chris Holmes
added a comment -
Ok, applied this. Was kind of a bitch, the original code was against java 1.5. I never managed to get the code generator running, which I propabaly should have just taken the time to do. But it's done now. Had to change things a bit for trunk and the new experession stuff.
Also deprecated the older min/max functions, since the new ones are better. Also reordered the min functions, so the parameters taken match up with the max ones. r19684 - r19692
Also deprecated the older min/max functions, since the new ones are better. Also reordered the min functions, so the parameters taken match up with the max ones. r19684 - r19692
Show
Chris Holmes
added a comment - Ok, applied this. Was kind of a bitch, the original code was against java 1.5. I never managed to get the code generator running, which I propabaly should have just taken the time to do. But it's done now. Had to change things a bit for trunk and the new experession stuff.
Also deprecated the older min/max functions, since the new ones are better. Also reordered the min functions, so the parameters taken match up with the max ones. r19684 - r19692
Hi Chris.
I managed to check out geotools with the svn plugin for eclipse, but I was
never able to build anything, the mvn install gave me some weired errors
which I couldn't figure out, so I ended up just downloading the soruce
code and settting up my own geotools project in eclipse..
Anyway I managed to get the MakeFunctionClasses work for java.Math, I have
modified it a bit so it also writes a JUnit test to test the functions
that it writes.
I have attatched two zip files, one with the modified function writer,
note that it is not very generic, it works for java.Math to use it on
other classes will mean more modifications.
The other is the result I get from running the function writer, note that
the file FilterFunciton_Test is a JUnit test which tests that the other
functions work.
I have also attached the new service provider file. In this file I have
deleted the MaxFunction and the MinFunction since the FunctionFinder finds
them instead the new ones, not that they are better but my JUnit test
failed because of it and this was the easy solution, there is probably no
need for two Min and Max functions anyway...
Note that some of the java.Math functions exist for different input
arguments, i.e. Math.abs(double d) and Math.abs(float f), in these cases I
have made one FilterFunction for each and just appended _2, _3 or _4 to
their names. I think that people should know what type of input they are
giving to the function and might also need a specific type of output, if
you totally disagree it is very simple to change the FilterFunctions which
are affected, but less simple to make the function writer do this.
I hope that everything makes sense and that you can use some of the work I
have done..
Best Regards............... Kasper Kaergaard