text: [{"Owner":"m.ali","Date":"2017-07-19T11:47:53Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHi_co_ I need help in the following problem_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI am working on a GIS solution and my objective is to create an automation system that accepts an array of coordinates (lat\\lng) and outputs a maquette. i.e_sm_ I am adding a virtual 3d dimension to the array of points (lat\\lng). The problem is when plotting the geographic coordinates array_co_ the result looks like a one point because it_t_s geographic and the distance on earth is very small. What I want is a way to plot the geographic coordinates on the world space but outputs a real corresponding 3d geometry. \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\there is the array of lats-lngs_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t[50.030462313669034_co_ 26.467167212377877]_co__lt_br /_gt_\n\t[50.03022756277145_co_ 26.467086619328583]_co__lt_br /_gt_\n\t[50.03012167613479_co_ 26.467340955119003]_co__lt_br /_gt_\n\t[50.03035641750763_co_ 26.46742153925565]_co__lt_br /_gt_\n\t[50.030462313669034_co_ 26.467167212377877]\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tNote that the difference between the first X and the second X is very small that equals _eq_&gt_sm_ 0.00023 that when plotting it on BABYLON space looks if the first and second point are the same.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI have tried a lot of mathematical normalization ways_co_ to fix this but in vain.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_qt_my only condition is to preserve the ratio of objects positions_qt_.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIf any mate can help or suggests a solution. I would be very grateful. Thanks in advance.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"max123","Date":"2017-07-19T12:24:49Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tJust a thought_dd_ if coordinates a so close_co_ can_t_t you simply discard integers and a couple of floating values and deal with remaining values?_lt_br /_gt_\n\tE.g_dd__lt_br /_gt_\n\t50.030_lt_strong_gt_462_lt_/strong_gt_313669034 -&gt_sm_ 4.6_lt_br /_gt_\n\t50.030_lt_strong_gt_227_lt_/strong_gt_56277145 -&gt_sm_ 2.3\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Samuel Girardin","Date":"2017-07-19T12:58:37Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\thi _lt_span_gt__lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/27747-mali/?do_eq_hovercard_qt_ data-mentionid_eq__qt_27747_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/27747-mali/_qt_ rel_eq__qt__qt__gt_@m.ali_lt_/a_gt__lt_/span_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\thi you can try that  _dd_ _lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#4E3KJK%232_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#4E3KJK#2_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIt comes from BING map API. Works like a charm.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_pre_gt_\n_lt_code_gt_\nvar levelOfDetail _eq_ 18 //between 1 and 22 give your lat long in pixel in map tile. You can use that \n//to got some correct 2d value for positionning your object\n// 1 is 782715170 meters/pixel\n// 22 is 0.0373 meter/pixel\n// 18 p1.subtract(p2) give me something like (-15_co_68) _co_ you can work with that\n// 20 more precise give (-60 _co_ 272) .\n\n\n\n\nvar a_eq_   LatLongToPixelXY(50.030462313669034_co_ 26.467167212377877_co_levelOfDetail) _sm_ \nvar b _eq_  LatLongToPixelXY(50.03022756277145_co_ 26.467086619328583_co_levelOfDetail) _sm_ \n  \nconsole.log(b.subtract(a)) _sm_ \n\n\nvar  clip _eq_ function (n_co_ minValue_co_ maxValue) {\n        return Math.min(Math.max(n_co_ minValue)_co_ maxValue)_sm_\n    }\n\n\n     var  mapSize _eq_ function(levelOfDetail) {\n        return 256 &lt_sm_&lt_sm_ levelOfDetail_sm_\n    }\n\nvar MinLatitude _eq_ -85.05112878_sm_\nvar MaxLatitude _eq_ 85.05112878_sm_\nvar MinLongitude _eq_ -180_sm_\nvar MaxLongitude _eq_ 180_sm_\n\n var LatLongToPixelXY_eq_function(latitude_co_ longitude_co_ levelOfDetail) {\n\n        latitude _eq_ clip(latitude_co_ MinLatitude_co_ MaxLatitude)_sm_\n        longitude _eq_ clip(longitude_co_ MinLongitude_co_ MaxLongitude)_sm_\n\n        var x _eq_ (longitude + 180) / 360_sm_\n        var sinLatitude _eq_ Math.sin(latitude * Math.PI / 180)_sm_\n        var y _eq_ 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI)_sm_\n\n        var mapsize _eq_ mapSize(levelOfDetail)_sm_\n        var pixelX _eq_ clip(x * mapsize + 0.5_co_ 0_co_ mapsize - 1)_sm_\n        var pixelY _eq_ clip(y * mapsize + 0.5_co_ 0_co_ mapsize - 1)_sm_\n        console.log(_qt_x_qt__co_pixelX) _sm_\n        console.log(_qt_y_qt__co_pixelY) _sm_\n        console.log(_qt______________qt_) _sm_\n        return new BABYLON.Vector2(pixelX_co_ pixelY)_sm_\n\n    }_sm__lt_/code_gt__lt_/pre_gt_\n\n_lt_p_gt_\n\tsam\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"m.ali","Date":"2017-07-19T13:47:16Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t_lt_span_gt__lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/23143-max123/?do_eq_hovercard_qt_ data-mentionid_eq__qt_23143_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/23143-max123/_qt_ rel_eq__qt__qt__gt_@max123_lt_/a_gt_ _lt_/span_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_span_gt_Thanks. But It does not work. I have tried it before_co_ and this actually results distortions._lt_/span_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"m.ali","Date":"2017-07-19T13:54:11Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_h3 style_eq__qt_color_dd_#000000_sm__qt__gt_\n\tThanks @Samuel Girardin\n_lt_/h3_gt_\n\n_lt_div_gt_\n\tBut it is actually does not work_co_ I tell you why _eq_&gt_sm_ _lt_br /_gt_\n\tThe code you wrote converts _lt_strong_gt_geographic coordinates_lt_/strong_gt_ into _lt_strong_gt_screen point coordinates_lt_/strong_gt_ \n_lt_/div_gt_\n\n_lt_div_gt_\n\tand this results points that when plotting them they look like if the 4 points are the same point. \n_lt_/div_gt_\n\n_lt_div_gt_\n\tYou can examine it yourself. Use this online tool _lt_a href_eq__qt_https_dd_//technology.cpm.org/general/3dgraph/_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//technology.cpm.org/general/3dgraph/_lt_/a_gt_ to plot the resulted points and watch it yourself. Thanks in advance\n_lt_/div_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Samuel Girardin","Date":"2017-07-19T14:41:18Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t_lt_span_gt__lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/27747-mali/?do_eq_hovercard_qt_ data-mentionid_eq__qt_27747_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/27747-mali/_qt_ rel_eq__qt__qt__gt_@m.ali_lt_/a_gt_  It actually works. Here is a castel  _dd_ _lt_a href_eq__qt_https_dd_//www.google.fr/maps/place/47%C2%B036%2759.5%22N+1%C2%B031%2701.3%22E/@47.6165278_co_1.5164806_co_19z/data_eq_!3m1!4b1!4m5!3m4!1s0x0_dd_0x0!8m2!3d47.616522!4d1.517033_qt_ rel_eq__qt_external nofollow_qt__gt_maps_lt_/a_gt_    _lt_/span_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI get quickly the lat/loncoordinates of the 8 towers. Here is the playground _dd_ _lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#4E3KJK%235_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#4E3KJK#5_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"JohnK","Date":"2017-07-19T15:03:31Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_182317_qt_ data-ipsquote-contentid_eq__qt_31733_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1500467089_qt_ data-ipsquote-userid_eq__qt_23143_qt_ data-ipsquote-username_eq__qt_max123_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t2 hours ago_co_ max123 said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\tJust a thought_dd_ if coordinates a so close_co_ can_t_t you simply discard integers and a couple of floating values and deal with remaining values?_lt_br /_gt_\n\t\t\tE.g_dd__lt_br /_gt_\n\t\t\t50.030_lt_strong_gt_462_lt_/strong_gt_313669034 -&gt_sm_ 4.6_lt_br /_gt_\n\t\t\t50.030_lt_strong_gt_227_lt_/strong_gt_56277145 -&gt_sm_ 2.3\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_blockquote class_eq__qt_ipsQuote_qt_ data-ipsquote_eq__qt__qt_ data-ipsquote-contentapp_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentcommentid_eq__qt_182327_qt_ data-ipsquote-contentid_eq__qt_31733_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-timestamp_eq__qt_1500472036_qt_ data-ipsquote-userid_eq__qt_27747_qt_ data-ipsquote-username_eq__qt_m.ali_qt__gt_\n\t_lt_div class_eq__qt_ipsQuote_citation_qt__gt_\n\t\t1 hour ago_co_ m.ali said_dd_\n\t_lt_/div_gt_\n\n\t_lt_div class_eq__qt_ipsQuote_contents_qt__gt_\n\t\t_lt_p_gt_\n\t\t\t_lt_span_gt__lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/23143-max123/?do_eq_hovercard_qt_ data-mentionid_eq__qt_23143_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/23143-max123/_qt_ rel_eq__qt__qt__gt_@max123_lt_/a_gt_ _lt_/span_gt_\n\t\t_lt_/p_gt_\n\n\t\t_lt_p_gt_\n\t\t\t_lt_span_gt_Thanks. But It does not work. I have tried it before_co_ and this actually results distortions._lt_/span_gt_\n\t\t_lt_/p_gt_\n\t_lt_/div_gt_\n_lt_/blockquote_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tThe idea of looking at what is happening several decimal places in is sound. However just throwing away the leading figures will not work as you could be disregarding different quantities each time. You need to subtract a consistent quantity each time before scaling up.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//www.babylonjs-playground.com/#YCF2QS_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//www.babylonjs-playground.com/#YCF2QS_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"m.ali","Date":"2017-07-20T06:34:42Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t_lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/2211-samuel-girardin/?do_eq_hovercard_qt_ data-mentionid_eq__qt_2211_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/2211-samuel-girardin/_qt_ rel_eq__qt__qt__gt_@Samuel Girardin_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI am very very grateful to you. It helped me. Working like charm my friend.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/14282-johnk/?do_eq_hovercard_qt_ data-mentionid_eq__qt_14282_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/14282-johnk/_qt_ rel_eq__qt__qt__gt_@JohnK_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tThanks. You have provided me with an alternative working &amp_sm_ helpful workaround.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tI am very thanksful to you both.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tGoodbye\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]