Modify

Opened 2 years ago

Last modified 3 months ago

#14650 new defect

[PATCH] IAE: Invalid number of points in LinearRing

Reported by: bagage Owned by: Tyndare
Priority: normal Milestone:
Component: Plugin conflation Version: latest
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Open the bug.osm attached file. Select the way as reference layer
  2. Use anything as subject layer
  3. 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)

bug.osm (564 bytes) - added by bagage 2 years ago.
the bogus item that raises the exception
Avoid_IAE_when_converting_3-nodes_way_to_LinearRing.patch (822 bytes) - added by bagage 3 months ago.
patch

Download all attachments as: .zip

Change History (6)

Changed 2 years ago by bagage

Attachment: bug.osm added

the bogus item that raises the exception

comment:1 Changed 21 months ago by Don-vip

Summary: Crash when conflating simple wayIAE: Invalid number of points in LinearRing

comment:2 Changed 3 months ago by bagage

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 Changed 3 months ago by GerdP

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 Changed 3 months ago by bagage

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 :-).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Tyndare.
as The resolution will be set.
to The owner will be changed from Tyndare to the specified user.
The owner will change to bagage
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from Tyndare to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.