[mapserver-users] mapserver with kml

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Dec 14 10:01:30 PST 2017


Hi,


The name of the format in the GetCapabilities is

<Format>application/vnd.google-earth.kml+xml</Format>

Use that.


I have never used CRS:84 as CRS and I don't know if it really works. You can stay in WMS version 1.1.1 and SRS=EPSG:4326. Verify first with image/png that GetMap returns a map.


Read

http://www.mapserver.org/optimization/debugging.html,<http://www.mapserver.org/optimization/debugging.html> add MS_ERRORFILE and DEBUG 5 and see what you get.


-Jukka Rahkonen-


________________________________
Lähettäjä: Ivan Ogasawara <ivan.ogasawara at gmail.com>
Lähetetty: 14. joulukuuta 2017 18:35
Vastaanottaja: Rahkonen Jukka (MML)
Kopio: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] mapserver with kml

Dear all, thanks :)

Carlo Ruiz,

> http://mapserver.org/input/vector/kml.html

Actually, in my case, the input should be shapefile and the outputs gtiff,png and kml.

http://mapserver.org/output/kml_output.html



Jukka Rahkonen,

> I used version 1.3.0 so that the response will open into the browser automatically.

Great! I changed to v 1.3.0 too

this is my new url request:

http://172.17.0.2/?map=/maps/dengue-Rio-de-Janeiro.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=RIO_DE_JANEIRO&STYLES=&CRS=CRS:84&BBOX=-43.7965385309,-23.0828926973,-43.0990394004,-22.7460202858&WIDTH=400&HEIGHT=300&FORMAT=kml

> Do you have KML in the list?

yes. Full GetCapabilities xml here: https://pastebin.com/z2myYc5m

> Did you just guess or is there somewhere wrong documentation about metadata item you have tried # "wms_format" "image/png")

I saw it at some page ... but I think I haven't seen any difference (I don't remember so well) .. so I commented this option.

> However, you must explicitly add KML into WMS outputformats in the metadata. It seems that you have played with it because you have this line commented out:

OK .. I added `wms_getmap_formatlist` parameter. I also added `wms_formatlist` to metadata layer

I also change SRS=EPSG:4326 to CRS=CRS:84



Seth,

> Ivan's problem looks to be a projection issue only.

I also added crs:84 .. but the result is the same ..

KML by specification uses only a single projection, EPSG:4326 (http://www.gdal.org/drv_kml.html)

My shapefile is defined as epsg:4326 too

The png output works fine ... maybe something in kml conversion is doing wrong ...


The log about kml request is here: https://pastebin.com/iP4h0wXx



Ivan Ogasawara

2017-12-14 10:08 GMT-04:00 Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>>:
Hi,

Geoservers have KML output enabled by default so you can have a try with clients.  Test-URL

http://demo.geo-solutions.it/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=1373&HEIGHT=840&LAYERS=topp%3Astates&TRANSPARENT=TRUE&FORMAT=application/vnd.google-earth.kml+xml&BBOX=-124.731422,19.49461526802622,-66.969849,54.83308673197378&SRS=EPSG:4326&STYLES=

WMS 1.3.0 does not say anything about GetMap formats, just that they must appear in GetCapabilities, and all formats that appear in GetCapabilities must also be usable.

-Jukka Rahkonen-

Lähettäjä: Seth G [mailto:sethg at geographika.co.uk<mailto:sethg at geographika.co.uk>]
Lähetetty: 14. joulukuuta 2017 14:56
Vastaanottaja: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>>; mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>

Aihe: Re: [mapserver-users] mapserver with kml

Interesting!

>From the WMS spec: "Graphic element formats include Scalable Vector Graphics (SVG; MIME type “image/svg+xml”) or Web Computer Graphics Metafile (WebCGM; MIME type “image/cgm;Version=4;ProfileId=WebCGM”) formats"

I wonder how many WMS clients would handle KML as a WMS. As it is XML then it would't be accessible from another domain in a web client.

Ivan's problem looks to be a projection issue only.

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Thu, Dec 14, 2017, at 10:42 AM, Rahkonen Jukka (MML) wrote:

Hi Seth,



KML is considered as an image format and it should work with WMS and with mode=map http://mapserver.gis.umn.edu/fr/development/rfc/ms-rfc-58.html



It seems that KML output has not been developed much since the initial implementation.



-Jukka Rahkonen-



Lähettäjä: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Seth G
Lähetetty: 14. joulukuuta 2017 10:03
Vastaanottaja: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Aihe: Re: [mapserver-users] mapserver with kml



Hi,



Your output image looks like a projection issue. Google Maps use the espg:3857 projection, but your request is asking for SRS=epsg:4326, maybe try changing this?

Also are you trying to return KML or display an image using KML as a data source? If you are trying to return KML you'd need to use WFS rather than WMS which only returns images.



Seth



--

web:http://geographika.co.uk

twitter: @geographika





On Thu, Dec 14, 2017, at 01:33 AM, Ivan Ogasawara wrote:



Dear all,



Anyone knows some tutorial to work with mapserver (wms) and kml?



I am trying to do it .. but with no success.



this is the local url used:



http://172.17.0.2/?map=/maps/dengue-Rio-de-Janeiro.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=RIO_DE_JANEIRO&STYLES=&SRS=epsg:4326&BBOX=-43.7965385309,-23.0828926973,-43.0990394004,-22.7460202858&WIDTH=400&HEIGHT=300&FORMAT=kml.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=RIO_DE_JANEIRO&STYLES=&SRS=epsg:4326&BBOX=-43.7965385309,-23.0828926973,-43.0990394004,-22.7460202858&WIDTH=400&HEIGHT=300&FORMAT=kml



for image/png works fine (tested with leaflet).



Any tips?





Files:

* mapfiles:

  * https://pastebin.com/4EkahMZi

  * https://pastebin.com/DVSt4mmS

* kml: https://pastebin.com/LYkD4ZDL

* Result: https://user-images.githubusercontent.com/5209757/33969313-f7029096-e042-11e7-8621-e8235f0bd5ce.png





Thanks!



My best regards,

Ivan



_______________________________________________

mapserver-users mailing list

mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>

https://lists.osgeo.org/mailman/listinfo/mapserver-users




_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mapserver-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20171214/0b12b4c2/attachment-0001.html>


More information about the mapserver-users mailing list