Getting the following error when running splitter

For some reason starting a while back, running Windows 11, when running splitter for Ontario Canada with the ontario.poly I am getting the following error.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Invalid polygon ring in polygon-file, possibly self-intersecting
at org.openstreetmap.osmosis.core.filter.common.PolygonFileReader.loadSectionPolygon(PolygonFileReader.java:258)
at org.openstreetmap.osmosis.core.filter.common.PolygonFileReader.loadPolygon(PolygonFileReader.java:180)
at uk.me.parabola.splitter.solver.AreasCalculator.readPolygonFile(AreasCalculator.java:115)
at uk.me.parabola.splitter.solver.AreasCalculator.(AreasCalculator.java:52)
at uk.me.parabola.splitter.Main.split(Main.java:216)
at uk.me.parabola.splitter.Main.start(Main.java:121)
at uk.me.parabola.splitter.Main.main(Main.java:81)

I’m running the latest version of Java. That I know of I’ve changed nothing on my system. I"ve tried editing the poly file in JOSM. I can’t see any issues with the poly file and the saved file generates the same error.

Any idea / help solving this would be greatly appreciated.

I have been able to solve the error but not the way I wanted too. I removed the points for the top section of ontario.poly in JOSM and saved the file. Running Splitter I no longer get the error but of course the top part of Ontario is no longer in the ontario.poly file.

I should also mention I get the same error when running Splitter with the canada.poly file. I tried editing canada.poly with JOSM removing the top section of Canada but I still get the error.

I ran a quick test using this script:

garmin_map_etrex_02.sh north-america canada ontario

That seems to have worked OK, and produced some files here. I didn’t see any errors from Splitter. The difference is that this was just using Geofabrik’s Ontario extract.

What was the sort of the .poly that you were using for Ontario?

My apologies. I should have specified I was using the Geofabrik’s Ontario extract. I get the same error using Geofabrik’s canada.poly. I don’t get the error with the Geofabrik’s north-america.poly

I’m running Windows using mkmap in addition to splitter to make a .gmap for use with MapSource and BaseCamp.

For the last three years I haven’t had any problems using ontario.poly or canada.poly from Geofabrik’s web site along with the corresponding .pbf file. The problem started about a month or so ago with ontario.poly and canada.poly. I don’t want to download and make the entire North America map when I don’t need it.

Which version of Splitter? I’m using whatever came with “Debian GNU/Linux 13 (trixie)”, which claims to be “Splitter version 654 compiled 2024-04-05T14:44:59+0100”.

The script I’m using does not use a .poly file. It just does this:

  java  -Xmx9600m -jar /usr/share/mkgmap-splitter/splitter.jar ../${file_prefix1}_${file_extension1}.osm.pbf --max-nodes=800000 --output=xml

The resulting map loooks OK in QMapShack.

I’m running Splitter version 654 as well. I’m running Windows 11. It had been working fine up until a while ago. I only get the error on the canada.poly and ontario.poly, not the north-america.poly. All of them downloaded from Geofabrik’s web site. For some reason it appears that something changed when they were creating the .poly files for the different sections.

What I don’t know is if I could just use the north-america.poly file when only using the canada-latest.osm.pbf or ontario-latest.osm.pbf file.

Do you actually need to use a .poly file? What I’m doing is running Splitter for “all of Ontario” without clipping it to a .poly file. It looks like the Geofabrik extract includes e.g. the American side of Niagara Falls, whereas I presume your version wouldn’t. If you’re happy to see a bit of the USA (and Quebec) then you could just not use a .poly file.

When you say; “your version”, if you are referring to the canada.poly or ontario.poly file, they aren’t mine. I get them from the Geofabrik website which is where I have been getting them for the last 3 years along with the canada-latest.osm.pbf file or ontario-latest.osm.pbf file. It is only those two that started generating the error a month or so back. The north-america.poly doesn’t generate the error with the north-america-latest.osm.pbf file.

I’ve been using the example, except for tiger, from OpenMapChest which uses a .poly file, which as I mentioned, has worked fine for 3 years. GitHub - openmapchest/openmapchest-map-build-guide: A guide to building Garmin maps as found on https://www.openmapchest.org · GitHub

I can try it without using a poly file to see what the results are, but what the negative effects will be of not using one I don’t know.

Just to clarify - I mean “my script”. I too am using unmodified Geofabrik files.

Is your script running on Linux? I’m running Windows. I’m also not a coder so scripts aren’t something I’m familiar with. I’m building .gmap files to work with MapSource and BaseCamp. I use the Garmin Map Install tool to create the img file on my GPS’s

It is, but the parameters used in the line in there running “splitter” should be transferrable to a Windows batch file or Powershell script.

I’ll give it a try and see how it works.

I edited my batch file to leave out the “–polygon-file=ontario.poly” which eliminated the error and didn’t appear to effect the split and subsequent creation of the .gmap with mkmap.

As long as it works I’m happy. I only used the .poly file because I thought it was required to properly split the *.pbf file and subsequently create the .gmap file.