#14650 closed defect (fixed)
[PATCH] IAE: Invalid number of points in LinearRing
| Reported by: | bagage | Owned by: | Don-vip |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Plugin jts | Version: | latest |
| Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- Open the bug.osm attached file. Select the way as reference layer
- Use anything as subject layer
- Hit "Generate matches"
What is the expected result?
Matches are generated.
What happens instead?
Exception is thrown "java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)".
Please provide any additional information below. Attach a screenshot if possible.
Build-Date:2017-04-10 14:26:00
Revision:11883
Is-Local-Build:true
Identification: JOSM/1.5 (11883 SVN en) Linux Debian GNU/Linux 9.0 (stretch)
Memory Usage: 823 MB / 1760 MB (142 MB allocated, but free)
Java version: 1.8.0_121-8u121-b13-4-b13, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1920x1080
Maximum Screen Size: 1920x1080
Java package: openjdk-8-jre:amd64-8u121-b13-4
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-13
Program arguments: [--language=en, ${HOME}/majcadastre/CL325-SAINT-RAMBERT-D ALBON/CL325-SAINT-RAMBERT-D ALBON-houses-simplifie.osm]
Dataset consistency test: No problems found
Plugins:
+ PicLayer (33148)
+ buildings_tools (33004)
+ conflation (0.5.3)
+ jts (32699)
+ rex (26)
+ todo (30000)
+ utilsplugin2 (33212)
Last errors/warnings:
- W: Old style SideButton usage for action org.openstreetmap.josm.plugins.todo.TodoDialog$MarkAction@4d2adbc0
- W: Old style SideButton usage for action org.openstreetmap.josm.plugins.todo.TodoDialog$MarkSelectedAction@383a536
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.
Warning issued by: BugReportExceptionHandler#handleException
=== STACK TRACE ===
Thread: AWT-EventQueue-0 (17) of main
java.lang.IllegalArgumentException: Invalid number of points in LinearRing (found 3 - must be 0 or >= 4)
at com.vividsolutions.jts.geom.LinearRing.validateConstruction(LinearRing.java:114)
at com.vividsolutions.jts.geom.LinearRing.<init>(LinearRing.java:106)
at org.openstreetmap.josm.plugins.jts.JTSConverter.convertWay(JTSConverter.java:93)
at org.openstreetmap.josm.plugins.jts.JTSConverter.convert(JTSConverter.java:104)
at org.openstreetmap.josm.plugins.conflation.OsmFeature.<init>(OsmFeature.java:35)
at org.openstreetmap.josm.plugins.conflation.MatchesComputation.createFeatureCollection(MatchesComputation.java:119)
at org.openstreetmap.josm.plugins.conflation.MatchesComputation.generateMatches(MatchesComputation.java:48)
at org.openstreetmap.josm.plugins.conflation.ConflationToggleDialog$2.realRun(ConflationToggleDialog.java:1142)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:95)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:143)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Attachments (2)
Change History (15)
by , 9 years ago
comment:1 by , 8 years ago
| Summary: | Crash when conflating simple way → IAE: Invalid number of points in LinearRing |
|---|
comment:2 by , 7 years ago
| Summary: | IAE: Invalid number of points in LinearRing → [PATCH] IAE: Invalid number of points in LinearRing |
|---|
I've added a patch to stop the IAE - and in my case for conflation it works great (eg as expected).
comment:3 by , 7 years ago
I'd rather say that a way with only 2 distinct nodes is not closed. Or maybe the check should be changed to Way.isArea()
which seems to catch also duplicated notes.
comment:4 by , 7 years ago
I'm not sure I can argue much here about the better approach. Indeed 2-nodes way should not be considered closed IMO but I do not know side effects it may have. I believe you are in a better position to know the best fix here :-).
follow-up: 8 comment:5 by , 6 years ago
Hi, could someone guide me around this?
Should I adapt my patch to follow GerdP advices or is it OK as it?
Thanks!
comment:7 by , 6 years ago
| Component: | Plugin conflation → Plugin jts |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:8 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Replying to bagage:
Should I adapt my patch to follow GerdP advices or is it OK as it?
Sounds scary. I have applied a modified version of the simple patch in [o35064] and released the plugin in [o35065].
comment:9 by , 2 years ago
@bagage: I'm currently working on converting the JOSM plugin repo to git (see #23286). Do you have a preferred name/email for that?
comment:10 by , 2 years ago
Hey taylor, what kind of name are you referring to? For the plugin or myself? :)
comment:11 by , 2 years ago
For you. If you were to run git log on the converted repo, the commit for the patch in this ticket would look like this:
commit 4512df051f07be1ddd3a16243460b82ad77d3e2e
Author: bagage <bagage@fixme.todo>
Date: Wed Jul 10 20:46:01 2019 +0000
fix #josm14650 - fix IAE (patch by bagage, modified)
I'd like to get all the Author information so that systems (like GitHub) can properly attribute the author(s). There is also a committer field (if I use git show --format=full 4512df051f07be1ddd3a16243460b82ad77d3e2e, I see Commit: don-vip<xxx>).
With that said, I've gotten to the point where almost everyone left has <10 commits to be attributed to them in the plugin repo.
I am, however, intending to reuse the mapping if/when I convert the JOSM core repo to git from svn.
comment:12 by , 2 years ago
Yes OK, thanks for the detailed explanation (it might be useful later anyway!). For me,
name = Gautier P email = gautier_git@damsy.net
would work!
comment:13 by , 2 years ago
Thank you. See e48eff672f5d364130a9168515a0b61458f60452 for the patch for this ticket. That link will become outdated as I find the author attribution information for other patches and add them.
You also show up in the contributors page.
EDIT: https://github.com/tsmock/josm-osmsvn-svn2git/commits?author=bagage is probably a "better" link, since it should work even after I do force pushes to the WIP repo.



the bogus item that raises the exception