Did you know ... Search Documentation:
Pack space -- prolog/space/kml.pl
PublicShow source
 kml_file_to_georss(+KMLfile) is det
 kml_file_to_georss(+KMLfile, +RDFfile) is det
Converts the contents of an KML file into GeoRSS RDF in the RDF database of Prolog. The Geometries are converted to GeoRSS properties and values. Documents, Folders, etc. are ignored. MultiGeometry objects are expanded into separate simple Geometries. Geometries with an XML ID are assigned that ID as URI, other Geometries are assigned a RDF blank node. The kml:name and kml:description are translated to RDF properties.
 georss_to_kml_file(+KMLfile) is det
 georss_to_kml_file(+KMLfile, +Options) is det
Converts the contents of the RDF database of Prolog into a KML file without style information and without Folders. kml:name and kml:description properties in the RDF database are converted to their KML counterparts. Options can be used to pass Document level options, for example, the name of the dataset. Options can also include a graph(Graph) option to specify which RDF named graph should be converted to KML.
 kml_shape(?Stream, ?Shape) is semidet
 kml_shape(?Stream, ?Shape, ?Attributes, ?Content) is semidet
Converts between the KML serialization of a shape and its internal Prolog term representation. Attributes and Content can hold additional attributes and XML content elements of the KML, like ID, name, or styleUrl.
 kml_uri_shape(?KML, ?URI, ?Shape) is semidet
Converts between the KML serialization of a URI-shape pair and its internal Prolog term representation. It is assumed the KML Geometry element has a ID attribute specifying the URI of the shape. e.g.
<PointID="http://example.org/point1"><coordinates>52.37,4.89</coordinates></Point>
 kml_file_shape(+File, ?Shape) is semidet
 kml_file_shape(+File, ?Shape, ?Attributes, ?Content) is semidet
Reads shapes from a KML file using kml_shape/2. kml_file_shape/4 also reads extra attributes and elements of the KML Geometry. e.g. <Point targetId="NCName"><extrude>0</extrude>...</Point> will, besides parsing the Point, also instantiate Content with [extrude(0)] and Attributes with [targetId('NCName')].
 kml_file_uri_shape(+File, ?URI, ?Shape) is semidet
Reads URI-shape pairs from File using kml_uri_shape/2.
 kml_save_header(+Stream, +Options) is semidet
Outputs a KML header to Stream. This can be followed by calls to kml_save_shape/3 and kml_save_footer/1.

Options is an option list that can contain the option name(Name) specifying the Name of the document.

To be done
- options to configure optional entities, like styles
 kml_save_shape(+Stream, +Shape, +Options) is semidet
Outputs a KML serialization of Shape to Stream. This can be preceded by a call to kml_save_header/2 and followed by more calls to kml_save_shape/3 and a call to kml_save_footer/1.

Options is an option list that can contain the option attr(+List) or content(+List) that can be used to add additional attributes or xml element content to a shape. This can be used to specify things like the ID or name.

Layout elements, like Placemark and Folder, have their own separate extra attributes to supply additional attributes and content. These can contain the special terms geom_attributes and geom_content that pass their content to the shape contained by the Placemark. For example, rendering a Placemark with the ID "placemark12" of an extruded Point shape with its URI as name of the Placemark and as ID of the shape and an additional styleUrl works as follows:

kml_save_shape(Stream,
               placemark(point(53.0,3.9),
                         [ id(placemark12),
                           geom_attributes([ id(URI) ])
                         ],
                         [ name(URI),styleUrl(URI),
                           geom_content([ extrude(1) ])
                         ]),
               []).
 kml_save_footer(+Stream) is det
Outputs a KML footer to stream Stream. This can be preceded by calls to kml_save_header/2 and kml_save_shape/3.
 kml_file_to_georss(+KMLfile) is det
 kml_file_to_georss(+KMLfile, +RDFfile) is det
Converts the contents of an KML file into GeoRSS RDF in the RDF database of Prolog. The Geometries are converted to GeoRSS properties and values. Documents, Folders, etc. are ignored. MultiGeometry objects are expanded into separate simple Geometries. Geometries with an XML ID are assigned that ID as URI, other Geometries are assigned a RDF blank node. The kml:name and kml:description are translated to RDF properties.
 georss_to_kml_file(+KMLfile) is det
 georss_to_kml_file(+KMLfile, +Options) is det
Converts the contents of the RDF database of Prolog into a KML file without style information and without Folders. kml:name and kml:description properties in the RDF database are converted to their KML counterparts. Options can be used to pass Document level options, for example, the name of the dataset. Options can also include a graph(Graph) option to specify which RDF named graph should be converted to KML.
 kml_shape(?Stream, ?Shape) is semidet
 kml_shape(?Stream, ?Shape, ?Attributes, ?Content) is semidet
Converts between the KML serialization of a shape and its internal Prolog term representation. Attributes and Content can hold additional attributes and XML content elements of the KML, like ID, name, or styleUrl.
 kml_file_shape(+File, ?Shape) is semidet
 kml_file_shape(+File, ?Shape, ?Attributes, ?Content) is semidet
Reads shapes from a KML file using kml_shape/2. kml_file_shape/4 also reads extra attributes and elements of the KML Geometry. e.g. <Point targetId="NCName"><extrude>0</extrude>...</Point> will, besides parsing the Point, also instantiate Content with [extrude(0)] and Attributes with [targetId('NCName')].