kml

Reading KML files into R

只愿长相守 提交于 2019-12-01 08:45:13
I'm building a workflow for reading multiple-geometry KML files into R. This is my working map , with point and path geometries. The (reproducible) R script is: library(rgdal) setwd( {SPECIFY A FOLDER} ) download.file("http://www.scribblemaps.com/maps/kml/shackleton.kml", "file.kml") (lyr = ogrListLayers("file.kml")) map = readOGR ("file.kml", layer=lyr, verbose = TRUE, drop_unsupported_fields=T, dropNULLGeometries=T) which fails with: Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv) : Cannot open layer Any ideas how to work around this? I've managed to

How to load a KML file URL into Google Maps using iOS API?

好久不见. 提交于 2019-12-01 08:28:54
问题 I've got Google Map embedded in a View Controller in a Map on an iPhone. I can create my map using: GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:39.93 longitude:-75.17 zoom:12]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; // use GPS to determine location of self mapView_.myLocationEnabled = YES; mapView_.settings.myLocationButton = YES; mapView_.settings.compassButton = YES; Now, I want to add a kml file (from a URL) that displays a route. I would

Unable to load a local KMZ file into a browser with the google earth plugin using fetchkml function

梦想与她 提交于 2019-12-01 06:15:48
问题 We have a KMZ file that loads into the Google Earth Desktop application just fine. No errors. When we try to use the Google Earth Plugin to do the same thing, it does not even return from the fetchKml function. Any special settings we need to know about to use fetchKml on a local file? I am trying to load the file like so: // Where 'ge' is the Google Earth Plugin var href = 'C:/KMLDATA/TEST.KMZ'; google.earth.fetchKml(ge, href, function(kml) { /* do something with kml */ }); 回答1: This has

Why does this XPath expression not return the correct value in xmlstarlet?

♀尐吖头ヾ 提交于 2019-12-01 01:12:29
I'm trying to extract the contents of the 'coordinates' node in this KML file using xmlstarlet. The KML file validates fine using xmlstarlet itself. I've whittled it down to a small test file containing: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.2"> <Document> <Placemark> <name>eurovelo-5 690</name> <Snippet></Snippet> <description><![CDATA[ ]]></description> <styleUrl>#style390</styleUrl> <LineString> <tessellate>1</tessellate> <coordinates> 10.146948,44.790592,97.500000 10.146958,44.790562,97.599998 10.147018,44.790497,97.699997 10.147083,44.790466,97

'The specified input does not represent a valid geography instance' exception when using SqlGeographyBuilder

北城以北 提交于 2019-11-30 23:11:11
I've written a small application that reads in from a series of KML files and then converts them into the Microsoft.SqlServer.Types.SqlGeography type using the following code: private SqlGeography CreateGeographyFromKML( string kml, bool debug ) { // use SqlGeographyBuilder to help create the SqlGeography type var geographyBuilder = new SqlGeographyBuilder(); // Get co-ordinates var xml = XDocument.Parse(kml); var df = xml.Root.Name.Namespace; XElement coordinates = xml.Descendants(df + "coordinates").Single(); // set the Spatial Reference Identifiers that will used to create the point

Why does this XPath expression not return the correct value in xmlstarlet?

怎甘沉沦 提交于 2019-11-30 21:25:33
问题 I'm trying to extract the contents of the 'coordinates' node in this KML file using xmlstarlet. The KML file validates fine using xmlstarlet itself. I've whittled it down to a small test file containing: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.2"> <Document> <Placemark> <name>eurovelo-5 690</name> <Snippet></Snippet> <description><![CDATA[ ]]></description> <styleUrl>#style390</styleUrl> <LineString> <tessellate>1</tessellate> <coordinates> 10.146948

KML layer in Openlayers doesn't work on localhost

不羁的心 提交于 2019-11-30 15:55:14
问题 I have strange problem with rendering KML file in OpenLayers. It seems to be easy, but it's not. I've started with an example from here OpenLayers example . I wanted to add my own KML. It didn't work. I've created a local copy of the example with absolute urls, as follows: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <meta name="apple-mobile-web-app

How to calculate points on a circle on the globe centred on GPS coordinates?

半腔热情 提交于 2019-11-30 15:41:13
问题 Draw a circle in KML How do you take the GPS coordinates of a point on the globe (say in decimal degree format) and generate the coordinates for a polygon approximating a circle centred on that point? A polygon with 20+ data points looks like a circle. The more data points - the better looking the circle. I am writing a program that will generate KML and dont know how to calculate the coordinates of the polygon vertices. Example of data inputs: Latitude, Longitude, Circle radius (in feet),

How to calculate points on a circle on the globe centred on GPS coordinates?

馋奶兔 提交于 2019-11-30 15:35:24
Draw a circle in KML How do you take the GPS coordinates of a point on the globe (say in decimal degree format) and generate the coordinates for a polygon approximating a circle centred on that point? A polygon with 20+ data points looks like a circle. The more data points - the better looking the circle. I am writing a program that will generate KML and dont know how to calculate the coordinates of the polygon vertices. Example of data inputs: Latitude, Longitude, Circle radius (in feet), NumberOfDataPoints 26.128477, -80.105149, 500, 20 arx I don't know if this is the simplest solution and

KML layer in Openlayers doesn't work on localhost

耗尽温柔 提交于 2019-11-30 15:26:34
I have strange problem with rendering KML file in OpenLayers. It seems to be easy, but it's not. I've started with an example from here OpenLayers example . I wanted to add my own KML. It didn't work. I've created a local copy of the example with absolute urls, as follows: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <meta name="apple-mobile-web-app-capable" content="yes"> <link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css"