uber / nebula.gl

A suite of 3D-enabled data editing overlays, suitable for deck.gl
https://nebula.gl/
Other
686 stars 166 forks source link

Wrong position of nodes when modifying LineString #865

Open FrancicoVerdu opened 1 year ago

FrancicoVerdu commented 1 year ago

Describe the bug

I have a LineString of about 200 grid elements, when I paste it into the Nebula Editor it is rendered correctly, but when I try to modify the line by adding a new position it is not always generated correctly because editContext.positionIndexes has a wrong value.

Actual Result

Correct location of the new node but misplaced in the array of positions

Expected Result

correct location of the new node and well placed in the array of positions.

Reproduce Steps

GeoJSON to Reproduce { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "stroke": "#ff0000", "stroke-width": 10, "stroke-opacity": 1 }, "geometry": { "type": "LineString", "coordinates": [ [-2.6306586293178778, 41.043328635153024, 0], [-2.628225090250727, 41.05185687392932, 0], [-2.6269009281574527, 41.05204506746415, 0], [-2.582666847794438, 41.05833142647261, 0], [-2.5813426857011637, 41.05851960148588, 0], [-2.581260903125642, 41.05819280131487, 0], [-2.5825850652189164, 41.058004625366664, 0], [-2.6268191455819307, 41.05171823512711, 0], [-2.628143307675205, 41.05153004065738, 0], [-2.628061525099683, 41.05120320576183, 0], [-2.626737363006409, 41.051391401166455, 0], [-2.582503282643394, 41.05767782263705, 0], [-2.5811791205501198, 41.05786599952017, 0], [-2.5810973379745983, 41.057539196101814, 0], [-2.5824215000678725, 41.05735101828377, 0], [-2.626655580430887, 41.05106456558217, 0], [-2.6279797425241616, 41.05087636924265, 0], [-2.6278979599486396, 41.05054953109987, 0], [-2.6265737978553654, 41.05073772837428, 0], [-2.5823397174923506, 41.05702421230683, 0], [-2.5810155553990763, 41.05721239105979, 0], [-2.5809337728235544, 41.05688558439412, 0], [-2.5822579349168286, 41.05669740470621, 0], [-2.626492015279843, 41.05041088954278, 0], [-2.6278161773731172, 41.05022269133347, 0], [-2.6277343947975957, 41.04989584994347, 0], [-2.626410232704321, 41.050084049087666, 0], [-2.5821761523413067, 41.056370595481944, 0], [-2.5808519902480325, 41.056558776104765, 0], [-2.5807702076725105, 41.05623196619176, 0], [-2.5820943697657848, 41.05604378463403, 0], [-2.626328450128799, 41.04975720700895, 0], [-2.6276526122220734, 41.04956900692986, 0], [-2.6275708296465514, 41.04924216229264, 0], [-2.626246667553277, 41.04943036330662, 0], [-2.5820125871902624, 41.05571697216244, 0], [-2.580688425096988, 41.05590515465509, 0], [-2.5806066425214667, 41.05557834149479, 0], [-2.581930804614741, 41.055390158067226, 0], [-2.6261648849777557, 41.04910351798069, 0], [-2.62748904707103, 41.04891531603183, 0], [-2.6274072644955075, 41.048588468147415, 0], [-2.6260831024022333, 41.04877667103117, 0], [-2.581849022039219, 41.05506334234835, 0], [-2.5805248599459447, 41.055251526710826, 0], [-2.5804430773704223, 41.05492471030322, 0], [-2.581767239463697, 41.054736525005815, 0], [-2.6260013198267114, 41.048449822458046, 0], [-2.6273254819199856, 41.048261618639415, 0], [-2.6272436993444637, 41.04793476750782, 0], [-2.6259195372511894, 41.04812297226134, 0], [-2.581685456888175, 41.054409706039664, 0], [-2.580361294794901, 41.054597892271964, 0], [-2.5802795122193785, 41.05427107261707, 0], [-2.5816036743126527, 41.05408288544986, 0], [-2.6258377546756675, 41.04779612044103, 0], [-2.6271619167689417, 41.04760791475263, 0], [-2.6270801341934202, 41.047281060373855, 0], [-2.625755972100146, 41.047469266997126, 0], [-2.5815218917371316, 41.05375606323641, 0], [-2.5801977296438574, 41.053944251338535, 0], [-2.580115947068335, 41.05361742843637, 0], [-2.5814401091616093, 41.05342923939934, 0], [-2.625674189524624, 41.047142411929656, 0], [-2.6269983516178983, 41.046954204371495, 0], [-2.626916569042376, 41.04662734674556, 0], [-2.6255924069491017, 41.046815555238595, 0], [-2.5813583265860878, 41.053102413938625, 0], [-2.580034164492813, 41.05329060391057, 0], [-2.579952381917291, 41.05296377776113, 0], [-2.5812765440105654, 41.05277558685429, 0], [-2.62551062437358, 41.046488696923944, 0], [-2.6268347864668544, 41.04630048749604, 0], [-2.626753003891332, 41.045973626622946, 0], [-2.625428841798058, 41.04616183698572, 0], [-2.5811947614350434, 41.05244875814632, 0], [-2.579870599341769, 41.05263694998806, 0], [-2.579788816766247, 41.05231012059138, 0], [-2.581112978859521, 41.05212192781472, 0], [-2.625347059222536, 41.04583497542393, 0], [-2.62667122131581, 41.045646764126275, 0], [-2.6265894387402886, 41.045319900006035, 0], [-2.6252652766470144, 41.04550811223856, 0], [-2.581031196284, 41.051795095859504, 0], [-2.579707034190726, 41.051983289571055, 0], [-2.5796252516152034, 41.05165645692712, 0], [-2.5809494137084776, 41.05146826228067, 0], [-2.6251834940714924, 41.04518124742962, 0], [-2.6265076561647667, 41.04499303426222, 0], [-2.6264258735892447, 41.04466616689484, 0], [-2.6251017114959705, 41.0448543809971, 0], [-2.580867631132956, 41.051141427078214, 0], [-2.579543469039682, 41.05132962265955, 0], [-2.5794616864641595, 41.05100278676838, 0], [-2.5807858485574338, 41.05081459025214, 0], [-2.6250199289204486, 41.04452751294102, 0], [-2.626344091013723, 41.04433929790389, 0], [-2.6262623084382004, 41.04401242728939, 0], [-2.624938146344926, 41.04420064326138, 0], [-2.580704065981912, 41.05048775180246, 0], [-2.5793799038886376, 41.05067594925359, 0], [-2.579298121313116, 41.05034911011519, 0], [-2.5806222834063903, 41.050160911729165, 0], [-2.624856363769405, 41.043873771958175, 0], [-2.6261805258626794, 41.043685555051326, 0], [-2.626098743287157, 41.04335868118971, 0], [-2.6247745811938827, 41.043546899031426, 0], [-2.5805405008308684, 41.04983407003227, 0], [-2.579216338737594, 41.050022269353185, 0], [-2.579134556162072, 41.049695426967574, 0], [-2.5804587182553465, 41.04950722671177, 0], [-2.624692798618361, 41.043220024481116, 0], [-2.6260169607116355, 41.04303180570454, 0], [-2.625935178136113, 41.04270492859581, 0], [-2.624611016042839, 41.04289314830726, 0], [-2.580376935679824, 41.049180381767655, 0], [-2.57905277358655, 41.04936858295835, 0], [-2.578970991011028, 41.049041737325524, 0], [-2.580295153104302, 41.04885353519995, 0], [-2.624529233467317, 41.04256627050983, 0], [-2.625853395560591, 41.04237804986354, 0], [-2.6257716129850692, 41.04205116950772, 0], [-2.6244474508917945, 41.04223939108887, 0], [-2.58021337052878, 41.048526687008646, 0], [-2.578889208435506, 41.048714890069114, 0], [-2.5788074258599845, 41.0483880411891, 0], [-2.5801315879532587, 41.04819983719375, 0], [-2.624365668316273, 41.04191251004436, 0], [-2.6256898304095473, 41.04172428752837, 0], [-2.6256080478340253, 41.04139740392546, 0], [-2.624283885740751, 41.041585627376314, 0], [-2.5800498053777368, 41.04787298575526, 0], [-2.578725643284462, 41.048061190685495, 0], [-2.5786438607089406, 41.0477343385583, 0], [-2.579968022802215, 41.047546132693185, 0], [-2.624202103165229, 41.041258743084725, 0], [-2.6255262652585034, 41.041070518699016, 0], [-2.6254444826829815, 41.04074363184905, 0], [-2.6241203205897072, 41.040931857169596, 0], [-2.5798862402266924, 41.04721927800752, 0], [-2.578562078133418, 41.047407484807515, 0], [-2.5784802955578963, 41.04708062943314, 0], [-2.579804457651171, 41.046892421698274, 0], [-2.624038538014185, 41.040604969630934, 0], [-2.625362700107459, 41.04041674337553, 0], [-2.625280917531938, 41.04008985327849, 0], [-2.623956755438664, 41.04027808046875, 0], [-2.579722675075649, 41.04656556376545, 0], [-2.5783985129823748, 41.046753772435196, 0], [-2.578316730406853, 41.046426913813654, 0], [-2.579640892500127, 41.04623870420903, 0], [-2.6238749728631414, 41.03995118968302, 0], [-2.6251991349564157, 41.039762961557926, 0], [-2.625117352380894, 41.03943606821383, 0], [-2.62379319028762, 41.03962429727377, 0], [-2.579559109924605, 41.04591184302905, 0], [-2.578234947831331, 41.046100053568544, 0], [-2.578153165255809, 41.04577319169985, 0], [-2.579477327349083, 41.04558498022549, 0], [-2.6237114077120975, 41.039297403240994, 0], [-2.625035569805372, 41.03910917324621, 0], [-2.62495378722985, 41.03878227665508, 0], [-2.6236296251365756, 41.0389705075847, 0], [-2.579395544773561, 41.045258115798354, 0], [-2.5780713826802866, 41.04544632820759, 0], [-2.577989600104765, 41.04511946309176, 0], [-2.5793137621980393, 41.044931249747655, 0], [-2.6235478425610537, 41.03864361030488, 0], [-2.624872004654328, 41.03845537844042, 0], [-2.6247902220788064, 41.038128478602246, 0], [-2.623466059985532, 41.038316711401556, 0], [-2.5792319796225174, 41.04460438207339, 0], [-2.577907817529243, 41.044792596352366, 0], [-2.5778260349537216, 41.044465727989405, 0], [-2.579150197046996, 41.04427751277556, 0], [-2.6233842774100102, 41.037989810874706, 0], [-2.6247084395032845, 41.03780157714058, 0], [-2.6246266569277625, 41.037474674055375, 0], [-2.6233024948344883, 41.03766290872435, 0], [-2.5790684144714735, 41.04395064185418, 0], [-2.5777442523781993, 41.044138858002874, 0], [-2.5776624698026773, 41.04381198639278, 0], [-2.5789866318959516, 41.04362376930923, 0], [-2.623220712258966, 41.03733600495049, 0], [-2.62454487435224, 41.037147769346674, 0], [-2.6244630917767187, 41.036820863014476, 0], [-2.623138929683444, 41.03700909955312, 0], [-2.5789048493204296, 41.04329689514072, 0], [-2.5775806872271554, 41.04348511315915, 0], [-2.5774989046516334, 41.04315823830194, 0], [-2.5788230667449077, 41.042970019348665, 0], [-2.6230571471079225, 41.03668219253224, 0], [-2.6243813092011967, 41.03649395505877, 0], [-2.624299526625675, 41.036167045479566, 0], [-2.6229753645324005, 41.036355283887865, 0], [-2.578741284169386, 41.042643141933056, 0], [-2.577417122076112, 41.04283136182119, 0], [-2.5773353395005896, 41.0425044837169, 0], [-2.578659501593864, 41.0423162628939, 0], [-2.6228935819568786, 41.03602837361999, 0], [-2.624217744050153, 41.03584013427686, 0], [-2.624135961474631, 41.035513221450664, 0], [-2.6228117993813567, 41.035701461728614, 0], [-2.578577719018342, 41.0419893822312, 0], [-2.5772535569250676, 41.04217760398906, 0], [-2.5771717743495457, 41.04185072263766, 0], [-2.57849593644282, 41.041662499944955, 0], [-2.6227300168058343, 41.03537454821375, 0], [-2.6240541788991085, 41.035186307000984, 0], [-2.623972396323587, 41.03485939092781, 0], [-2.622648234230313, 41.03504763307539, 0], [-2.578414153867298, 41.04133561603517, 0], [-2.5770899917740238, 41.04152383966273, 0], [-2.6314109404655337, 41.04800624893308, 0] ] } } ] }

Screenshots

I have recorded a short video to show the problem ScreenVideo

To Do List

FrancicoVerdu commented 1 year ago

I have been able to verify that this error only occurs when the coordinates have a third component, even if it is equal to 0. Unfortunately, I need this third coordinate because in my project it will not always be 0.

ayushanand18 commented 1 year ago

I have been able to verify that this error only occurs when the coordinates have a third component, even if it is equal to 0. Unfortunately, I need this third coordinate because in my project it will not always be 0.

By "third component" do you mean using vertical datum apart from the longitudes and latitudes?

FrancicoVerdu commented 1 year ago

He podido comprobar que este error solo ocurre cuando las coordenadas tienen una tercera componente, aunque sea igual a 0. Lamentablemente necesito esta tercera coordenada porque en mi proyecto no siempre será 0.

¿Por "tercer componente" quiere decir usar datum vertical además de las longitudes y latitudes?

Indeed, when the coordinates are in the format [ longitude, latitude, elevation]