On Wed, 18 Mar 2015, Edzer Pebesma wrote:
On 03/18/2015 11:31 AM, PONS Frederic - CEREMA/DTerMed/DREC/SRILH wrote:
Hi
I try to change some coordinate in a vector read by readOGR
Vecteur = readOGR(dsnlayer,layer=nomlayer)
After some calculation, I try this without success:
Vecteur[nbi,]@coords=cbind(ProfilProj[,1],ProfilProj[,2])
try:
Vecteur_b = Vecteur[nbi,]
Vecteur_b at coords=cbind(ProfilProj[,1],ProfilProj[,2])
or:
Vecteur at coords[nbi,]=cbind(ProfilProj[,1],ProfilProj[,2])
and remember to update the bbox slot as nothing is automatic when
slots are modified directly.
I'm also unsure whether Vecteur is a SpatialPointsDataFrame, although
it looks as though it may be.
The error is:
Erreur dans as.vector(data) :
pas de m?thode pour convertir automatiquement cette classe S4 en
vecteur
Thanks and best regards
--
*Fr?d?ric Pons *
*Expert hydraulique sur les inondations et al?as c?tiers
**DREC/Service Risques Inondations Littoraux et Hydraulique **- T?l.:
(33)4 42 24 76 68 *
*Direction Territoriale M?diterran?e
*
Centre d'?tudes et d'expertise sur les risques, l'environnement, la
mobilit? et l'am?nagement
www.cerema.fr <http://www.cerema.fr>