[Geoserver-users] Why does KML link give me KMX ?

Hello,
I am trying to include a layer in OpenLayers. I have set up the POSTGIS connection to my layer but when I click on the DEMO page and KML I get downloaded a KMZ file.

http://localhost.no:8080/geoserver/wms/kml?layers=kulturminner_ns:boplass

I checked on another geoserver and there the link downloads a KML file. What am I doing wrong? Is it something to do with the proxy.cgi?

/asle

Hi Asle,

it is actually a KML file, it just has the .kmz extension. We used to compress the KML output by default, I guess we don't anymore. Could you file a jira issue?

(The "wms/kml" part of the URL does not imply the format, it only tells GeoServer this is a KML-related request.)

-Arne

Asle Benoni wrote:

Hello,
I am trying to include a layer in OpenLayers. I have set up the POSTGIS connection to my layer but when I click on the DEMO page and KML I get downloaded a KMZ file.

http://localhost.no:8080/geoserver/wms/kml?layers=kulturminner_ns:boplass

I checked on another geoserver and there the link downloads a KML file. What am I doing wrong? Is it something to do with the proxy.cgi?

/asle

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers

The KML reflector is optimized for use with Google Earth, which means
that it returns a compressed kml file with a regionated hierarchy
whenever possible. If you want the raw XML, you can either:
* request a non-regionated, non-compressed KML file by appending
'&mode=download' to your request parameters, or
* go through the "real" WMS (geoserver/wms) and set format=kml.

Hope this helps.
--
David Winslow
OpenGeo - http://opengeo.org/

On Thu, 2009-03-26 at 14:05 +0100, Arne Kepp wrote:

Hi Asle,

it is actually a KML file, it just has the .kmz extension. We used to
compress the KML output by default, I guess we don't anymore. Could you
file a jira issue?

(The "wms/kml" part of the URL does not imply the format, it only tells
GeoServer this is a KML-related request.)

-Arne

Asle Benoni wrote:
> Hello,
> I am trying to include a layer in OpenLayers. I have set up the
> POSTGIS connection to my layer but when I click on the DEMO page and
> KML I get downloaded a KMZ file.
>
> http://localhost.no:8080/geoserver/wms/kml?layers=kulturminner_ns:boplass
>
> I checked on another geoserver and there the link downloads a KML
> file. What am I doing wrong? Is it something to do with the proxy.cgi?
>
> /asle
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

Hi,
I understand that I am using GeoServer 1.7.3 and that the output is KMZ always?
The KMZ file I download from the GeoServer demo page zooms to the correct area when I open it in Google Earth. But all the markers were gone! So I found out that I had put this in Config-Server:

Proxy Base URL: mydomainame.no:8080

When I left that field in config empty I get the same KMZ file but now with correct markers. I am confused as to how this affects the serving of KML/KMZ to OpenLayers. Here is the code from my html which shows no data, only the name of the layer.

var kml =new OpenLayers.Layer.GML(“KML kulturminner”, “http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kmz+XML&transparent=true&”,
{
format: OpenLayers.Format.KML,
formatOptions: {
extractStyles: true,
extractAttributes: true
}
});

And I can see it is loaded in Firebug with this request:

url http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth
.kmz+XML&transparent=true&

And this response:

<?xml version="1.0" encoding="UTF-8"?> kulturminner_ns:gravminne 1 1 onStop 1 11.242907598744864 59.337531461714526 0 178137.16338200175 0 0 clampToGround

I found out that whe

Den 26. mars. 2009 kl. 14.57 skrev David Winslow:

The KML reflector is optimized for use with Google Earth, which means
that it returns a compressed kml file with a regionated hierarchy
whenever possible. If you want the raw XML, you can either:

  • request a non-regionated, non-compressed KML file by appending
    ‘&mode=download’ to your request parameters, or
  • go through the “real” WMS (geoserver/wms) and set format=kml.

Hope this helps.

David Winslow
OpenGeo - http://opengeo.org/

On Thu, 2009-03-26 at 14:05 +0100, Arne Kepp wrote:

Hi Asle,

it is actually a KML file, it just has the .kmz extension. We used to

compress the KML output by default, I guess we don’t anymore. Could you

file a jira issue?

(The “wms/kml” part of the URL does not imply the format, it only tells

GeoServer this is a KML-related request.)

-Arne

Asle Benoni wrote:

Hello,

I am trying to include a layer in OpenLayers. I have set up the

POSTGIS connection to my layer but when I click on the DEMO page and

KML I get downloaded a KMZ file.

http://localhost.no:8080/geoserver/wms/kml?layers=kulturminner_ns:boplass

I checked on another geoserver and there the link downloads a KML

file. What am I doing wrong? Is it something to do with the proxy.cgi?

/asle



Geoserver-users mailing list

Geoserver-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/geoserver-users

Aha. I think I found out the one with Proxy Base URL. I forgot the “http://” - Now my KMZ files load correctly in Google Earth at least!
/asle

Den 26. mars. 2009 kl. 16.10 skrev Asle Benoni:

Hi,
I understand that I am using GeoServer 1.7.3 and that the output is KMZ always?
The KMZ file I download from the GeoServer demo page zooms to the correct area when I open it in Google Earth. But all the markers were gone! So I found out that I had put this in Config-Server:

Proxy Base URL: mydomainame.no:8080

When I left that field in config empty I get the same KMZ file but now with correct markers. I am confused as to how this affects the serving of KML/KMZ to OpenLayers. Here is the code from my html which shows no data, only the name of the layer.

var kml =new OpenLayers.Layer.GML(“KML kulturminner”, “http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth.kmz+XML&transparent=true&”,
{
format: OpenLayers.Format.KML,
formatOptions: {
extractStyles: true,
extractAttributes: true
}
});

And I can see it is loaded in Firebug with this request:

url http://naturkart.no:8080/geoserver/wms/kml?layers=kulturminner_ns:gravminne&format=application/vnd.google-earth
.kmz+XML&transparent=true&

And this response:

<?xml version="1.0" encoding="UTF-8"?> kulturminner_ns:gravminne 1 1 onStop 1 11.242907598744864 59.337531461714526 0 178137.16338200175 0 0 clampToGround

I found out that whe

Den 26. mars. 2009 kl. 14.57 skrev David Winslow:

The KML reflector is optimized for use with Google Earth, which means
that it returns a compressed kml file with a regionated hierarchy
whenever possible. If you want the raw XML, you can either:

  • request a non-regionated, non-compressed KML file by appending
    ‘&mode=download’ to your request parameters, or
  • go through the “real” WMS (geoserver/wms) and set format=kml.

Hope this helps.

David Winslow
OpenGeo - http://opengeo.org/

On Thu, 2009-03-26 at 14:05 +0100, Arne Kepp wrote:

Hi Asle,

it is actually a KML file, it just has the .kmz extension. We used to

compress the KML output by default, I guess we don’t anymore. Could you

file a jira issue?

(The “wms/kml” part of the URL does not imply the format, it only tells

GeoServer this is a KML-related request.)

-Arne

Asle Benoni wrote:

Hello,

I am trying to include a layer in OpenLayers. I have set up the

POSTGIS connection to my layer but when I click on the DEMO page and

KML I get downloaded a KMZ file.

http://localhost.no:8080/geoserver/wms/kml?layers=kulturminner_ns:boplass

I checked on another geoserver and there the link downloads a KML

file. What am I doing wrong? Is it something to do with the proxy.cgi?

/asle



Geoserver-users mailing list

Geoserver-users@anonymised.comrge.net

https://lists.sourceforge.net/lists/listinfo/geoserver-users