Modify

Opened 7 years ago

Closed 5 years ago

Last modified 5 months ago

#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?

  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 7 years ago.
the bogus item that raises the exception
Avoid_IAE_when_converting_3-nodes_way_to_LinearRing.patch (822 bytes ) - added by bagage 5 years ago.
patch

Download all attachments as: .zip

Change History (15)

by bagage, 7 years ago

Attachment: bug.osm added

the bogus item that raises the exception

comment:1 by Don-vip, 7 years ago

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

comment:2 by bagage, 5 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 GerdP, 5 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 bagage, 5 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 :-).

comment:5 by bagage, 5 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:6 by Don-vip, 5 years ago

Ticket #17913 has been marked as a duplicate of this ticket.

comment:7 by Don-vip, 5 years ago

Component: Plugin conflationPlugin jts
Owner: changed from Tyndare to Don-vip
Status: newassigned

in reply to:  5 comment:8 by Don-vip, 5 years ago

Resolution: fixed
Status: assignedclosed

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 taylor.smock, 5 months 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 bagage, 5 months ago

Hey taylor, what kind of name are you referring to? For the plugin or myself? :)

comment:11 by taylor.smock, 5 months 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 bagage, 5 months 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 taylor.smock, 5 months 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.

Last edited 5 months ago by taylor.smock (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.