On Thu, Jul 1, 2010 at 10:23 PM, Thomas Mueller <[email protected]> wrote: > Hi, > >> For some obscure reason the 2d-indexing (getMultiDimensionResult, >> interleave,...) >> only accept positive numbers. > > How could this be fixed? One solution is to "normalize" the values so > that they are between 0 and the maximum number. I have now added a > method to calculate that max value (MultiDimension.getMaxValue(int > dimensions)).
If you try to "normalize" WGS84=lat+lon -coordinates to be positive (Math.abs), 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.
