(Not Signed In)

Sign In

.NET Development: Feature request: DataType.Double for transactional repository

Bottom of Page

1 to 3 of 3

  1.  
    • CommentAuthorbleach
    • CommentTimeJan 22nd 2010
     
    This is regarding the transactional repository in the Telogis.GeoBase.Transactional namespace.

    Only five data types are currently supported: Integer, LatLon, Polygon, String, and Time. It doesn't really seem to make sense for Double to be missing from this, especially since so much geographical data is stored as such (and since the underlying DB supports it).

    Also, there is a DataType.Unknown, but it doesn't seem to be usable for anything, storing data to a field set to unknown will just throw an exception.

    Thanks!
    •  
      CommentAuthorPepitaL
    • CommentTimeJan 24th 2010
     
    Hi Brandur,

    You are correct, Transactional should support Double type and Unknown should not throw exception.
    For those both cases I made a request in order to fix them.

    Thanks for reporting it.

    Pepita
    • CommentAuthorwpearse
    • CommentTimeJan 25th 2010 edited
     
    Hey bleach,

    I haven't done any performance testing, but you *can* store your doubles as DataType.String and still use your rangefilter and equalfilter (and probably all the other columnfilters). If you do investigate this further please let me know what the performance is like...

    /William

    Here's how I inserted the records:

    Table myTable = tr.CreateTable("mytable")
    myTable.AddField("double", DataType.String);
    myTable.AddField("location", DataType.LatLon);
    ...
    Record r = myTable.CreateRecord();
    r["double"] = String.Format("{0:0.00}", rand.NextDouble() * 100); // eg "12.34"
    ...

    And here's how I queried them:

    RangeFilter rf = new RangeFilter("double", "10.0", "40.0"); // select rows where 10.0 < double < 40.0
    ColumnFilter[] filters = new ColumnFilter[1] { rf };
    Index idx = myTable.Indexes["double_and_location"];
    ...
    foreach (Record r in idx.Query(filters)) {
    Console.WriteLine("Double = {0}, Location = {1}", r["double"], r["location"]);
    }

    Here's the output from my program:

    Creating transactional repository structure
    Creating records...
    61.90 @ (33.6672400812686,-114.718214059256)
    86.05 @ (35.1261526978881,-116.092698055253)
    31.47 @ (34.9764638415756,-115.769224604749)
    99.84 @ (35.6185320808953,-113.925985465256)
    19.75 @ (35.2256676635278,-114.746235270019)
    50.93 @ (35.6208505195941,-115.376606374639)
    47.03 @ (36.1325374083453,-113.790873921626)
    16.09 @ (35.5761138224469,-116.177249919425)
    77.34 @ (33.9428257138987,-116.614782979779)
    5.57 @ (35.1532583515785,-115.841190457588)
    73.62 @ (35.0272484825088,-115.074708643167)
    76.43 @ (34.3858904455867,-114.982854101407)
    10.49 @ (35.1633623160943,-117.134038334061)
    12.91 @ (35.0643370325119,-115.500625052088)
    39.81 @ (33.6569329719131,-115.459027217693)
    54.60 @ (35.683318398812,-115.793224544297)
    67.93 @ (35.2679297239591,-115.095449688633)
    80.72 @ (35.3616229747567,-115.461966727569)
    10.20 @ (34.334562108111,-115.539231837923)
    60.56 @ (35.0865162067964,-115.439700404751)
    Table contains these filtered records:
    Double = 16.09, Location = 35.576114,-116.177250
    Double = 31.47, Location = 34.976464,-115.769224
    Double = 19.75, Location = 35.225668,-114.746235
    Double = 10.49, Location = 35.163363,-117.134038
    Double = 12.91, Location = 35.064337,-115.500625
    Double = 39.81, Location = 33.656933,-115.459027
    Double = 10.2, Location = 34.334563,-115.539231

1 to 3 of 3

  1.