aerostitch / testnavit

0 stars 0 forks source link

Multipolygon relations not handled correctly #65

Open aerostitch opened 13 years ago

aerostitch commented 13 years ago

Issue migrated from trac ticket # 754

component: tools | priority: major | keywords: multi, poly, water, coast

2011-01-27 23:49:22: jrahe created the issue


settlement (landuse=residential type=multipolygon) will not be displayed (colored) on the map.[[BR]]

example 1: http://www.openstreetmap.org/browse/relation/1304643[[BR]]

example 2: http://www.openstreetmap.org/browse/relation/1347636

Maybe similar problem like multipolygons for natural=water (http://trac.navit-project.org/ticket/689)


settlement (landuse=residential) are ok.[[BR]]

example 3: http://www.openstreetmap.org/browse/way/87861851[[BR]]

example 4: http://www.openstreetmap.org/browse/way/24961414

Greetings Jörg

aerostitch commented 12 years ago

2012-02-19 09:57:20: tegzed uploaded file 00.png (103.3 KiB)

00.png

aerostitch commented 12 years ago

2012-02-19 10:03:02: tegzed commented


Hmm, is the patch succeeded for you? For me these polygons seem to be ok(see the attached screenshots).

aerostitch commented 12 years ago

2012-02-19 11:29:07: tegzed uploaded file 16.png (146.8 KiB)

16.png

aerostitch commented 12 years ago

2012-02-19 11:32:23: tegzed commented


Wakefred,

Try removing first the new files that this patch should create: tri.c interface.h triangulate.h misc_.c monotone.c construct.c. Patch appends the content of these files instead of overwriting them, which can cause problems. For me your examples work correctly.

aerostitch commented 12 years ago

2012-02-19 22:28:09: tegzed commented


It seems that for small map extracts this works correctly,but for whole countries it does not. I will try to fix this.

aerostitch commented 12 years ago

2012-02-19 23:35:16: wakefred@gmail.com commented


I would test it today again. But thank's for the reason it wouldn't work: i've tested it with the whole Switzerland.

aerostitch commented 12 years ago

2012-02-25 08:08:39: tegzed commented


Wakefred, Can you test the latest version?

aerostitch commented 12 years ago

2012-02-25 11:00:35: wakefred@gmail.com uploaded file isle_not_visible.png (95.8 KiB)

isle_not_visible.png

aerostitch commented 12 years ago

2012-02-25 11:01:17: wakefred@gmail.com commented


Hi tegzed, the normal MPs are o.k., but the holes within the MPs are still not visible. see attached screenshot (isle_not_visible.png) from this isle: http://www.openstreetmap.org/?lat=46.68156&lon=7.0957&zoom=17&layers=M I made a map of Switzerland. With the patch "area_relation.diff" and svn-4854, the map of Switzerland was 67,1 MB big. With the new patch the map of Switzerland have a size of 80,5 MB.

aerostitch commented 12 years ago

2012-02-25 11:41:13: tegzed commented


Do you use the recompiled navit or the original one? Maptool triangulates polygons that have holes and adds the triangle info into a new map item attribute type which will increases the map size. So I guess your maps are correct. But you need to use the patched version of navit on your device since older versions cannot interpret triangle info. Non-patched navit versions will only display the outer polygons without holes since outer info can be put into the original map format also. So please use the patched navit version to see the MPs with holes.

aerostitch commented 12 years ago

2012-02-26 06:31:12: wakefred@gmail.com commented


Hi tegzed, it was my misstake. I didn't installed a patched version on my android-device. but now, i checked it with the patched navit-version on my notebook: great... wow, this works perfekt. good job... Now it would be great, if this patch could be implemented into the source code of navit, so that everybody can profit from this patch and the new maps.

aerostitch commented 12 years ago

2012-02-26 21:44:28: wakefred@gmail.com commented


After some tests, I've found no problems with this patch. Its great. Now, it would also be nice, if you can expand this patch for the inners from buildings.

aerostitch commented 12 years ago

2012-03-01 01:25:35: tegzed commented


Buildings should also be supported by the patch. However if both the s and s that uses that way as outer in your osm file are tagged so that map items (eg building) need to be generated then at the end of generation process you will have one item for the without hole and one item for the with holes. These polygons will be drawn over each other and at the end it will look like as a polygon without hole.

<way id="1111">
<tag building="xxx">   //hole-less item will be generated
</way>
...
<relation id="xxxx">
<member type="way" ref="1111" role="outer"/>
<tag building="xxx">   //with-hole item will be generated
</relation>

It is not so easy to handle these situations (for example by removing hole-less items where we have relation based item) since one way can be included from several relations etc...

Try removing the tags from the tag (and leaving it there in the relation) in your osm file. If you see the holes after generating map from this osm file, then you have the above problem.

aerostitch commented 12 years ago

2012-03-01 01:50:39: wakefred@gmail.com commented


yes, I saw it: the holes in the buildings are visible in Navit with this patch - if the outer-way haven't the tag "building=yes". this is o.k. like this. thanks for your feedback.

aerostitch commented 12 years ago

2012-03-01 06:45:24: wakefred@gmail.com commented


@tegzed... I have a little problem: I can't compile it for android, because I get an error while compiling:

/home/wakefred/navit/svn/navit_repository/navit/navit/misc_.c:136: undefined reference to `log2'
.libs/misc_.o: In function `math_N':
/home/wakefred/navit/svn/navit_repository/navit/navit/misc_.c:150: undefined reference to `log2'

what can I do? Do you have an idea? (the patch "polygon_hole.diff" is correct implemented)

aerostitch commented 12 years ago

2012-03-01 06:45:24: wakefred@gmail.com

aerostitch commented 12 years ago

2012-03-01 13:14:09: tegzed commented


The latest version that is not yet attached moves all triangulation code to maptool from libnavit, so navit does not depend on the triangulation code which contains the call to log2. This should fix the build on android. Maybe your ARM version of libmath does not contain the log2 function. I will update the patch soon.

aerostitch commented 12 years ago

2012-03-03 12:23:54: tegzed commented


Wakefred, The newest one should compile on android, too.

aerostitch commented 12 years ago

2012-03-04 07:44:12: wakefred@gmail.com commented


hi tegzed... thanks a lot, but there are two bugs with this newest patch:

  1. Multipolygon-Areas (p.e. residential) aren't visible (tested on a Ubuntu-Notebook with installed actual patch) - with this patch, the map of Switzerland will be just 66,3 MB big, instead of the 80,5 MB like the old polygon_hole-Patch)
  2. building an apk is possible, but on the Galaxy Nexus (ICS 4.0.3 - CM9 - newest franco.kernel) it crash at the start (don't know, if it crashs on other android-devices) : installation works, but if I would start Navit, it close immediatly.

My installation: navit-4936 with new polygon_hole.diff -> the installation of the new polygon_hole.diff don't work proper: the attr.c is to new. first I must get an older attr.c (4923 - because 4922 is no more available). After this changing, the patch can be installed.

aerostitch commented 12 years ago

2012-03-04 07:44:12: wakefred@gmail.com

aerostitch commented 12 years ago

2012-03-04 13:35:38: tegzed commented


The problem is that the patch is created against an older svn version not the current. attr.c contains an important part of the change, simply using an older one is not ok. This explains both the lack of(or incorrect) triangle data in your map and the crash. I need to create a patch against current svn.

aerostitch commented 12 years ago

2012-03-11 03:23:33: tegzed commented


wakefred, I updated the patch. now it is created against 4971.

aerostitch commented 12 years ago

2012-03-13 02:33:08: wakefred@gmail.com commented


@tegzed... thanks a lot for this new patch:

  1. the maps looks great with this patch: MPs with holes and also MPs without holes will be shown correct. I've found no problems - on a linux-computer with a patched navit, it works.
  2. creating an apk for my android device don't work with this patch. Creating an apk without patch works, but with this patch, I get this error:
-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...
     [aapt] /home/wakefred/navit/work/build/navit/android/AndroidManifest.xml:2: error: No resource identifier found for attribute 'installLocation' in package 'android'

BUILD FAILED
/home/wakefred/navit/android-sdk-linux_x86/tools/ant/main_rules.xml:310: null returned: 1
aerostitch commented 12 years ago

2012-03-13 22:44:52: tegzed commented


For me this problem seems to be unrelated. The patch does not touch any android specific code. Try removing the installLocation entry from the manifest(in my AndroidManifest.xml file there is no installLocation entry) file or check your android API version you compile against. If I remember well navit should be compiled against 1.6.

Update: check http://irclogs.navit.ie/%23navit-2011-08-24.log Here Rikky says in his commit log: Target API has to be 8 if installLocation is specified. Maybe this helps

aerostitch commented 12 years ago

2012-03-13 22:44:52: tegzed

aerostitch commented 12 years ago

2012-03-15 04:10:25: wakefred@gmail.com commented


all right. with Target API 8 the apk can be build. it wasn't a problem of the patch. it is possible to implement this patch to the source code, so everyone can create maps with MP-support and so they can see also the MP-holes?

aerostitch commented 12 years ago

2012-03-15 08:24:21: wakefred@gmail.com commented


For a special area, I have a problem to create a bin-map: its for Benelux. I get an error like "Speicherzugriffsfehler" from maptool. I have this problem from the pbf of an extract from europe.osm.pbf (geofabrik) and also, if I take the pbf from http://planet.openstreetmap.nl/benelux/. Its just with the new patch. With the old patch (area_relation.diff), I've had never this problem. I've created some maps with the new patch. If someone would like to test them, you can find some countries (AT, CH, DE, LI and DACH) on http://dl.artpc.ch/navit/maps/ (Benelux can't be created because of the error)

aerostitch commented 12 years ago

2012-03-15 09:28:23: korrosa commented


Replying to [comment:61 wakefred]:

I've created some maps with the new patch. If someone would like to test them, you can find some countries (AT, CH, DE, LI and DACH) on http://dl.artpc.ch/navit/maps/ (Benelux can't be created because of the error)

Fancy doing a GB one too? I'll gladly test that one on an Android device.(http://download.geofabrik.de/osm/europe/great_britain.osm.pbf)

aerostitch commented 12 years ago

2012-03-15 11:18:25: wakefred@gmail.com commented


@korrosa... I'll do it tomorrow morning.

aerostitch commented 12 years ago

2012-03-15 15:58:41: tegzed commented


Hi Wakefred, thanks for the report, I will try to find the time to fix it in a couple of days.

Dandor

aerostitch commented 12 years ago

2012-03-16 00:18:12: wakefred@gmail.com commented


@korrosa and tegzed... I'm sorry, but for Great-Britain, I have the same error like Benelux: "Speicherzugriffsfehler" (Translation: Memory Access Error)

aerostitch commented 12 years ago

2012-03-19 01:43:19: wakefred@gmail.com commented


this new Patch works now also for Great-Britain and Benelux. I think, maptool is a little slower now than bevor, but it works. navitmap-GB.bin is now online on http://dl.artpc.ch/navit/maps/ and navitmap-benelux.bin will be online in 30 minutes. the other maps (AT, DE, CH, LI) will be created after benelux with this new patch.

aerostitch commented 12 years ago

2012-03-19 03:07:37: tegzed commented


Yep, now this can process the mentioned maps, however I noticed that there are some polygons that were filtered out by this version needlessly. I hope to fix these problems also. Please let me know if you find crashes or other problems. When the code works as expected I will need to do some clean up and review. If you have an osm planet file and some processing capacity you may help me to process the full osm data also. The inceased runtime is caused by additional checks for self-intersecting polygons.

aerostitch commented 12 years ago

2012-03-19 04:09:08: korrosa commented


I can confirm that the GB map works fine for me on Android for viewing and searching - I'll test the routing on it tonight, but I don't expect any problems. Good work guys!

aerostitch commented 12 years ago

2012-03-19 06:16:30: wakefred@gmail.com commented


I made a changement from Great Britain to British Isles. Now, there will be the map "navitmap-british_isles.bin" for Great-Britain, Ireland and Northern Ireland. And this map will also be created 2-3 times a week (like AT, CH, DE, LI).

aerostitch commented 12 years ago

2012-03-19 07:30:03: wakefred@gmail.com commented


I found a "small bug": when a multipolygon-lake have the attributes natural=water and landuse=basin, this area will not be visible with the new patch (with the patch area_relations.diff these lakes were visible).

aerostitch commented 12 years ago

2012-03-19 07:30:03: wakefred@gmail.com

aerostitch commented 12 years ago

2012-03-19 08:18:17: wakefred@gmail.com commented


@tegzed... I've just started to download the planet and create a navitmap-planet.bin now. So it can work over night.

aerostitch commented 12 years ago

2012-03-19 08:55:40: tegzed commented


Replying to [comment:70 wakefred]:

Maybe this isn't caused by tagging, but it can be the bug I write in http://trac.navit-project.org/ticket/754#comment:67 . Can you link this lake pls?

aerostitch commented 12 years ago

2012-03-19 09:16:12: wakefred@gmail.com commented


its this lake: http://www.openstreetmap.org/browse/relation/1537206 (but 2 hours ago, I deleted the attribute "landuse=basin" in this relation. Now it will be visible in navit also)

aerostitch commented 12 years ago

2012-03-19 12:57:02: rico@bierrommel.de commented


Hi,

with this patch navit does'nt show any multipolygons for me, e.g. forests. Areas, that are not MPs are ok. It doesn't work neither with gtk nor with internal+qt. Do I have to modify layouts in navit.xml?

aerostitch commented 12 years ago

2012-03-19 13:30:54: tegzed commented


Replying to [comment:74 rico]: Rico, you need to generate your maps with the patched maptool and use patched navit to display these maps.

aerostitch commented 12 years ago

2012-03-19 14:44:46: tegzed commented


Replying to [comment:73 wakefred]: Wakefred, I did some investigation and it turned out that this landuse=basin tag problem was a bug in the rule match handling. I updated the patch with the fix.

aerostitch commented 12 years ago

2012-03-20 00:59:21: wakefred@gmail.com commented


@tegzed...[[BR]]1. The bug "landuse=basin" is fixed. it works now. I'll create new maps today.[[BR]]2. The planet.bin wasn't created because of a problem of my PC: the size of my VM, where I create the maps, was to small. I will try it this night again with a bigger VM.

aerostitch commented 12 years ago

2012-03-20 05:15:31: tegzed commented


Replying to [comment:77 wakefred]: All right, thanks for your feedback and your efforts to test planet map generation.

aerostitch commented 12 years ago

2012-03-20 06:31:02: rico@bierrommel.de commented


Replying to [comment:75 http://wiki.navit-project.org/index.php/user:tegzed]:

I used a patched navit and a patched maptool to generate maps. wakefreds maps also don't work.

aerostitch commented 12 years ago

2012-03-20 06:36:45: korrosa commented


Replying to [comment:79 rico]:

I used a patched navit and a patched maptool to generate maps. wakefreds maps also don't work.

rico: What device are you using, and is your navit.xml modified in any way?

aerostitch commented 12 years ago

2012-03-20 06:50:31: wakefred@gmail.com commented


@rico... which map is not working? have you an ID of the Multipolygon, which is not working?

aerostitch commented 12 years ago

2012-03-20 09:23:22: rico@bierrommel.de commented


@tegzed: I'm using a Debian Desktop and tested with a unmodified navit.xml too - no luck.

@wakefred: Germany is not working, for example http://www.openstreetmap.org/browse/relation/77659

aerostitch commented 12 years ago

2012-03-20 10:30:06: wakefred@gmail.com commented


@rico... All right. It isn't a problem of my maps or of the patch. The Problem is, that the tag "landuse=forest" isn't in the Relation. This tag is taggt wrongly direct on the outer-way instead in the relation. This isn't correct and should be changed. And the lakes in the south of this forest should also be integrated in the relation with the role=inner - till now, there are a lot of lakes not in the relation...[[BR]] @tegzed... maybe you can change the code of this patch, so if there are such other wrong taggings (landuse-tag directly on the outer-way instead in the relation)?