Opened 13 years ago

Closed 13 years ago

#3633 closed enhancement (fixed)

Patch to read elevation for KML export from feature attribute

Reported by: mhugent Owned by: assefa
Priority: normal Milestone: 6.0 release
Component: Output-KML Version: svn-trunk (development)
Severity: normal Keywords:
Cc: marco@…

Description

Recently, I needed an option to take the z-Value for KML export from a feature attribute (and not from the vertex z-Coordinate). This is often useful in combination with the kml option 'relative to ground'. Looking into the source, I couldn't find such an option, thus added a few lines of code that adds this capability. I'm complete beginer in mapserver programming, but maybe the attached patch is of interest for others too.

The mapfile option to enable attribute driven elevation values is: METADATA

'kml_elevation_attribute' '<Name of attribute>'

END

Attachments (2)

101207_umn_mapserver_kml_elevation.diff (3.3 KB ) - added by mhugent 13 years ago.
101208_umn_mapserver_kml_elevation.diff (3.3 KB ) - added by mhugent 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by assefa, 13 years ago

Hi Marco,

Thanks a lot. I will review/commit this tonight or tomorrow.

best regards,

comment:2 by mhugent, 13 years ago

Thanks, Assefa. Uploaded is an improved patch version (does more safety checking in case a field does not exist)

comment:3 by assefa, 13 years ago

committed in r10789 doc is committed in r10790

Could you please confirm that it works as expected against svn version? Thanks.

comment:4 by mhugent, 13 years ago

Hi Assefa

Sorry the long delay. There is one problem with the commited code. KmlRenderer::mCurrentElevationValue needs to be float, not double. Otherwise, there will be a segfault.

With current trunk, I also have the problem that there are no coordinates generated for some of my KML layers. However, I was not able to find the reason for it so far.

Marco

comment:5 by assefa, 13 years ago

Milestone: 6.0 release

Hi Marco,

I am cleaning up bugs for the upcoming 6.0 release. Reading this, I am not sure why the there would be a segfault. The lineBuf size seems to be enough to accommodate both types or am I missed something?

As for the 2nd issue, I can look into if it make sense, provided a file/map.

Thanks

comment:6 by assefa, 13 years ago

Resolution: fixed
Status: newclosed

please reopen if there is a problem.

Note: See TracTickets for help on using tickets.