tordanik / OSM2World

converter that creates three-dimensional models of the world from OpenStreetMap data
http://osm2world.org/
GNU Lesser General Public License v3.0
563 stars 123 forks source link

NullPointerException on very simple OSM file #109

Closed mir-math closed 3 years ago

mir-math commented 8 years ago

Ok, I found a very simple OSM file which causes "org.osm2world.core.util.exception.TriangulationException: java.lang.NullPointerException"

Here it is, only three nodes:

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' upload='true' generator='JOSM'>
 <bounds minlat="55.0534000" minlon="38.7415000" maxlat="55.0608000" maxlon="38.7546000"/>
  <node id='-43710' visible='true' lat='55.059157' lon='38.7511545' />
  <node id='-43206' visible='true' lat='55.0586805' lon='38.7489323' />
  <node id='-43197' visible='true' lat='55.0595038' lon='38.7506144' />
  <way id='-43884' visible='true'>
    <nd ref='-43197' />
    <nd ref='-43206' />
    <tag k='highway' v='footway' />
    <tag k='living_street' v='yes' />
  </way>
  <way id='-43857' action='modify' visible='true'>
    <nd ref='-43710' />
    <nd ref='-43197' />
    <tag k='highway' v='service' />
    <tag k='living_street' v='yes' />
    <tag k='surface' v='asphalt' />
  </way>
</osm>

This exception can not be seen by end user (only in IDE), but definitely worth investigating.

Gotrees commented 3 years ago

Any updates or workarounds for this? I am getting a similar error on every single OSM file I try to load.

tordanik commented 3 years ago

This error has been fixed, the file in the initial post works correctly as of f71fbd2 (and the latest build available at http://osm2world.org/download/).

@Gotrees Now that this bug is fixed, please try again with the latest version. It's possible that your error was unrelated to this problem and continues to occur. In that case, I would welcome a new issue with an example of a file that causes the exceptions to appear for you.