Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#2264 closed defect (fixed)

STYLEITEM auto MapInfo TAB and AGG

Reported by: flavio Owned by: dmorissette
Priority: high Milestone: 5.0 release
Component: OGR Support Version: 5.0
Severity: normal Keywords: STYLEITEM auto AGG
Cc: tbonfort

Description (last modified by dmorissette)

STYLEITEM auto: not all polygons in correct color using AGG:

IMAGETYPE AGG_JPEG

OUTPUTFORMAT
  NAME 'AGG_JPEG'
  DRIVER AGG/JPEG
  IMAGEMODE RGB
  FORMATOPTION "QUANTIZE_FORCE=ON"
  FORMATOPTION "QUANTIZE_DITHER=OFF"
  FORMATOPTION "QUANTIZE_COLORS=256"
END

LAYER
	NAME "Bodenbedeckung"
	TYPE POLYGON
	MINSCALE 0
	MAXSCALE 32000
	STATUS ON
	CONNECTIONTYPE OGR
	CONNECTION "av/test.TAB"
	STYLEITEM "auto"
	TRANSPARENCY alpha
	HEADER "Art"
		CLASS
			NAME "GP_BB_Flaechen_f"
			TEMPLATE ttt.html
		END
	PROJECTION
	 "init=world:CH1903"
	END
END

Attachments (5)

building.gif (96.0 KB ) - added by flavio 17 years ago.
Screen Shot: Buildings not colored correctly
av.zip (64.3 KB ) - added by flavio 17 years ago.
Sample Data
test.jpg (57.0 KB ) - added by tbonfort 17 years ago.
bug2264_agg.map (592 bytes ) - added by dmorissette 17 years ago.
Mapfile to reproduce the issue with 'shp2img -m bug2264_agg.map -o test.jpg'
agg_vs_gd.jpg (42.3 KB ) - added by dmorissette 17 years ago.
AGG vs GD output with bug2264_agg.map attached

Download all attachments as: .zip

Change History (16)

by flavio, 17 years ago

Attachment: building.gif added

Screen Shot: Buildings not colored correctly

by flavio, 17 years ago

Attachment: av.zip added

Sample Data

by tbonfort, 17 years ago

Attachment: test.jpg added

comment:1 by dmorissette, 17 years ago

Cc: dmorissette@… removed
Description: modified (diff)
Milestone: 5.0 release
Owner: changed from mapserverbugs to dmorissette

comment:2 by tbonfort, 17 years ago

cannot reproduce here. attachment test.jpg shows the output I get.

comment:3 by tbonfort, 17 years ago

Cc: tbonfort added

in reply to:  2 comment:4 by flavio, 17 years ago

Replying to tbonfort:

cannot reproduce here. attachment test.jpg shows the output I get.

see http://test.mapserver.ch/waedenswil/frame.php?site=waedenswil&lang=en&group=public&resol=2

zoom = 600m = OK zoom = 250m = NOT OK

by dmorissette, 17 years ago

Attachment: bug2264_agg.map added

Mapfile to reproduce the issue with 'shp2img -m bug2264_agg.map -o test.jpg'

by dmorissette, 17 years ago

Attachment: agg_vs_gd.jpg added

AGG vs GD output with bug2264_agg.map attached

comment:5 by dmorissette, 17 years ago

I have been able to reproduce with attached bug2264_agg.map. It seems to be a AGG vs GD issue where the smaller polygons don't get drawn on top of the larger building outline in the AGG case, See attached agg_vs_gd.jpg.

I have to leave now. Will get back at this later.

comment:6 by tbonfort, 17 years ago

I've committed a fix in r6705. flavio can you please confirm? I think this didn't always show up depending on the order polygons were drawn. the problem in the present case was polygons with holes being drawn over previous ones.

by the way flavio, your outlines are showing up aliased because they are drawn twice: once along with the fill, and a second time alone. I don't know if this is coming from the styling in the shapefile, or if it's a bug in the stylitem auto code in mapserver. do you have a way to check this ?

comment:7 by dmorissette, 17 years ago

Resolution: fixed
Status: newclosed

Thanks Thomas, I confirmed that your fix solves the issue for me so let's mark this ticket closed.

Flavio can reopen with more details if the issue persists for him when he gets a new build.

in reply to:  6 ; comment:8 by flavio, 17 years ago

Thanks as well Thomas. If Daniel confirms it, is fine for me. We cannot test as we work on special windows builds ... Have to wait for one.

Styling: I suppose it is coming from the STYLEITEM auto which does not use antialising on the borders. We will continue testing, will have to adopt our mapping files quite a bit for AGG, as far as I see (such as lines tend to show quite a bit thicker).

in reply to:  8 ; comment:9 by tbonfort, 17 years ago

Replying to flavio:

Styling: I suppose it is coming from the STYLEITEM auto which does not use antialising on the borders. We will continue testing, will have to adopt our mapping files quite a bit for AGG, as far as I see (such as lines tend to show quite a bit thicker).

this is not the case, antialiasing is always on. what happens is that your outline is drawn twice, and therefore appears thicker (i.e. the alpha values of the antilaliased pixels are more or less twice what they should be, therefore making the whole line appear aliased)

ogrinfo gives this for your table

BRUSH(fc:#cdff80,bc:#000000,id:"mapinfo-brush-2.ogr-brush-0");PEN(w:1px,c:#000000,id:"mapinfo-pen-2.ogr-pen-0")

which confirms that the outline is drawn twice (once with the brush's bc, once with the pen's c)

in reply to:  9 comment:10 by flavio, 17 years ago

this is not the case, antialiasing is always on.

ok. as said, the mapfiles are not optimized for AGG yet ... we just started testing. In any case it looks very promising.

comment:11 by dmorissette, 17 years ago

Since the main issue (the color of the polygons) is fixed, I have created new ticket #2271 about the polygon outline being drawn twice with styleitem auto. Let's move that discussion there.

Note: See TracTickets for help on using tickets.