Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It all depends on the units of your raster, and that depends on the projection. Rasters might not even be square grids in metres - they might be square in degrees which aren't square in metres! </p> <p>1 degree longitude at the equator is 1/360 of the earth's circumference. Near the north pole 1 degree is a much smaller distance, and at the pole its pretty much zero. Degrees of latitude however are constant.</p> <p>You could take the corner points of your raster, convert them to lat-long coordinates if not already, and then work out the great-circle distance between them (there's an rdist function somewhere that does this I recall). However this won't work if your raster spans the whole globe, since then your NW corner and your NE corner are at the same point... Ummm. Anyway, the answer is... 42.</p> <p>If you want to make 1km rasters of Australia then.... you need a coordinate system of Australia in kilometres. In the UK we have a system called the OSGB National Grid, which is close enough to a metric grid. Australia might be trickier because it is slightly bigger than the UK... So Australia seems to have a few grid systems. See here:</p> <p><a href="http://www.spatialreference.org/ref/?search=AGD84" rel="noreferrer">http://www.spatialreference.org/ref/?search=AGD84</a></p> <p>So you might want to use the system that is in the middle of the country to avoid the worst distortions, then work out the bounds of Australia in lat-long, convert to epsg:20353 and create a raster based on that:</p> <p>In lat-long I reckon Australia is roughly:</p> <pre><code>&gt; xtll [,1] [,2] [1,] 112.5162 -43.906900 [2,] 155.8425 -7.585619 </code></pre> <p>make this into a SpatialPoints object:</p> <pre><code>&gt; xtll=SpatialPoints(xtll,CRS("+init=epsg:4326")) </code></pre> <p>convert to that AGD84 in the middle of the country:</p> <pre><code>&gt; spTransform(xtll,CRS("+init=epsg:20353")) SpatialPoints: coords.x1 coords.x2 [1,] -1306200 4886041 [2,] 2849956 9103124 </code></pre> <p>Make a raster extent object rounded to km:</p> <pre><code>&gt; ext = extent(-1306000,2850000,4886000,9103000) </code></pre> <p>How many rows and columns do we need?</p> <pre><code>&gt; length(-1306:2850) [1] 4157 &gt; length(4886:9103) [1] 4218 </code></pre> <p>Create a raster:</p> <pre><code>&gt; r = raster(ext,ncol=4156,nrow=4217,crs="+init=epsg:20353") &gt; r class : RasterLayer dimensions : 4217, 4156, 17525852 (nrow, ncol, ncell) resolution : 1000, 1000 (x, y) extent : -1306000, 2850000, 4886000, 9103000 (xmin, xmax, ymin, ymax) coord. ref. : +init=epsg:20353 +proj=utm +zone=53 +south +ellps=aust_SA +units=m +no_defs values : none </code></pre> <p>Note that the ncol and nrow values are one less than the values from the bounds - this would be a fencepost error to put those values in. </p> <p>See how my resolution is 1000? This is a 1km grid. The problem is that this is possibly going to be a bit distorted on the coasts. You could work out how distorted by converting to lat-long (epsg:4326), then to the proper AGD zone for points on the coast, and seeing how different they are. They might be very close, except for an offset.</p> <p>Anyway, nuff said.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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