Opened 10 years ago

Last modified 9 months ago

#6338 new enhancement

Better display of incomplete multipolygons

Reported by: stoecker Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: multipolygon incomplete display Cc:


Incomplete multipolygons may be displayed a lot better, when they are clipped at the download boundaries. It is not possible to get this always right, but in most cases a good guess should be usable to improve display a lot.

Attachments (0)

Change History (4)

comment:1 Changed 10 years ago by bastiK

Here is some simple clipping (by Gubaer):

     * <p>Prepares the clipping area of the graphics context in such a way, that no
     * points, lines or areas are rendered outside the data source bounding boxes in
     * {@code ds}.</p>
     * @param ds the data set. If null, no clipping area is set.
    public void prepareClippingAgainstDownloadArea(DataSet ds) {
        if (ds == null) return;
        Area clip = null;
        for (Bounds bounds: ds.getDataSourceBounds()) {
            if (bounds.isCollapsed()) {
            Point p1 = nc.getPoint(bounds.getMin());
            Point p2 = nc.getPoint(bounds.getMax());
            Rectangle r = new Rectangle(Math.min(p1.x, p2.x),Math.min(p1.y, p2.y),Math.abs(p2.x-p1.x),Math.abs(p2.y-p1.y));
            if (clip == null){
                clip = new Area(r);
            } else {
                clip.add(new Area(r));
        if (clip != null && !clip.isEmpty()) {
             * Clipping area of g at this point already set to the map viewport. Intersect with
             * the areas of bounding boxes.
            Shape formerClip = g.getClip();
            if (formerClip != null){
                clip.intersect(new Area(formerClip));

        if (clip != null && !clip.isEmpty()) {
Last edited 3 years ago by Don-vip (previous) (diff)

comment:2 Changed 7 years ago by Don-vip

See also #6020 and #7635.

comment:3 Changed 3 years ago by Don-vip

Keywords: multipolygon added

comment:4 Changed 9 months ago by skyper

Keywords: incomplete display added

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to stoecker
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.