Displaying 20 results from an estimated 46 matches for "readogr".
Did you mean:
readdir
2008 Dec 04
0
reading files (readOGR) and non-ascii characters
I'm forwarding to this list as I've got no
answer in [R-sig-Geo] and perhaps this
issue is not exclusive of readOGR()
I'm using ubuntu 8.04 andR version 2.8.0 (2008-10-20)
-------- Original Message --------
Subject: readOGR and non-ascii characters
Date: Wed, 03 Dec 2008 14:22:34 +0100
From: Agustin Lobo <aloboaleu at gmail.com>
Reply-To: Agustin.Lobo at ija.csic.es
To: sig-geo <r-sig-geo at stat...
2009 Jul 14
1
Error when sampling from SpatialLines
...le(nwlim,n=1000,"random")
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "coordinates", for signature "numeric"
I found a similar error message in the archives, where prof. dr. Bivand indicated to try to use readOGR instead of readShapeLines, however, I get the same error message.
nwlim2<-readOGR("C:/Limburg_nwshape.shp", "Limburg_nwshape")
OGR data source with driver: ESRI Shapefile
Source: "C:/Limburg_nwshape.shp", layer: "Limburg_nwshape"
with 6074...
2010 Apr 01
3
Using GIS data in R
I have a simple problem: I need to load a ERSI shapefile of US states
and check whether or not a set of points are within the boundary of
these states. I have the shapefile, I have the coordinates but I'm
having a great deal of difficulty bringing the two together. The
problem is the various GIS packages for R do not play well with each
other. sp, shapefiles, maptools, etc all use different
2012 Feb 22
1
How can I save plot()/points() using SHP files into KML format?
...This is as far as I've gotten (code below) and am lost as to next steps,
Any suggestions or references would be greatly appreciated! Thanks in
advance for any help.
Gabe
# Initialize pseudo random number generator
set.seed(700124)
# Read vector representation of the map
Kasur <- readOGR("Kasur3.shp", layer = "Kasur3")
# Plot points
png("Kasur.png")
plot(Kasur)
points(spsample(Kasur, n=100, type='random'), col='red', pch=0, cex=0.5)
dev.off()
--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-save-plot...
2012 Dec 17
2
looping through spatial points and getting counts of spatial points in spatial grid in R
...oints in the spatial grid. However, since there are many of these spatial points, I want this process to be automated. Can someone help me with this? All my spatial points are in one folder.
# Creating spatial points in R - reading the POI shapefiles as SpatialPointsDataFrame in R autopts.rg <- readOGR(".", "AutoSvc")class (autopts.rg)
# Getting a count of the Spatial Points in the Spatial Data Frame in.cell <- overlay(SpatialGrid_LS,FinInstq2) newdata <- data.frame(table(in.cell))View(newdata)
"SpatialGrid_LS" is the spatial grid that I had created in R.
I g...
2014 Mar 12
3
Sobreponer dos mapas
...https://www.dropbox.com/s/1286j3ppk6nyve6/zonas.tiff
Ahora lo que deseo hacer es agregar datos, por ejemplo el cociente de localización de la industria de la electronica para cada municipio de las zonas. Anteriormente lo he hecho con spplot, pero primero agregando los datos a traves de:
zm <- readOGR(?.?, ?zm?)
datos <- read.csv(ql.csv) #cocientes de localización por sector por municipio (345 obs)
zonas en data=data.frame(datos)
y después lo he pintado así:
spplot(zonas, c(?industria_electronica?))
Este es el resultado: https://www.dropbox.com/s/wbnp5hm79kvqedq/ql_indelec.tiff
Quisiera...
2011 May 01
1
vector file
Dear All
I want to import the vector file ( .shp) to R. I could import the file by rgdal package before, by following:
geology<-readOGR('C:/geology//saga/geo.geom','finalgeology')
but now there is an error:
Error in ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding = input_field_name_encoding) :
GDAL Error 4: .shx file is unreadable, or corrupt.
Can you tell me where is the problem.
Tha...
2011 Dec 03
1
side-by-side map with different geographies using spplot
Hello,
I want to create side-by-side maps of similar attribute data in two
different cities using a single legend.
To simply display side-by-side census block group boundary
(non-thematic) maps for Minneapolis & Cleveland I do the following:
library(rgdal)
library(sp)
Minneapolis=readOGR("../Minneapolis/Census/2010/Census_BlockGroup_GEO/","tl_2010_27053_bg10")
Cleveland=readOGR("../Cleveland/Census/2010/Census_BlockGroup_GEO/","tl_2010_39035_bg10")
par(mfrow=c(1,2))
plot(Minneapolis)
plot(Cleveland)
I can display a single thematic map for a...
2012 Aug 08
1
map axis on projected shapefiles
...he x-axis ticks the prime meridian (0?)
is in totally the wrong position.
I have tried "degAxis" which only changes the axis to 4e+05?W, 3e+05?W,...,
and I cant seem to get map.grid to work.
Does anyone know why this would happen or what I have done wrong?
#Code is
shelfline <- readOGR(dsn="C:\\ArcGIS\\phy_bathy_contours.shp", layer =
"phy_bathy_contours")
world <- readOGR(dsn="C:\\ArcGIS\\phy_coastline_plus_ssi_so.shp", layer =
"phy_coastline_plus_ssi_so")
plot(shelfline, axes=T,xlab=expression("Longitude"^o),
ylab=expression...
2017 Nov 13
1
how to label station names on point
I have a shapefile point and I plot it over my polygon. Is it possible to label station names over points?Sincerely.
S_Point = readOGR(".","point")plot(S_Point,add=TRUE,col="black",pch=20,cex=2)
[[alternative HTML version deleted]]
2009 Mar 02
2
Need help extracting info from XML file using XML package
.../outerBoundaryIs>
</Polygon>
Thanks!
-Don
p.s.
There is a lot of other stuff in this file, i.e, some points, and
attributes of the points such as color, as well as a legend
describing what the polygons mean, but I can get by without all that
stuff, at least for now.
Note also that readOGR() would in principle work, but the underlying
OGR libraries have some limitations that this file exceeds. Per info
at http://www.gdal.org/ogr/drv_kml.html.
--
---------------------------------
Don MacQueen
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062
macq at llnl.gov
2007 May 30
4
Connecting to PostgreSQL/PostGIS from R (rgdal?)
....1, but I was unsuccessful at creating a proper binary
package for R. I was only able to get it to work by substituting the
rgdal.dll that was installed by CRAN with the one that I compiled that
links against the GDAL library from FWTools. Even though it works (at
first glance with ogrInfo(), and readOGR()), I still get a warning
message when I load the libary: "DLL attempted to change FPU control
word from 8001f to 9001f".
So my question with respect to rgdal is a) is it likely that an rgdal
package is going to be released in the future with the PostgreSQL driver
included in GDAL/OGR, o...
2012 Mar 21
2
To overlay my raster and its boundary
..."C:\\Users\\Documents\\Nouveau\\Frequence.txt",sep="",dec=",",header=TRUE)
>testo<-rasterFromXYZ(Image)
>plot(testo)
>testo2 <- aggregate(testo,fact=10, fun=mean)
>plot(testo2)
# open shapefiles= boundary
>library (rgdal)
>test1<-readOGR(dsn="C:\\Users\\Documents\\DISC D\\Nouveau",layer="pays")
>plot(test1)
But How to overlay both layers (raster and shapefile) to have a same map?.
Thank you in advance
--
View this message in context: http://r.789695.n4.nabble.com/To-overlay-my-raster-and-its-boundary-tp4...
2011 Jul 09
1
SpatialPolygonsDataFrame holes problem
I have obtained shapefiles for Indian states from here:
http://www.maptell.com/index.php?option=com_remository&Itemid=159&func=fileinfo&filecatid=115&parent=category
Problem: I want to extract centroid coordinates for each State, but there is some coding problem with the shapefiles that prevents this.
#Code:
#After extracting the shapefiles from the india_state.zip file, then:
2011 May 07
1
spdep::poly2nb problem
...ritories shapefile from
http://www.weather.gov/geodata/catalog/national/html/us-state.htm
and unzipped it into my working directory.
Then in R (version 12.2.0 for ms-win32):
library(rgdal) # Version: 0.6-28
library(spdep) # Version: 0.5-24 (loads sp: Version: 0.9-72)
# read in the data
states<-readOGR(".","s_01de10")
summary(states)
# now create a neighbors list
states_nb<-poly2nb(states)
# create a 0/1 matrix of the neighbors
nb_mat<-nb2mat(states_nb,style="B",zero.policy=TRUE)
# add names
nms<-as.character(states$NAMES)
# set the matrix names
dimnames(nb...
2012 Aug 17
1
RGDAL OGRwrite question
...v0.7-12 (R version
2.15.1, OSX 10.6.8) writeOGR will not write a shapefile the the
current directory. Is this correct? An earlier version of rgdal must
have allowed this because I have a older script that used to work, but
doesn't now.
So, as an example, here is what I get today:
> shape = readOGR('.', layer='S20_G75_V00_HAASHP10_R00')
OGR data source with driver: ESRI Shapefile
Source: ".", layer: "S20_G75_V00_HAASHP10_R00"
with 169 features and 23 fields
Feature type: wkbPolygon with 2 dimensions
> writeOGR(shape, '.', layer='temp', d...
2010 Jun 23
1
Plotting Data on a Map
...e know if I need to
explain better what I am trying to accomplish.
library(rgdal)
library(maptools)
library(ggplot2)
dsn="C:/Documents and Settings/fcarrillo/Desktop/Software/R Scripts
and Datasets/NCTC/Data Analisys II/Data 4 Data Analysis II March 2009-
March2010/Data"
wolves.map <- readOGR(dsn=dsn, layer="PNW_wolf_habitat_grid")
class(wolves.map)
dim(wolves.map)
head(wolves.map,1)
names(wolves.map)
gpclibPermit()
wolves.ds <- fortify(wolves.map)
head(wolves.ds);tail(wolves.ds)
# Shapefile of 5 states
wolves.plot <- ggplot(wolves.ds,aes(long,lat,group=group)) +
geom_po...
2009 Aug 30
1
Trying to rename spatial pts data frame slot that isn't a slot()
...sDataFrame(spol, data=data.frame
+(getSpPPolygonsLabptSlots(spol),
+row.names=getSpPPolygonsIDSlots(spol)), match.ID = TRUE)
writeOGR(spdf,dsn=mcp.dir,layer="All Mantas MCP", driver="ESRI
+Shapefile")
#Read shapefile manipulated in qGIS
mymcp<-readOGR(dsn=mcp.dir,layer="All mantas MCP land differenc")
My spatial points data frame has a number of "Slot"s, including one that contained the original names called Slot "ID". However, I can not access this slot using slot() or slotNames().
> slotNames(mymcp)
[1] &...
2013 Feb 14
1
Clip a contour with shapefile while using contourplot
.../s/khi7nv0160hi68p/mydata.csv
The data for shapefile can be found on
https://www.dropbox.com/sh/ztvmibsslr9ocmc/YOtiwB8p9p
THe code I have used so far is as follows:
# Load Libraries
library(latticeExtra)
library(sp)
library(rgdal)
library(lattice)
library(gridExtra)
#Read Shapefile
hello <- readOGR("shape",
layer="Export_Output_4")
## Project the shapefile to the UTM 16 zone
proj4string(hello) <- CRS("+proj=utm +zone=16 +ellps=WGS84")
## Read Contour data
mydata <- read.csv("mydata.csv")
head(mydata )
summary(mydata)
#Create a c...
2010 Jun 23
1
Shapefile
...9;rgdal' and 'maptools' much
but it appears to be a great way bring map data into R.
Please take a look at the comments and let me know if I need to
explain better what I am trying to accomplish.
library(rgdal)
library(maptools)
library(ggplot2)
dsn="C:/Data"
wolves.map <- readOGR(dsn=dsn, layer="PNW_wolf_habitat_grid")
class(wolves.map)
dim(wolves.map)
head(wolves.map,1)
names(wolves.map)
gpclibPermit()
wolves.ds <- fortify(wolves.map)
head(wolves.ds);tail(wolves.ds)
# Shapefile of 5 states
wolves.plot <- ggplot(wolves.ds,aes(long,lat,group=group)) +
geom_po...