Hello,
I've got a raster with values 1 and NA. I'm attempting to convert to a polygon 
using the rasterToPolygons function with dissolve=TRUE. The raster is in an 
equal area projection (+proj=aea +lat_1=-5 +lat_2=-42 +lat_0=-32 +lon_0=-60 
+x_0=0 +y_0=0 +ellps=aust_SA +units=m +no_defs )
When I use this command on the projected raster:
sh<-rasterToPolygons(myraster,dissolve=TRUE)
I get a SpatialPolygonsDataFrame with a single polygon but this plots severalĀ 
lines in the polygon (dissolve function partially working but not plotting as a 
simple perimeter of the polygon).
If I project the raster to a geographic coordinate system ("+proj=longlat 
+ellps=WGS84 +datum=WGS84 +no_defs"), I get the expected plot.
Both plots are attached.
I would appreciate any insight. This is part of a larger script and the 
projected raster/polygon is desirable.
Thanks

Attachment: geo_coordinates.pdf
Description: Adobe PDF document

Attachment: aea_projected.pdf
Description: Adobe PDF document

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

Reply via email to