[R-sig-eco] Writing Projected Shapefiles for R in ArcGIS

Philippi, Tom tom_philippi at nps.gov
Thu Aug 21 00:07:39 CEST 2014


You might get a better answer from R-sig-Geo, but you never specify
proj4string for your KUD shapefile, and you may be specifying an invalid
(or not supported by ESRI) CRS for your HOME shapefile.

It might be clearer if you populated the proj4string slot of your
SpatialPointsDataFrame spdf.x.  The shapefile you write via writeOCR()
shouldn't have a CRS because you never specify proj4string for spdf.x or
kud or ud.1.

For HOME, epsg:27573 appears to be proj=lcc Lambert in the vicinity of
Paris; I'm not sure what a mashup of that and +proj=utm does, but UTM Zone
11 isn't in the south of France.  There should be a simpler, clearer way to
specify what your CRS really is.  Then, spatialreference.org might be
useful to see if there is an ESRI equivalent.

I hope that this helps...



On Wed, Aug 20, 2014 at 1:34 PM, Stacy Bierwagen <sbierwag at hawaii.edu>
wrote:

> I had an earlier correspondence with someone on this list that I haven't
> recently been able to contact. I am still having issues gluing a projection
> on to the shapefiles I am writing from R regarding KUDs. Everytime I try to
> load one onto ArcGIS it gives me a message saying the file is missing
> spatial reference data so it won't overlay on to my map. I attached the
> script, a head of my data, and the shapefile that I have exported from R.
>
> If anyone sees anything I am doing wrong I would really appreciate it.
>
> data <- read.table(file.choose(), header=T, na.strings=c("", "NA"),
> sep="\t")
> lapply(c('adehabitatLT','adehabitatHR','sp','rgdal'), library,
> character.only=T)
> #==convert data to spatial points dataframe
> xy=data[9:10] # coords
> df=data[-9:-10] # other data variables
> spdf.x=SpatialPointsDataFrame(coords=xy,data=df)
> #==Estimate utilization distribution
> kud <-
> kernelUD(spdf.x[,4],h="href",hlim=c(0,1000),same4all=T,kern='bivnorm')
> ud.1=estUDm2spixdf(kud)
> writeOGR(ud.1,"KUD",driver="ESRI Shapefile")
> #==home range from UD using LSCV
> home=getverticeshr(kud,percent=c(95))
> proj4string(home)=CRS("+init=epsg:27573 +proj=utm +zone=11 +ellps=WGS84
> +units=m +no_defs")
> writePolyShape(home,"HOME")
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>


-- 
-------------------------------------------
Tom Philippi
Quantitative Ecologist & Data Therapist
Inventory and Monitoring Program
National Park Service
Tom_Philippi at nps.gov
http://science.nature.nps.gov/im/monitor

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list