Opened 13 years ago

Last modified 13 years ago

#3992 new defect

KML Coordinates placed at Label coords - should be at shape coords

Reported by: msmitherdc Owned by: assefa
Priority: high Milestone: 6.0.2 release
Component: Output-KML Version: svn-trunk (development)
Severity: major Keywords: kml, incorrect coordinates
Cc:

Description

I'm seeing incorrect coordinates in KML output but only at smaller zoom levels. I'm seeing the behavior in both shapefiles and oraclespatial. Its occuring in points but not in polygons.

I added a debugging line at line 725 of mapkmlrenderer.cpp [r

msDebug("KmlRenderer - 3::add coordinates:\t%.8f,%.8f\n", pts[i].x, pts[i].y);

Attached is the log output.

Interesting, when calling oracle spatial, the correct coords get displayed first then then incorrect coords. Coords are shifted by 8 degress in lat and lon. Shapefiles only show the incorrect coordinates.

Attachments (2)

KML_Layer_log.txt (11.0 KB ) - added by msmitherdc 13 years ago.
Log of coordinates from kml output
kmlpatch_labelsxy.patch (580 bytes ) - added by msmitherdc 13 years ago.
Patch to remove label XY as the Placemark XY

Download all attachments as: .zip

Change History (9)

by msmitherdc, 13 years ago

Attachment: KML_Layer_log.txt added

Log of coordinates from kml output

comment:1 by msmitherdc, 13 years ago

revision is [r12054]

comment:2 by msmitherdc, 13 years ago

Its not zoom level thats causing this, its the LABEL OFFSET.

I have a layer that has a class like this

CLASS

NAME "Passenger Ship Locations" EXPRESSION 'Passenger' STYLE

SYMBOL 'passenger' SIZE 15 ANGLE [DIRECTION]

END

LABEL

ANTIALIAS true BUFFER 0 COLOR 0 0 255 OUTLINECOLOR 255 255 255 FONT "century-gothic-bold" POSITION AUTO SIZE 10 TYPE truetype PARTIALS false OFFSET 8 -8 BUFFER 2

END

END

The LABEL OFFSET is being applied to the KML Placemark

in reply to:  2 comment:3 by msmitherdc, 13 years ago

CLASS
    NAME "Passenger Ship Locations"
    EXPRESSION 'Passenger'
    STYLE
      SYMBOL 'passenger'
      SIZE 15
      ANGLE [DIRECTION]
    END
      LABEL
    	  ANTIALIAS true
    	  BUFFER 0
    	  COLOR 0 0 255
    	  OUTLINECOLOR 255 255 255
    	  FONT "century-gothic-bold"
    	  POSITION AUTO
    	  SIZE 10
    	  TYPE truetype
    	  PARTIALS false
 	  OFFSET 8 -8
    	  BUFFER 2
    END
  END

better formatting

comment:4 by assefa, 13 years ago

mike, I will give it a look early next week. Sorry fir the delay on this.

comment:5 by msmitherdc, 13 years ago

No problem, it allowed me some time to find out what the problem really was.

Mike

comment:6 by msmitherdc, 13 years ago

Looks like the problem is here (line 233)

/*if there are labels we want the coordinates to 
      be the center of the element.*/
 for(i=0; i<layer->numclasses; i++)
      layer->_class[i]->label.position = MS_XY;

I don't think we want the placemark at the label coords. I've commented out this section and it now works fine with the LABEL OFFSETs.

I propose we remove placing of Placemarks at the label position.

Mike

by msmitherdc, 13 years ago

Attachment: kmlpatch_labelsxy.patch added

Patch to remove label XY as the Placemark XY

comment:7 by msmitherdc, 13 years ago

Summary: KML Coordinates incorrect at certain zoom levelsKML Coordinates placed at Label coords - should be at shape coords
Note: See TracTickets for help on using tickets.