[Geoserver-devel] Extruding KML points with GeoServer 2.4.x

Hello,

I’m Víctor González, I am a developer. Currently I work with a customer that needs to extrude KML data using GeoServer. When we extrude polygons it works as expected, but we found a problem when doing it with points. The version we are using is 2.4.0.

I found that this has been already reported [1]. Also, I know that there was a codesprint las friday [2]. However, I didn’t find any update in the issue tracker or any commit referencing the issue in the github repo.

Is there any progress with this? Is anybody else currently working on it? Provided that we can spend some time on fixing it ourselves and contribute the solution, any advices?

Best regards,
Víctor.

[1] http://jira.codehaus.org/browse/GEOS-6167
[2] http://blog.geoserver.org/2013/12/10/geoserver-bug-fix-online-code-sprint-this-friday-2/

On Mon, Dec 16, 2013 at 7:04 PM, Victor Gonzalez <victor.gonzalez@anonymised.com

wrote:

Hello,

I'm Víctor González, I am a developer. Currently I work with a customer
that needs to extrude KML data using GeoServer. When we extrude polygons it
works as expected, but we found a problem when doing it with points. The
version we are using is 2.4.0.

I found that this has been already reported [1]. Also, I know that there
was a codesprint las friday [2]. However, I didn't find any update in the
issue tracker or any commit referencing the issue in the github repo.

Is there any progress with this? Is anybody else currently working on it?
Provided that we can spend some time on fixing it ourselves and contribute
the solution, any advices?

Best regards,
Víctor.

[1] http://jira.codehaus.org/browse/GEOS-6167

This report is related to all geometries, not only points, the issue there
is that the code always refers to the
ground, not to the sea level, and supposedly there is a parameter to make
it refer the sea level, that is not honored.

The issue you report is not being worked on by anyone, that I know of.
However... not sure what you'd expect
from a point "extrusion", a single line from the ground to the point maybe?

Cheers
Andrea

--
*== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to
06/01/2014 ==*

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi Andrea,

Thanks for the quick response. Maybe it’s a different issue then because we are able to extrude polygons as explained here [1]. After placing the height.ftl file on the corresponding directory, the KML file returned by:

[http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml](http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml)

returns something like this:

1
relativeToGround

1
relativeToGround

And it is displayed as in the screenshots. However, if we use a point layer (I’m using a test layer with a single point) and perform the same request we obtain a KML with:

...

which doesn’t contain the or the tags, even if the latter is specified in the request. I assumed that’s what the issue was talking about: internally always uses clampToGround, which results in missing tags in the KML output.

Regarding the extrusion, probably the most useful result would be to place the point over the ground with altitudeMode:relativeToGround and extrusion:false. But that’s not a real extrusion, actually. If you edit by hand the generated KML to add and , Google Earth draws the extrusion as a line from the ground to the point, as you say.

Regards,
Víctor.

···

2013/12/16 Andrea Aime <andrea.aime@anonymised.com>

On Mon, Dec 16, 2013 at 7:04 PM, Victor Gonzalez <victor.gonzalez@anonymised.com> wrote:

Hello,

I’m Víctor González, I am a developer. Currently I work with a customer that needs to extrude KML data using GeoServer. When we extrude polygons it works as expected, but we found a problem when doing it with points. The version we are using is 2.4.0.

I found that this has been already reported [1]. Also, I know that there was a codesprint las friday [2]. However, I didn’t find any update in the issue tracker or any commit referencing the issue in the github repo.

Is there any progress with this? Is anybody else currently working on it? Provided that we can spend some time on fixing it ourselves and contribute the solution, any advices?

Best regards,
Víctor.

[1] http://jira.codehaus.org/browse/GEOS-6167

This report is related to all geometries, not only points, the issue there is that the code always refers to the
ground, not to the sea level, and supposedly there is a parameter to make it refer the sea level, that is not honored.

The issue you report is not being worked on by anyone, that I know of. However… not sure what you’d expect
from a point “extrusion”, a single line from the ground to the point maybe?

Cheers
Andrea

== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to 06/01/2014 ==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Dec 16, 2013 at 7:31 PM, Victor Gonzalez <victor.gonzalez@anonymised.com

wrote:

Hi Andrea,

Thanks for the quick response. Maybe it's a different issue then because
we are able to extrude polygons as explained here [1]. After placing the
height.ftl file on the corresponding directory, the KML file returned by:

http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml

returns something like this:

...
<MultiGeometry>
<Point>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>...</coordinates>
</Point>
<Polygon>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<outerBoundaryIs>
...
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
...

And it is displayed as in the screenshots. However, if we use a point
layer (I'm using a test layer with a single point) and perform the same
request we obtain a KML with:

...
<Point>
<coordinates>...</coordinates>
</Point>
...

which doesn't contain the <extrude/> or the <altitudeMode/> tags, even if
the latter is specified in the request. I assumed that's what the issue was
talking about: internally always uses clampToGround, which results in
missing tags in the KML output.

Regarding the extrusion, probably the most useful result would be to place
the point over the ground with altitudeMode:relativeToGround and
extrusion:false. But that's not a real extrusion, actually. If you edit by
hand the generated KML to add <altitudeMode> and <extrusion>, Google Earth
draws the extrusion as a line from the ground to the point, as you say.

Yes, in that case, I'd create a new option, that adds the Z to the
coordinates based on a template, similar to extrusion, but wihout the
<extrusion> element,
and make it available for all geometry types

Cheers
Andrea

--
*== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to
06/01/2014 ==*

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

I’m not sure I understand the idea of the new option. The heights templates [1] do exactly what we want to do, right? In fact, I just checked that with Geoserver 2.3.0 we obtain the results we expect for points (I’m attaching two screenshots with and without extrusion); but polygons don’t extrude in Geoserver 2.3.0 (we cannot obtain the results shown in [1]). In Geoserver 2.4.0 we have the opposite, we can extrude polygons (as in [1]) but we cannot “extrude” our points (as in my screenshots with 2.3.0).

Does this mean that this is a different issue than [2]?

Regards,
Víctor.

P.D: The URLs I used for the screenshots are:

http://localhost:8080/geoserver/wms/reflect?layers=sde:test&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:false
http://localhost:8080/geoserver/wms/reflect?layers=sde:test&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:true

[1] http://docs.geoserver.org/stable/en/user/googleearth/tutorials/heights/heights.html
[2] http://jira.codehaus.org/browse/GEOS-6167

···

2013/12/18 Andrea Aime <andrea.aime@anonymised.com>

On Mon, Dec 16, 2013 at 7:31 PM, Victor Gonzalez <victor.gonzalez@anonymised.com> wrote:

Hi Andrea,

Thanks for the quick response. Maybe it’s a different issue then because we are able to extrude polygons as explained here [1]. After placing the height.ftl file on the corresponding directory, the KML file returned by:

[http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml](http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml)

returns something like this:

1
relativeToGround

1
relativeToGround

And it is displayed as in the screenshots. However, if we use a point layer (I’m using a test layer with a single point) and perform the same request we obtain a KML with:

...

which doesn’t contain the or the tags, even if the latter is specified in the request. I assumed that’s what the issue was talking about: internally always uses clampToGround, which results in missing tags in the KML output.

Regarding the extrusion, probably the most useful result would be to place the point over the ground with altitudeMode:relativeToGround and extrusion:false. But that’s not a real extrusion, actually. If you edit by hand the generated KML to add and , Google Earth draws the extrusion as a line from the ground to the point, as you say.

Yes, in that case, I’d create a new option, that adds the Z to the coordinates based on a template, similar to extrusion, but wihout the element,
and make it available for all geometry types

Cheers

Andrea

== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to 06/01/2014 ==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Sorry, I forgot the screenshots:

https://dl.dropboxusercontent.com/u/62764853/extruded_point.png
https://dl.dropboxusercontent.com/u/62764853/non_extruded_point.png

···

2013/12/19 Victor Gonzalez <victor.gonzalez@anonymised.com>

I’m not sure I understand the idea of the new option. The heights templates [1] do exactly what we want to do, right? In fact, I just checked that with Geoserver 2.3.0 we obtain the results we expect for points (I’m attaching two screenshots with and without extrusion); but polygons don’t extrude in Geoserver 2.3.0 (we cannot obtain the results shown in [1]). In Geoserver 2.4.0 we have the opposite, we can extrude polygons (as in [1]) but we cannot “extrude” our points (as in my screenshots with 2.3.0).

Does this mean that this is a different issue than [2]?

Regards,
Víctor.

P.D: The URLs I used for the screenshots are:

http://localhost:8080/geoserver/wms/reflect?layers=sde:test&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:false
http://localhost:8080/geoserver/wms/reflect?layers=sde:test&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:true

[1] http://docs.geoserver.org/stable/en/user/googleearth/tutorials/heights/heights.html
[2] http://jira.codehaus.org/browse/GEOS-6167

2013/12/18 Andrea Aime <andrea.aime@anonymised.com>

On Mon, Dec 16, 2013 at 7:31 PM, Victor Gonzalez <victor.gonzalez@anonymised.com> wrote:

Hi Andrea,

Thanks for the quick response. Maybe it’s a different issue then because we are able to extrude polygons as explained here [1]. After placing the height.ftl file on the corresponding directory, the KML file returned by:

[http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml](http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml)

returns something like this:

1
relativeToGround

1
relativeToGround

And it is displayed as in the screenshots. However, if we use a point layer (I’m using a test layer with a single point) and perform the same request we obtain a KML with:

...

which doesn’t contain the or the tags, even if the latter is specified in the request. I assumed that’s what the issue was talking about: internally always uses clampToGround, which results in missing tags in the KML output.

Regarding the extrusion, probably the most useful result would be to place the point over the ground with altitudeMode:relativeToGround and extrusion:false. But that’s not a real extrusion, actually. If you edit by hand the generated KML to add and , Google Earth draws the extrusion as a line from the ground to the point, as you say.

Yes, in that case, I’d create a new option, that adds the Z to the coordinates based on a template, similar to extrusion, but wihout the element,
and make it available for all geometry types

Cheers

Andrea

== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to 06/01/2014 ==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


In order to clarify this, I created an issue: http://jira.codehaus.org/browse/GEOS-6247

It includes a patch and a JUnit test. It shows the expected result and the changes to obtain it.

The problem is that PlacemarkGeometryDecorator.applyExtrusion is never called for points from encodeGeometry.

Regards,
Víctor.

···

2013/12/19 Victor Gonzalez <victor.gonzalez@anonymised.com>

Sorry, I forgot the screenshots:

https://dl.dropboxusercontent.com/u/62764853/extruded_point.png
https://dl.dropboxusercontent.com/u/62764853/non_extruded_point.png

2013/12/19 Victor Gonzalez <victor.gonzalez@anonymised.com>

I’m not sure I understand the idea of the new option. The heights templates [1] do exactly what we want to do, right? In fact, I just checked that with Geoserver 2.3.0 we obtain the results we expect for points (I’m attaching two screenshots with and without extrusion); but polygons don’t extrude in Geoserver 2.3.0 (we cannot obtain the results shown in [1]). In Geoserver 2.4.0 we have the opposite, we can extrude polygons (as in [1]) but we cannot “extrude” our points (as in my screenshots with 2.3.0).

Does this mean that this is a different issue than [2]?

Regards,
Víctor.

P.D: The URLs I used for the screenshots are:

http://localhost:8080/geoserver/wms/reflect?layers=sde:test&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:false
http://localhost:8080/geoserver/wms/reflect?layers=sde:test&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:true

[1] http://docs.geoserver.org/stable/en/user/googleearth/tutorials/heights/heights.html
[2] http://jira.codehaus.org/browse/GEOS-6167

2013/12/18 Andrea Aime <andrea.aime@anonymised.com>

On Mon, Dec 16, 2013 at 7:31 PM, Victor Gonzalez <victor.gonzalez@anonymised.com> wrote:

Hi Andrea,

Thanks for the quick response. Maybe it’s a different issue then because we are able to extrude polygons as explained here [1]. After placing the height.ftl file on the corresponding directory, the KML file returned by:

[http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml](http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml+xml)

returns something like this:

1
relativeToGround

1
relativeToGround

And it is displayed as in the screenshots. However, if we use a point layer (I’m using a test layer with a single point) and perform the same request we obtain a KML with:

...

which doesn’t contain the or the tags, even if the latter is specified in the request. I assumed that’s what the issue was talking about: internally always uses clampToGround, which results in missing tags in the KML output.

Regarding the extrusion, probably the most useful result would be to place the point over the ground with altitudeMode:relativeToGround and extrusion:false. But that’s not a real extrusion, actually. If you edit by hand the generated KML to add and , Google Earth draws the extrusion as a line from the ground to the point, as you say.

Yes, in that case, I’d create a new option, that adds the Z to the coordinates based on a template, similar to extrusion, but wihout the element,
and make it available for all geometry types

Cheers

Andrea

== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to 06/01/2014 ==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Thu, Dec 19, 2013 at 9:56 AM, Victor Gonzalez <victor.gonzalez@anonymised.com

wrote:

Sorry, I forgot the screenshots:

https://dl.dropboxusercontent.com/u/62764853/extruded_point.png

Ok, so this is the correct behavior when using extrude, it is consistent
with line and polygon behavior.

https://dl.dropboxusercontent.com/u/62764853/non_extruded_point.png

And this would be something different, it's not extrusion, it's a "z
offset" (not very good with names, accepting suggestions) instead.
I don't believe we have such an option today, that's why I suggest to add a
new one to get this result.

Cheers
Andrea

--
*== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to
06/01/2014 ==*

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

In fact, that z-offset option can be obtained with altitudeMode=relativeToGround and extrude=false.

That’s already working for polygons and it would be enough for us if it worked for points. That’s what I suggest in the issue I just opened and it will be consistent with lines and polygons for both cases (extrude true and false).

To check the “z-offset” with extrude=false for polygons, I used this URL:

[http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:false](http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:false)

and obtained this result: https://dl.dropboxusercontent.com/u/62764853/non_extruded_polygons.png

Cheers,
Víctor.

···

2013/12/26 Andrea Aime <andrea.aime@anonymised.com>

On Thu, Dec 19, 2013 at 9:56 AM, Victor Gonzalez <victor.gonzalez@anonymised.com> wrote:

Sorry, I forgot the screenshots:

https://dl.dropboxusercontent.com/u/62764853/extruded_point.png

Ok, so this is the correct behavior when using extrude, it is consistent with line and polygon behavior.

https://dl.dropboxusercontent.com/u/62764853/non_extruded_point.png

And this would be something different, it’s not extrusion, it’s a “z offset” (not very good with names, accepting suggestions) instead.
I don’t believe we have such an option today, that’s why I suggest to add a new one to get this result.

Cheers

Andrea

== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to 06/01/2014 ==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Thu, Dec 26, 2013 at 10:47 AM, Victor Gonzalez <
victor.gonzalez@anonymised.com> wrote:

In fact, that z-offset option can be obtained with
altitudeMode=relativeToGround and extrude=false.

That's already working for polygons and it would be enough for us if it
worked for points. That's what I suggest in the issue I just opened and it
will be consistent with lines and polygons for both cases (extrude true and
false).

To check the "z-offset" with extrude=false for polygons, I used this URL:

http://localhost:8080/geoserver/wms/reflect?layers=topp:states&format=application/vnd.google-earth.kml%2Bxml&format_options=extrude:false

and obtained this result:
https://dl.dropboxusercontent.com/u/62764853/non_extruded_polygons.png

Ah ok, makes sense. Doh, I did rewrite the KML subsystem fully a few months
ago (it had become a giant
mess, nobody wanted to work on it anymore), but was not aware of
this combination of options (only ever used height template with extrusion
on :-p)

Cheers
Andrea

--
*== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to
06/01/2014 ==*

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------