Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading WKT with data outside of it's projection should show user error, not crash. #93

Open
michaelkirk opened this issue Oct 5, 2022 · 6 comments

Comments

@michaelkirk
Copy link
Contributor

michaelkirk commented Oct 5, 2022

edit: This only seems to occurs when the uploaded data is invalid for the assumed projection.

The app becomes unresponsive after trying to load a WKT layer from file.

wkt-save-hangs.mov.mp4

The actual crash seems to be:

panicked at 'called `Option::unwrap()` on a `None` value', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/earcutr-0.2.0/src/lib.rs:723:59

With the full log:

[Log] INFO /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.8.1/src/renderer/mod.rs:106 AdapterInfo { name: "Apple GPU", vendor: 0, device: 0, device_type: Other, backend: Gl }
[Error] Error importing `index.js`: – Error: Using exceptions for control flow, don't mind me. This isn't actually an error!
Error: Using exceptions for control flow, don't mind me. This isn't actually an error!
	(anonymous function)
	promiseReactionJob
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:45 Starting job 'Opening file'
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:47 Completed job 'Opening file' in 7.391s
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:75 Job finished
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:45 Starting job 'Loading WKT file'
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:47 Completed job 'Loading WKT file' in 1ms
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:75 Job finished
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:45 Starting job 'Projecting layer'
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:47 Completed job 'Projecting layer' in 2ms
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:75 Job finished
[Log] INFO /home/runner/.cargo/git/checkouts/bevy_jobs-4f1eee6189065025/b1261ab/src/lib.rs:45 Starting job 'Building Bevy meshes'
[Error] panicked at 'called `Option::unwrap()` on a `None` value', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/earcutr-0.2.0/src/lib.rs:723:59

Stack:

__wbg_new_abda76e883ba8a5f@
__wbg_new_abda76e883ba8a5f@https://rgis.app/bootstrap.js:98:103
wasm-stub@[wasm code]
<?>.wasm-function[11828]@[wasm code]
<?>.wasm-function[4989]@[wasm code]
<?>.wasm-function[9079]@[wasm code]
<?>.wasm-function[8759]@[wasm code]
<?>.wasm-function[566]@[wasm code]
<?>.wasm-function[505]@[wasm code]
<?>.wasm-function[1371]@[wasm code]
<?>.wasm-function[654]@[wasm code]
<?>.wasm-function[3097]@[wasm code]
<?>.wasm-function[9843]@[wasm code]
wasm-stub@[native code]
__wbg_adapter_64@
real@
promiseReactionJob@[native code]


	__wbg_error_f851667af71bcfc6 (rgis_bg.js:808)
	__wbg_error_f851667af71bcfc6 (bootstrap.js:104:106)
	wasm-stub
	<?>.wasm-function[11828]
	<?>.wasm-function[4989]
	<?>.wasm-function[9079]
	<?>.wasm-function[8759]
	<?>.wasm-function[566]
	<?>.wasm-function[505]
	<?>.wasm-function[1371]
	<?>.wasm-function[654]
	<?>.wasm-function[3097]
	<?>.wasm-function[9843]
	wasm-stub
	__wbg_adapter_64 (rgis_bg.js:654:176)
	real (rgis_bg.js:615)
	promiseReactionJob
[Error] Unhandled Promise Rejection: RuntimeError: Unreachable code should not be executed (near '..._h2f23d00947d0ff9d"](arg0, arg1, addHeap...')
	<?>.wasm-function[4989]
	<?>.wasm-function[9079]
	<?>.wasm-function[8759]
	<?>.wasm-function[566]
	<?>.wasm-function[505]
	<?>.wasm-function[1371]
	<?>.wasm-function[654]
	<?>.wasm-function[3097]
	<?>.wasm-function[9843]
	wasm-stub
	__wbg_adapter_64 (rgis_bg.js:654:176)
	real (rgis_bg.js:615)
	promiseReactionJob
[Log] ERROR  No work has been submitted for this frame log.target = "wgpu_core::present"; (x985)
log.module_path = "wgpu_core::present";
log.file = "/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.13.2/src/present.rs";
log.line = 308;
@frewsxcv
Copy link
Owner

@michaelkirk Can you try this again with your WKT file?

@michaelkirk
Copy link
Contributor Author

Still not working for me - I get the same behavior as before, dumping the same log message as before.

@michaelkirk
Copy link
Contributor Author

Contents of my WKT file:

POLYGON((367.67936762793977 302.785219017324,400 330.3364189888756,400 85.7094729663055,375.530089594595 124.2204839556052,374.98659859747573 100.58888400844128,375.3219047536835 76.99586322948593,352.116978342238 128.0069901264593,296.8607072090515 129.49256607782735,266.8397653781389 154.40474480753,259.2004570591687 144.14650678216447,247.73005601682144 120.74050514867251,219.9183226476331 53.89398800789357,214.79766598486256 58.54396880088095,205.3180727584858 37.66458141235276,204.9384743502853 42.52909575499811,198.598592783954 39.913773753454365,227.5571963507852 98.78793110381741,211.8877775129764 95.80693442569219,184.82983774975878 111.82526107380869,157.3407287714804 79.95610899189123,146.98556814305613 90.1306295921712,142.86571296028092 103.2131667249273,137.06964785547663 97.97823184186473,133.11594113032265 121.5727268145846,121.48741956113471 112.97229086146046,121.26181604684658 113.86710164957617,235.63037504441513 197.77142864845837,222.76475236003864 233.7471699986308,215.48785333121916 232.73364849354883,177.32511967843928 245.4303896678587,96.36950989237457 246.12195328963338,96.33638429757961 248.20750628598208,66.27444465680952 250.87823764635957,0.00000000000005684341886080802 252.7246858385403,0 287.00851453579764,87.0909970255105 274.6019377637631,203.35149933375834 279.95282911519445,186.21553206604779 286.312588294279,200.37329511724553 288.3389752542301,204.07584923592933 288.2701221108328,208.48923723966695 286.23369014455,212.24082541367974 285.47846008552216,213.481559734292 289.176602821379,168.6386654992429 312.61353982953256,162.45878409633931 319.40542293651487,93.1525434103433 357.43372298059234,91.50558129979011 359.2500343818318,91.43334419528333 363.2318140095328,178.69748010894065 313.3107247292978,201.68701198375604 314.2277627894801,217.6731029946546 302.77563506887896,221.61838827018173 313.1570930513446,221.67982343202226 315.355350903515,243.8528456455854 299.9323675588228,367.67936762793977 302.785219017324))

@michaelkirk
Copy link
Contributor Author

It works with this simplified WKT file:
POLYGON((0 0, 0 10.0, 10.0 10.0, 10.0 0, 0 0))

Since I can't pick my projection, I suppose rgis must be guessing some projection for my data - is that right?

Maybe the issue is related to the data in my first file not being valid for the guessed projection - e.g. it has values greater than 180, which might be problematic if you're assuming lon/lat coordinates.

@frewsxcv
Copy link
Owner

Yeah it's assuming the source is EPSG:4326 for everything unfortunately

crs: "EPSG:4326".into(),

@michaelkirk
Copy link
Contributor Author

Hah I guess I already knew (and forgot) this: #92

So, maybe the way to organize it is that #92 is tracking a way to specify which projection your uploaded data has.
And #93 (this one) is to more gracefully handle receiving invalid data for the given projection.

@michaelkirk michaelkirk changed the title Loading a WKT layer from file crashes on web (https://rgis.app) Uploading WKT with data outside of it's projection should show user error, not crash. Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants