Hi, > If you try to "normalize" WGS84=lat+lon -coordinates to be positive > (Math.abs)
Using Math.abs is the wrong solution of course: it folds negative number to positive number. What I mean with "normalize" is, scale value so that it is between the minimum and maximum. To scale a value x (where -10 <= x <= 10) to (0 <= x2 <= 1000), use the formula: min = -10; max = 10; factor = 1000; x2 = (x - min) / (max - min) * factor; I have added a few helper methods to the MultiDimension tool: http://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/tools/MultiDimension.java Regards, Thomas , you run into > a heap of special cases trying to formulate your bounding-area correctly > along the 0 latitude and 0 longitude -lines. > (geocoordinates are the one most importent use-case for multidimensional > indexing.) > >>> Faced with that we can get our code to work with a minor change to these >>> methods, allowing negative coordinates too. >> >> I didn't fully read the code yet, but I guess you also normalized the values? > > It´s not my code. I´m just the maintainer and asked for the permission to use > a patch submitted by a developer to fix a bug. > >> >>> However since H2 is Apache >>> and our code is GPL, I´d lilke to ask who wrote this particular code and if >>> he/she is fine with including a patched version of >>> addMortonRanges() getMortonRanges() and getMultiDimensionResult() >>> in our code. >> >> I wrote this code, and you can use it. >> >> I guess you need to write somewhere that the code originates from H2, >> and that you have permission to use it. So that others don't think >> that I copied the code from your project to the H2 project... > > Thanks. > No problem there. > > Marcus > > -- > You received this message because you are subscribed to the Google Groups "H2 > Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
