{"action":"created","issue":{"url":"https://api.github.com/repos/DistanceDevelopment/readdst/issues/16","labels_url":"https://api.github.com/repos/DistanceDevelopment/readdst/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/DistanceDevelopment/readdst/issues/16/comments","events_url":"https://api.github.com/repos/DistanceDevelopment/readdst/issues/16/events","html_url":"https://github.com/DistanceDevelopment/readdst/issues/16","id":120333788,"number":16,"title":"Deal with unit conversion","user":{"login":"dill","id":1953,"avatar_url":"https://avatars.githubusercontent.com/u/1953?v=3","gravatar_id":"","url":"https://api.github.com/users/dill","html_url":"https://github.com/dill","followers_url":"https://api.github.com/users/dill/followers","following_url":"https://api.github.com/users/dill/following{/other_user}","gists_url":"https://api.github.com/users/dill/gists{/gist_id}","starred_url":"https://api.github.com/users/dill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dill/subscriptions","organizations_url":"https://api.github.com/users/dill/orgs","repos_url":"https://api.github.com/users/dill/repos","events_url":"https://api.github.com/users/dill/events{/privacy}","received_events_url":"https://api.github.com/users/dill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dill","id":1953,"avatar_url":"https://avatars.githubusercontent.com/u/1953?v=3","gravatar_id":"","url":"https://api.github.com/users/dill","html_url":"https://github.com/dill","followers_url":"https://api.github.com/users/dill/followers","following_url":"https://api.github.com/users/dill/following{/other_user}","gists_url":"https://api.github.com/users/dill/gists{/gist_id}","starred_url":"https://api.github.com/users/dill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dill/subscriptions","organizations_url":"https://api.github.com/users/dill/orgs","repos_url":"https://api.github.com/users/dill/repos","events_url":"https://api.github.com/users/dill/events{/privacy}","received_events_url":"https://api.github.com/users/dill/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-12-04T05:01:30Z","updated_at":"2015-12-06T10:59:12Z","closed_at":null,"body":"Quantities stored in Distance can be in different (non-SI) units. For example for one project:\r\n\r\n```\r\n> db$DataFields\r\n       LayerName     FieldName     TableName FieldType       Units OrdinalPosition ColumnWidth Tag Formula\r\n1  Line transect            ID Line transect        10                           1           0  NA      NA\r\n2  Line transect         Label Line transect        12                           3           0  NA      NA\r\n3  Line transect   Line length Line transect         2        Mile               4           0  NA      NA\r\n4  Line transect      ParentID Line transect        11                           2           0  NA      NA\r\n5    Observation          Hour   Observation         2                           5           0  NA      NA\r\n6    Observation            ID   Observation        10                           1           0  NA      NA\r\n7    Observation         MSTDO   Observation         2                           4           0  NA      NA\r\n8    Observation      ParentID   Observation        11                           2           0  NA      NA\r\n9    Observation Perp distance   Observation         2   Kilometer               3           0  NA      NA\r\n10        Region          Area        Region         2 Square mile               4           0  NA      NA\r\n11        Region            ID        Region        10                           1           0  NA      NA\r\n12        Region         Label        Region        12                           3           0  NA      NA\r\n13        Region      ParentID        Region        11                           2           0  NA      NA\r\n14    Study area            ID    Study area        10                           1           0  NA      NA\r\n15    Study area         Label    Study area        12                           2           0  NA      NA\r\n```\r\n\r\nIndicating lines were measured in miles, perpendicular distances in kilometres and the region in square miles (:fire::fire::computer::fire::fire:).\r\n\r\n`readdst` should deal with this and be able to calculate abundances and densities appropriately.\r\n\r\nThe `ProjectSettingsNumber` table in the `DistIni.mdb` file has conversions. For example for linear units:\r\n\r\n```\r\n> subset(db$ProjectSettingsNumber, Section==\"LinUnit\")\r\n    Section                      Key      Setting\r\n372 LinUnit               Centimeter    0.0100000\r\n373 LinUnit               Centimetre    0.0100000\r\n374 LinUnit         Chain (Benoit A)   20.1167824\r\n375 LinUnit           Chain (Benoit)   20.1167825\r\n376 LinUnit           Chain (Clarke)   20.1166195\r\n377 LinUnit            Chain (Sears)   20.1167651\r\n378 LinUnit        Chain (US Survey)   20.1168402\r\n379 LinUnit                   Fathom    1.8288000\r\n380 LinUnit                     Foot    0.3048000\r\n381 LinUnit              Foot (1865)    0.3048008\r\n382 LinUnit          Foot (Benoit A)    0.3047997\r\n383 LinUnit          Foot (Benoit B)    0.3047997\r\n384 LinUnit            Foot (Clarke)    0.3047973\r\n385 LinUnit        Foot (Gold Coast)    0.3047997\r\n386 LinUnit       Foot (Indian 1937)    0.3047984\r\n387 LinUnit       Foot (Indian 1962)    0.3047996\r\n388 LinUnit       Foot (Indian 1975)    0.3047995\r\n389 LinUnit            Foot (Indian)    0.3047995\r\n390 LinUnit Foot (Modified American)    0.3048123\r\n391 LinUnit             Foot (Sears)    0.3047995\r\n392 LinUnit         Foot (US Survey)    0.3048006\r\n393 LinUnit                  Furlong  201.1680000\r\n394 LinUnit                     Inch    0.0254000\r\n395 LinUnit                Kilometer 1000.0000000\r\n396 LinUnit                Kilometre 1000.0000000\r\n397 LinUnit                     Link    0.2011662\r\n398 LinUnit          Link (Benoit A)    0.2011678\r\n399 LinUnit            Link (Benoit)    0.2011678\r\n400 LinUnit             Link (Sears)    0.2011677\r\n401 LinUnit         Link (US Survey)    0.2011684\r\n402 LinUnit                    Meter    1.0000000\r\n403 LinUnit                    Metre    1.0000000\r\n404 LinUnit           Metre (German)    1.0000014\r\n405 LinUnit                     Mile 1609.3440000\r\n406 LinUnit         Mile (US Survey) 1609.3472187\r\n407 LinUnit               Millimeter    0.0010000\r\n408 LinUnit               Millimetre    0.0010000\r\n409 LinUnit            Nautical Mile 1852.0000000\r\n410 LinUnit                      Rod    5.0292000\r\n411 LinUnit                     Yard    0.9144000\r\n412 LinUnit          Yard (Benoit A)    0.9143992\r\n413 LinUnit          Yard (Benoit B)    0.9143992\r\n414 LinUnit            Yard (Clarke)    0.9143918\r\n415 LinUnit       Yard (Indian 1937)    0.9143952\r\n416 LinUnit       Yard (Indian 1962)    0.9143988\r\n417 LinUnit       Yard (Indian 1975)    0.9143985\r\n418 LinUnit            Yard (Indian)    0.9143986\r\n419 LinUnit             Yard (Sears)    0.9143984\r\n```\r\n\r\n and the following from the developer manual seems useful:\r\n\r\n![screen shot 2015-12-03 at 23 55 37](https://cloud.githubusercontent.com/assets/1953/11582211/a83c669c-9a19-11e5-853a-bb5e8644fe14.png)\r\n\r\nSo during the `convert_project` stage, the units should be switched to SI.\r\n"},"comment":{"url":"https://api.github.com/repos/DistanceDevelopment/readdst/issues/comments/162303491","html_url":"https://github.com/DistanceDevelopment/readdst/issues/16#issuecomment-162303491","issue_url":"https://api.github.com/repos/DistanceDevelopment/readdst/issues/16","id":162303491,"user":{"login":"erex","id":330744,"avatar_url":"https://avatars.githubusercontent.com/u/330744?v=3","gravatar_id":"","url":"https://api.github.com/users/erex","html_url":"https://github.com/erex","followers_url":"https://api.github.com/users/erex/followers","following_url":"https://api.github.com/users/erex/following{/other_user}","gists_url":"https://api.github.com/users/erex/gists{/gist_id}","starred_url":"https://api.github.com/users/erex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erex/subscriptions","organizations_url":"https://api.github.com/users/erex/orgs","repos_url":"https://api.github.com/users/erex/repos","events_url":"https://api.github.com/users/erex/events{/privacy}","received_events_url":"https://api.github.com/users/erex/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T10:59:11Z","updated_at":"2015-12-06T10:59:11Z","body":"Looking good.  The CvM P-value will always disagree because DisWin simply does a table lookup so P-values are only recorded to the nearest 0.1.  I can't sort out how tolerance is calculated\r\n\r\n```\r\n tolerance = as.numeric(x[5]))\r\n```\r\n\r\nbut I think it could be relaxes to the point where a P-value of 0.13996 is considered equivalent to 0.14000"}}