Long time listener, first time caller

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Long time listener, first time caller

dman
This post was updated on .
Hello there,

I'm using "raster" to great effect in a little something I'm building, but having a time trying to figure out this current issue. My intent is to build a "distance raster" from a center point out to 1km with cell size of 30x30. I had a few runs yesterday where this worked, but today with a different set of coordinates and UTM zone, I have a surfeit of "NA's" and white lines in my plotted raster.  Any notion as to what is causing the error?

I thank you in advance for your time and efforts.

________________________________________
David Kennedy
dkennedy@airsci.com | www.airsci.com







_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

steven mosher
Hi,

please post code to replicate the problem.
also include sessionInfo().

how are you plotting the raster, are you using 2.13.1? ( there was a bug
report that looks somewhat like yours
on that today using the image() call.

More details and we can help.

Thanks


Robert Hijmans
University of California, Davis

On Thu, Jul 14, 2011 at 3:09 PM, David Kennedy <[hidden email]> wrote:

> Hello there,
>
> I'm using "raster" to great effect in a little something I'm building, but
> having a time trying to figure out this current issue. My intent is to build
> a "distance raster" from a center point out to 1km with cell size of 30x30.
> I had a few runs yesterday where this worked, but today with a different set
> of coordinates and UTM zone, I have a surfeit of "NA's" and white lines in
> my plotted raster.  Any notion as to what is causing the error?
>
> I thank you in advance for your time and efforts.
>
> ________________________________________
> David Kennedy
> [hidden email] | www.airsci.com
>
>
>
>
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

dman
This post was updated on .
@SM - I am in fact using 2.13.1 and will look into the image() call. The code should be attached, here it is again
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

dman
Ah-ha,

NA's are the cells outside my mask.

Lines appear to be a GUI issue, went back to 2.13.0 and plot of raster looks fine.

D
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

Robert Hijmans
> Lines appear to be a GUI issue, went back to 2.13.0 and plot of raster looks fine.

When plotting a Raster* object, raster calls the 'image' function. spplot uses 'levelplot'. Both are affected by these white lines in R 2.13.1 on Windows, I think (anyone seeing this on Mac or Linux? or not seeing this on Windows?). Here is a simple test:

image(t(volcano)[ncol(volcano):1,])

In some cases there are only lines such that it seems that there are no data values. I would expect that this will be fixed soon, but I am changing 'raster' so that the next version calls 'rasterImage' (which is not affected and should be more efficient) in stead of 'image'.

Please correct me if I am wrong, but I think that for now one should not use R 2.13.1 on Windows (and perhaps other OSs) if you want to plot raster data.
Robert

> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

Adam Sparks
On my Linux system with 2.13.1 the R graphical display shows white lines.
 If I generate/export a PNG using the png() function there are no white
lines.

> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-unknown-linux-gnu (64-bit)



On Fri, Jul 15, 2011 at 8:40 AM, Robert Hijmans <[hidden email]> wrote:

> > Lines appear to be a GUI issue, went back to 2.13.0 and plot of raster
> looks fine.
>
> Please correct me if I am wrong, but I think that for now one should not
> use
> R 2.13.1 on Windows (and perhaps other OSs) if you want to plot raster
> data.
> Robert
>
> > sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Long-time-listener-first-time-caller-tp6585078p6585499.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


--
best,

Adam Sparks
Post-Doctoral Fellow
IRRI
DAPO Box 7777
Metro, Manila
Los Baños, Laguna, Philippines

        [[alternative HTML version deleted]]


_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

Michael Sumner-2
In reply to this post by Robert Hijmans
I see the same on Windows 7 64-bit, with 32-bit R and 64bit R.

There's no need for the transpose/flip btw:

image(volcano)

but raster graphics don't product it, so it's the underlying image C
code (which is rect under the hood)

image(volcano, useRaster = TRUE)

plot(0, xlim = c(0, 1), ylim = c(0, 1))

rasterImage((volcano - min(volcano, na.rm = TRUE)) /
diff(range(volcano, na.rm = TRUE)), 0, 0, 1, 1, interpolate = FALSE)

plot(0, xlim = c(0, 1), ylim = c(0, 1))

rasterImage((volcano - min(volcano, na.rm = TRUE)) /
diff(range(volcano, na.rm = TRUE)), 0, 0, 1, 1)

I'd like to investigate more, but will have to wait for now.

Cheers, Mike.


On Fri, Jul 15, 2011 at 10:40 AM, Robert Hijmans <[hidden email]> wrote:

>> Lines appear to be a GUI issue, went back to 2.13.0 and plot of raster
> looks fine.
>
> When plotting a Raster* object, raster calls the 'image' function. spplot
> uses 'levelplot'. Both are affected by these white lines in R 2.13.1 on
> Windows, I think (anyone seeing this on Mac or Linux? or not seeing this on
> Windows?). Here is a simple test:
>
> image(t(volcano)[ncol(volcano):1,])
>
> In some cases there are only lines such that it seems that there are no data
> values. I would expect that this will be fixed soon, but I am changing
> 'raster' so that the next version calls 'rasterImage' (which is not affected
> and should be more efficient) in stead of 'image'.
>
> Please correct me if I am wrong, but I think that for now one should not use
> R 2.13.1 on Windows (and perhaps other OSs) if you want to plot raster data.
> Robert
>
>> sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Long-time-listener-first-time-caller-tp6585078p6585499.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



--
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: [hidden email]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

Lyndon Estes
Hi Robert,

On my Mac the plot displays fine with no lines.

R version 2.13.1 (2011-07-08)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
[13] raster_1.8-39      sp_0.9-83

Cheers, Lyndon


On Thu, Jul 14, 2011 at 8:54 PM, Michael Sumner <[hidden email]> wrote:

> I see the same on Windows 7 64-bit, with 32-bit R and 64bit R.
>
> There's no need for the transpose/flip btw:
>
> image(volcano)
>
> but raster graphics don't product it, so it's the underlying image C
> code (which is rect under the hood)
>
> image(volcano, useRaster = TRUE)
>
> plot(0, xlim = c(0, 1), ylim = c(0, 1))
>
> rasterImage((volcano - min(volcano, na.rm = TRUE)) /
> diff(range(volcano, na.rm = TRUE)), 0, 0, 1, 1, interpolate = FALSE)
>
> plot(0, xlim = c(0, 1), ylim = c(0, 1))
>
> rasterImage((volcano - min(volcano, na.rm = TRUE)) /
> diff(range(volcano, na.rm = TRUE)), 0, 0, 1, 1)
>
> I'd like to investigate more, but will have to wait for now.
>
> Cheers, Mike.
>
>
> On Fri, Jul 15, 2011 at 10:40 AM, Robert Hijmans <[hidden email]> wrote:
>>> Lines appear to be a GUI issue, went back to 2.13.0 and plot of raster
>> looks fine.
>>
>> When plotting a Raster* object, raster calls the 'image' function. spplot
>> uses 'levelplot'. Both are affected by these white lines in R 2.13.1 on
>> Windows, I think (anyone seeing this on Mac or Linux? or not seeing this on
>> Windows?). Here is a simple test:
>>
>> image(t(volcano)[ncol(volcano):1,])
>>
>> In some cases there are only lines such that it seems that there are no data
>> values. I would expect that this will be fixed soon, but I am changing
>> 'raster' so that the next version calls 'rasterImage' (which is not affected
>> and should be more efficient) in stead of 'image'.
>>
>> Please correct me if I am wrong, but I think that for now one should not use
>> R 2.13.1 on Windows (and perhaps other OSs) if you want to plot raster data.
>> Robert
>>
>>> sessionInfo()
>> R version 2.13.1 (2011-07-08)
>> Platform: i386-pc-mingw32/i386 (32-bit)
>>
>>
>> --
>> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Long-time-listener-first-time-caller-tp6585078p6585499.html
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>
> --
> Michael Sumner
> Institute for Marine and Antarctic Studies, University of Tasmania
> Hobart, Australia
> e-mail: [hidden email]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



--
Lyndon Estes
Research Associate
Woodrow Wilson School
Princeton University
+1-609-258-2392 (o)
+1-609-258-6082 (f)
+1-202-431-0496 (m)
[hidden email]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

lancelot
In reply to this post by Robert Hijmans
Dear Robert,

Working with:

 > sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
[5] LC_TIME=French_France.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] raster_1.8-42  sp_0.9-84      fortunes_1.4-2

loaded via a namespace (and not attached):
[1] grid_2.13.1     lattice_0.19-30 tools_2.13.1


The issue is not specific to the GUI. I also see it with Rterm. I'm
seeing the white lines on the windows() device (screen), as well as on
jpeg, png, and postscript devices (though much finer lines for the
latter). Conversely, pdf outputs don't seen to have the problem (also
tested with other raster images).

All the best,

Renaud




Le 15/07/2011 02:40, Robert Hijmans a écrit :

>> Lines appear to be a GUI issue, went back to 2.13.0 and plot of raster
> looks fine.
>
> When plotting a Raster* object, raster calls the 'image' function. spplot
> uses 'levelplot'. Both are affected by these white lines in R 2.13.1 on
> Windows, I think (anyone seeing this on Mac or Linux? or not seeing this on
> Windows?). Here is a simple test:
>
> image(t(volcano)[ncol(volcano):1,])
>
> In some cases there are only lines such that it seems that there are no data
> values. I would expect that this will be fixed soon, but I am changing
> 'raster' so that the next version calls 'rasterImage' (which is not affected
> and should be more efficient) in stead of 'image'.
>
> Please correct me if I am wrong, but I think that for now one should not use
> R 2.13.1 on Windows (and perhaps other OSs) if you want to plot raster data.
> Robert
>
>> sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Long-time-listener-first-time-caller-tp6585078p6585499.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
Renaud Lancelot
EDENext Project, coordinator: http://www.edenext.eu/

CIRAD, UMR15, Campus International de Baillarguet TA A-DIR / B
F34398 Montpellier

Tel.  +33 4 67 59 37 17  -  Fax  +33 4 67 59 37 95
Secr. +33 4 67 59 37 37  - Cell. +33 6 77 52 08 69

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Long time listener, first time caller

Els Ducheyne-2
Dear Robert
i have tested using our example and it seems to work fine on mac

Best
On 15 Jul 2011, at 09:51, lancelot wrote:

> Dear Robert,
>
> Working with:
>
> > sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
> [3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
> [5] LC_TIME=French_France.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] raster_1.8-42  sp_0.9-84      fortunes_1.4-2
>
> loaded via a namespace (and not attached):
> [1] grid_2.13.1     lattice_0.19-30 tools_2.13.1
>
>
> The issue is not specific to the GUI. I also see it with Rterm. I'm seeing the white lines on the windows() device (screen), as well as on jpeg, png, and postscript devices (though much finer lines for the latter). Conversely, pdf outputs don't seen to have the problem (also tested with other raster images).
>
> All the best,
>
> Renaud
>
>
>
>
> Le 15/07/2011 02:40, Robert Hijmans a écrit :
>>> Lines appear to be a GUI issue, went back to 2.13.0 and plot of raster
>> looks fine.
>>
>> When plotting a Raster* object, raster calls the 'image' function. spplot
>> uses 'levelplot'. Both are affected by these white lines in R 2.13.1 on
>> Windows, I think (anyone seeing this on Mac or Linux? or not seeing this on
>> Windows?). Here is a simple test:
>>
>> image(t(volcano)[ncol(volcano):1,])
>>
>> In some cases there are only lines such that it seems that there are no data
>> values. I would expect that this will be fixed soon, but I am changing
>> 'raster' so that the next version calls 'rasterImage' (which is not affected
>> and should be more efficient) in stead of 'image'.
>>
>> Please correct me if I am wrong, but I think that for now one should not use
>> R 2.13.1 on Windows (and perhaps other OSs) if you want to plot raster data.
>> Robert
>>
>>> sessionInfo()
>> R version 2.13.1 (2011-07-08)
>> Platform: i386-pc-mingw32/i386 (32-bit)
>>
>>
>> --
>> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Long-time-listener-first-time-caller-tp6585078p6585499.html
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> [hidden email]
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
> --
> Renaud Lancelot
> EDENext Project, coordinator: http://www.edenext.eu/
>
> CIRAD, UMR15, Campus International de Baillarguet TA A-DIR / B
> F34398 Montpellier
>
> Tel.  +33 4 67 59 37 17  -  Fax  +33 4 67 59 37 95
> Secr. +33 4 67 59 37 37  - Cell. +33 6 77 52 08 69
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo