Note that there are some explanatory texts on larger screens.

plurals
  1. POcsv to kml file New Zealand
    primarykey
    data
    text
    <p>I am trying to generate a kml file from a csv file so it can be plotted in Google earth. I am using this code I found in another help section and it seems to work fine for the generation of a kml but the points that are plotted are wrong. </p> <pre><code>library("sp") library("rgdal") data(meuse) coordinates(meuse) &lt;- c("x", "y") proj4string(meuse) &lt;- CRS("+init=epsg:28992") meuse_ll &lt;- spTransform(meuse, CRS("+proj=longlat +datum=WGS84")) writeOGR(meuse_ll["zinc"], "meuse.kml", layer="zinc", driver="KML") </code></pre> <p>First fix was to get rid of the decimal places, that took me from France to NZ but the points are still out by a wide margin. Instead of being North of Auckland New Zealand they are south of the Chatham Islands. I suspect that I am dealing with a projection miss match or fudge factor issue. I have also tried copying the zip file from here: <a href="http://trac.osgeo.org/proj/" rel="nofollow">http://trac.osgeo.org/proj/</a> To use NZGD49 in the hopes that that would work but it throws up this error:</p> <pre><code>meuse_ll2 &lt;- spTransform(test, CRS("+proj=longlat +datum=NZGD49")) #Error in spTransform(test, CRS("+proj=longlat +datum=NZGD49")) : # error in evaluating the argument 'CRSobj' in selecting a method for function 'spTransform': Error in CRS("+proj=longlat +datum=NZGD49") : #unknown elliptical parameter name </code></pre> <p>So any ideas how I can work out?</p> <h1>Example data:</h1> <pre><code>Date Time Latitude1 Longitude1 27/09/2013 12:18:02 -36.67593 174.429688 27/09/2013 12:18:03 -36.675892 174.42981 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload