[mapserver-users] Reading KML

alok mathur mathuralok.88 at gmail.com
Mon Mar 9 04:43:44 PDT 2015


PFB the KML and MAP file.

KML file
------------------------
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="
http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<Folder>
                        <name>Fibertech solution</name>
                        <Placemark>
                                <name>Westborough MSC - Build</name>
                                <styleUrl>#msn_ylw-pushpin4</styleUrl>
                                <LineString>
                                        <tessellate>1</tessellate>
                                        <coordinates>

-71.58570500983306,42.28745742866225,0
-71.58563778135751,42.28308954118536,0
-71.58466087108053,42.28307704913402,0
                                        </coordinates>
                                </LineString>
                        </Placemark>
                        <Placemark>
                                <name>Westborough MSC to Westborugh</name>
                                <styleUrl>#msn_ylw-pushpin8</styleUrl>
                                <LineString>
                                        <tessellate>1</tessellate>
                                        <coordinates>

-71.62172195712955,42.27186897741407,0
-71.62194000095552,42.27189433043378,0
-71.6225634332947,42.27210480296427,0
-71.62308968672842,42.27236391420707,0
-71.62394597288645,42.27309147863262,0
-71.62737594489003,42.27740640295431,0
-71.62822373584245,42.27893783334968,0
-71.63091971519079,42.28164762788888,0
-71.63207040059587,42.28370221254578,0
-71.62599732629406,42.28418518334991,0
-71.60795611539982,42.28517668969011,0
-71.60267209851122,42.28504601944216,0
-71.60188701357249,42.28516492137062,0
-71.58850360403626,42.28849573666959,0
-71.5858004650346,42.28852197680775,0 -71.58571706491037,42.2874804233345,0
                                        </coordinates>
                                </LineString>
                        </Placemark>
<Placemark>
                                <name>NEW Danbury</name>
                                <Camera>

<longitude>-73.45375129836707</longitude>
                                        <latitude>41.390460041635</latitude>

<altitude>419.0806930250601</altitude>
                                        <heading>13.43312150541231</heading>
                                        <tilt>28.58299225276625</tilt>
                                        <roll>-0.685026358787494</roll>

<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
                                </Camera>
                                <styleUrl>#msn_ylw-stars</styleUrl>
                                <Point>
                                        <gx:drawOrder>1</gx:drawOrder>

<coordinates>-73.45404626023216,41.3929335947184,0</coordinates>
                                </Point>
                        </Placemark>
</Folder>
</Document>
</kml>
-----------------------------------
MAP
=============
MAP
  NAME "QGIS-MAP"
  # Map image size
  SIZE 500 400
  UNITS meters

  EXTENT -73.454046 41.392934 -71.584661 42.288522
  #FONTSET './fonts/fonts.txt'
  #SYMBOLSET './symbols/symbols.txt'
  #PROJECTION
  #  'proj=longlat'
   # 'datum=WGS84'
   # 'no_defs'
  #END
  PROJECTION
       "init=epsg:4326"
   END

  # Background color for the map canvas -- change as desired
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE png

 OUTPUTFORMAT
    NAME "png"
    DRIVER GD/PNG
    MIMETYPE "image/png"
    IMAGEMODE RGBA
    EXTENSION "png"
    TRANSPARENT ON
  END

  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
  END

  # Web interface definition. Only the template parameter
  # is required to display a map. See MapServer documentation
  WEB
    # Set IMAGEPATH to the path where MapServer should
    # write its output.
    IMAGEPATH "/tmp/ms_tmp/"

    # Set IMAGEURL to the url that points to IMAGEPATH
    # as defined in your web server configuration
    IMAGEURL "/ms_tmp/"

    # WMS server settings
METADATA
      "wms_enable_request" "*"
      "wms_srs" "EPSG:900913 EPSG:4326 EPSG:3857 EPSG:2154 EPSG:310642901
EPSG:4171 EPSG:310024802 EPSG:310915814 EPSG:310486805 EPSG:310702807
EPSG:310700806 EPSG:310547809 EPSG:310706808 EPSG:310642810 EPSG:310642801
EPSG:310642812 EPSG:310032811 EPSG:310642813 EPSG:2986"
      "labelcache_map_edge_buffer" "-10"
      "wms_title" "osm fiber data"
      "wms_onlineresource" "http://haxv-onecontrol-154/cgi-bin/mapserv?"
      "ows_sld_enable" "true"
   END


    #Scale range at which web interface will operate
    # Template and header/footer settings
    # Only the template parameter is required to display a map. See
MapServer documentation
    #TEMPLATE 'fooOnlyForWMSGetFeatureInfo'
  END
# Start of LAYER DEFINITIONS -----------------------------
  LAYER
   NAME "kml_example_point"
   TYPE POINT
   STATUS DEFAULT
   CONNECTIONTYPE OGR
   CONNECTION "doc_test.kml"
   DATA "Fibertech solution"
   LABELITEM "NAME"
   CLASS
     #NAME "Fiber Names"
     STYLE
       COLOR 0 0 0
#       OUTLINECOLOR 255 255 255
       SYMBOL 'pin.png'
       SIZE 16
     END
#   LABEL
#     SIZE TINY
#     COLOR 0 0 0
#     OUTLINECOLOR 255 255 255
#     POSITION AUTO
#   END
#  END
END
#############

# Start of LAYER DEFINITIONS -----------------------------
  LAYER
   NAME "kml_example"
   TYPE LINE
   STATUS ON
   CONNECTIONTYPE OGR
   CONNECTION "doc_test.kml"
   DATA "Fibertech solution"
   LABELITEM "NAME"
   CLASS
     NAME "Fiber Names"
     STYLE
       COLOR 250 0 0
       OUTLINECOLOR 255 255 255
       #SYMBOL 'pin.png'
       SIZE 6
     END
   LABEL
     SIZE TINY
     COLOR 0 0 0
     OUTLINECOLOR 255 255 255
     POSITION AUTO
   END
  END
END
#############

END



On Mon, Mar 9, 2015 at 5:10 PM, alok mathur <mathuralok.88 at gmail.com> wrote:

> Hi,
>
> I have a kml file in which there is a folder containing both Line and
> Point geometry placemarks. I want to show both line and point geomerty on
> map using mapserver. but the issue is that the data source is same. so how
> can i show the point and line data on map.
> Please help me.
>
>
>
> --
>
> *Alok Mathur* | Software Engineer 2A | Ciena
> Mobile +91 9899413266
>



-- 

*Alok Mathur* | Software Engineer 2A | Ciena
Mobile +91 9899413266
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150309/6656840a/attachment.htm>


More information about the MapServer-users mailing list