Modify

Opened 3 years ago

Closed 2 months ago

Last modified 2 months 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 Changed 3 years ago by mkoniecz

Description: modified (diff)

comment:2 Changed 3 years ago by mkoniecz

Description: modified (diff)

comment:3 Changed 3 years ago by skyper

Cc: skyper added

comment:4 Changed 3 years ago by bastiK

Resolution: duplicate
Status: newclosed

Closed as duplicate of #9270.

comment:5 Changed 3 years ago by mkoniecz

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 3 years ago by mkoniecz (previous) (diff)

comment:6 Changed 3 years ago by mkoniecz

Resolution: duplicate
Status: closedreopened

comment:8 Changed 3 years ago by bastiK

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

comment:9 Changed 3 years ago by mkoniecz

Description: modified (diff)

comment:10 Changed 3 years ago by Don-vip

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

comment:11 Changed 3 years ago by Aun Johnsen <lists@…>

Cc: lists@… added

comment:12 Changed 3 years ago by Aun Johnsen <lists@…>

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 Changed 3 years ago by Don-vip

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

comment:14 Changed 3 years ago by Don-vip

Cc: Chenshi added

comment:15 Changed 3 years ago by Klumbumbus

Cc: Klumbumbus added

comment:16 Changed 3 years ago by Don-vip

Description: modified (diff)
Keywords: area icon added

comment:17 Changed 2 years ago by aceman

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 Changed 15 months ago by jgc@…

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 Changed 4 months ago by Maailma

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

comment:20 in reply to:  19 Changed 4 months ago by Maailma

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 Changed 3 months ago by michael2402

In 11670/josm:

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

comment:22 Changed 3 months ago by michael2402

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 Changed 3 months ago by stoecker

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 Changed 3 months ago by michael2402

In 11671/josm:

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

comment:25 in reply to:  22 ; Changed 3 months ago by 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

comment:26 Changed 3 months ago by Klumbumbus

Priority: normalmajor

comment:27 in reply to:  25 ; Changed 3 months ago by bastiK

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.)

comment:28 in reply to:  27 Changed 3 months ago by Don-vip

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 Changed 3 months ago by Don-vip

2 checkstyle issues to fix, see jenkins

comment:30 Changed 3 months ago by michael2402

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 Changed 2 months ago by michael2402

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 Changed 2 months ago by michael2402

In 11760/josm:

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

comment:33 Changed 2 months ago by michael2402

In 11761/josm:

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

comment:34 Changed 2 months ago by Klumbumbus

The multipolygon fill color broke somewhere between 11747 and 11757

comment:35 Changed 2 months ago by Klumbumbus

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

comment:36 in reply to:  34 Changed 2 months ago by michael2402

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. Next status will be 'closed'.
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.