Modify

Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#10176 closed enhancement (fixed)

icon-image is not working for area

Reported by: mkoniecz Owned by: team
Priority: major Milestone: 17.03
Component: Core mappaint Version:
Keywords: area icon Cc: skyper, lists@…, Chenshi, Klumbumbus

Description (last modified by Don-vip)

note: #9270 should be reopened once this feature is included

With style

area[amenity=parking]{
    icon-image: vehicle/parking.png;
    fill-color: amenity_traffic#f7efb7;
}

File exists, as reverting it to standard style causes this icon to be displayed on parking nodes.

What happens: causes amenity=parking areas to be coloured but no icon appears anywhere
Expected: in center of area parking icon appears

According to http://wiki.openstreetmap.org/wiki/MapCSS/0.2#Point.2Ficon_properties it is expected not only by me.

I hope that this time Core mappaint is correct category

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-06-20 01:36:37
Last Changed Author: simon04
Revision: 7254
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-06-19 11:09:04 +0200 (Thu, 19 Jun 2014)
Last Changed Rev: 7254

Identification: JOSM/1.5 (7254 en) Windows 7 32-Bit
Memory Usage: 80 MB / 247 MB (36 MB allocated, but free)
Java version: 1.7.0_55, Oracle Corporation, Java HotSpot(TM) Client VM
Dataset consistency test: No problems found

Plugin: OpeningHoursEditor (30416)
Plugin: RoadSigns (30495)
Plugin: buildings_tools (30485)
Plugin: continuosDownload (28565)
Plugin: lakewalker (30416)
Plugin: measurement (30416)
Plugin: notes (v0.9.2)
Plugin: wikipedia (30449)

Attachments (0)

Change History (35)

comment:1 by mkoniecz, 10 years ago

Description: modified (diff)

comment:2 by mkoniecz, 10 years ago

Description: modified (diff)

comment:3 by skyper, 10 years ago

Cc: skyper added

comment:4 by bastiK, 10 years ago

Resolution: duplicate
Status: newclosed

Closed as duplicate of #9270.

comment:5 by mkoniecz, 10 years ago

Not a duplicate, #9270 is about using it in default map style. I wanted to make patch for #9270 and it turns out to be impossible due to limitation of mappaint in JOSM.

Last edited 10 years ago by mkoniecz (previous) (diff)

comment:6 by mkoniecz, 10 years ago

Resolution: duplicate
Status: closedreopened

comment:8 by bastiK, 10 years ago

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

comment:9 by mkoniecz, 10 years ago

Description: modified (diff)

comment:10 by Don-vip, 10 years ago

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

comment:11 by Aun Johnsen <lists@…>, 10 years ago

Cc: lists@… added

comment:12 by Aun Johnsen <lists@…>, 10 years ago

When this is supported, mapcss implementation should accept image-icon to area and render a single icon at the center of gravity of an area.

comment:13 by Don-vip, 10 years ago

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

comment:14 by Don-vip, 10 years ago

Cc: Chenshi added

comment:15 by Klumbumbus, 10 years ago

Cc: Klumbumbus added

comment:16 by Don-vip, 10 years ago

Description: modified (diff)
Keywords: area icon added

comment:17 by aceman, 9 years ago

My proposal from ticket #10187 is to show the icon a bit larger (scaled up) than if it was on a node to make it clear it is from the area. It would then be easy to see if there is duplication of the same tags on area and a node inside the area.

comment:18 by jgc@…, 8 years ago

Hello,
There is another need for this feature (for which I see that there have been several requests, and since a long time ago: http://wiki.openstreetmap.org/wiki/Talk:MapCSS/0.2#icon-image_on_areas ;-) ), to support a building damage assessment methodology - in particular for Fiji for now (http://hhi.harvard.edu/publications/satellite-imagery-interpretation-guide-assessing-wind-disaster-damage-structures), for which it would be useful to display an icon over each building having the appropriate tags.
I have prepared a preset and a mapcss style to support this methodology in JOSM, and this missing feature is the main remaining issue. (fill-image can be a temporary work-around, but it is not really satisfactory).
Thank you very much in advance if you can do anything about it.
Jean-Guilhem

comment:19 by Maailma, 7 years ago

The lack of this feature is the main reason that many POI get two tags, one on the building and one on a node inside the building. This has been requested a long time ago, and there are also questions on the wiki relating to that: https://help.openstreetmap.org/questions/3824/should-amenities-eg-supermarkets-be-ways-or-nodes

Can this be included into MapCSS or at least can someone provide a Map point style that has this feature, or is there a way to create one?

Check "FINCA" on this map: https://www.openstreetmap.org/edit?editor=id#map=19/38.10865/70.02980

in reply to:  19 comment:20 by Maailma, 7 years ago

Actually, this is encouraging people to add a single feature twice, which should not be done (https://wiki.openstreetmap.org/wiki/One_feature,_one_OSM_element). So this is VERY URGENT!

comment:21 by michael2402, 7 years ago

In 11670/josm:

See #10176: Make icon-image work for areas. Icon is displayed at center of lat/lon bounds.

comment:22 by michael2402, 7 years ago

Milestone: 17.03

I added basic support for this. The icon is parsed the same way as it is for nodes (supporting offset/rotation).

I currently only put the icon at the center of the bbox. Center of weight computation should be somewhere in our codebase, I'll have to find it first and see if the performance is good enough. Since way bboxes are cached, they should be pretty fast. Multipolygons walk every outer node for now.

comment:23 by stoecker, 7 years ago

Please don't forget that all functions should have Javadoc and new functions should have "@since revsion" text.

Center at lat/lon is a bit dangerous, as it may be outside the area often for very common objects like U-shaped houses.

comment:24 by michael2402, 7 years ago

In 11671/josm:

See #10176: Nicer stroke for icons of selected areas.

in reply to:  22 ; comment:25 by Klumbumbus, 7 years ago

Replying to michael2402:

Center of weight computation should be somewhere in our codebase, I'll have to find it first

I don't know if this helps: r7459

comment:26 by Klumbumbus, 7 years ago

Priority: normalmajor

in reply to:  25 ; comment:27 by bastiK, 7 years ago

Great, this was one of the larger missing features in all of JOSM!

Replying to Klumbumbus:

Replying to michael2402:

Center of weight computation should be somewhere in our codebase, I'll have to find it first

I don't know if this helps: r7459

Yes, there is fairly complex code to find the label placement inside an area. It would make sense to have the label and the icon in some relation to each other, e.g. text centered below the image.

Currently, the label is not displayed when it doesn't fit completely inside the area. Maybe this can be relaxed, to print the text regardless of the area shape (and only take the total area size as threshold if needed). I find it annoying that the (long) name of a small building is not displayed as you can't tell if the name is already tagged or not.

(Please don't forget to update equals and hashCode, weird things will happen otherwise.)

in reply to:  27 comment:28 by Don-vip, 7 years ago

Replying to bastiK:

Yes, there is fairly complex code to find the label placement inside an area.

I didn't find a way to make it nicer at the time. If someone sees how to improve this code, feel free to do so :) I'm pretty sure it can be optimized.

comment:29 by Don-vip, 7 years ago

2 checkstyle issues to fix, see jenkins

comment:30 by michael2402, 7 years ago

StyledMapRenderer has grown to be pretty complex right now.

I would like to split the class in two parts: The renderer (doing style computations) and the draw...-methods. For now, we could use inheritance for this. In the long run, separating them completely would be the nicer way.

And I'd suggest moving the OffsettIterator to a separate class.

comment:31 by michael2402, 7 years ago

Resolution: fixed
Status: reopenedclosed

In 11730/josm:

Add a new style element for area icon styles. Use the same placement algorithm we use for texts. Fixes #10176

comment:32 by michael2402, 7 years ago

In 11760/josm:

See #10176: Make area icon position setable by user.

comment:33 by michael2402, 7 years ago

In 11761/josm:

See #10176: Allow icons in multipolygons, use even/odd winding rule for icon placement position in multipolygons

comment:34 by Klumbumbus, 7 years ago

The multipolygon fill color broke somewhere between 11747 and 11757

comment:35 by Klumbumbus, 7 years ago

Please also add end user documentation for your fancy new features at wiki:Help/Styles/MapCSSImplementation, else nobody will use it.

in reply to:  34 comment:36 by michael2402, 7 years ago

Replying to Klumbumbus:

The multipolygon fill color broke somewhere between 11747 and 11757

Should be fixed in [11759].

I am already on the docs. I added the opacity changes there. And I added a note to the MapCSS talk page to see if there are any objections Link. The mailing list looks abandoned. I'm currently searching through the mapcss docs of other software to see if they have anything like an icon placement on the line - but it does not look that way. This is sort of a bonus when allowing the user to chose between placing the icon inside the area or just so that a part of it is inside the area.

I don't want to put it in the docs until the naming is more stable...

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.