Gifski r7/12/2023 ![]() ![]() If (new_proj_and_gdal()) comment(slot(airports, "proj4string" ))ĭsn <- system.file( "vectors/ps_cant_31.MIF", package = "rgdal" ) If (new_proj_and_gdal()) comment(slot(scot_BNG, "proj4string" ))ĭsn <- system.file( "vectors/airports.gml", package = "rgdal" )Īirports <- try(readOGR(dsn=dsn, layer= "airports" )) Scot_BNG <- readOGR(dsn=dsn, layer= "scot_BNG" ) OGRSpatialRef(dsn=dsn, layer= "scot_BNG" ) If (new_proj_and_gdal()) comment(slot(kiritimati_primary_roads, "proj4string" )) Kiritimati_primary_roads <- readOGR(dsn=dsn, layer= "kiritimati_primary_roads" ) OGRSpatialRef(dsn=dsn, layer= "kiritimati_primary_roads" ) OgrInfo(dsn=dsn, layer= "kiritimati_primary_roads" ) Table(Encoding( as.character (cities$NAME))) Na.strings= "-99", numerals= "no.loss" )Ĭities <- readOGR(dsn=dsn, layer= "cities", GDAL1_integer64_policy= TRUE ) If (new_proj_and_gdal()) comment(slot(cities, "proj4string" ))Ĭities$POPULATION <- nvert( as.character (cities$POPULATION), OgrInfo(dsn= "cities.shp", layer= "cities" )Ĭities <- readOGR(dsn=dsn, layer= "cities" ) case of mixed 2D/3D track points - set TRUE to 3D to passĭefault NULL, driver found using ogrListLayers from the data source otherwise already known and passed through from a calling functionĭsn <- system.file( "vectors", package = "rgdal" ) This is often unfortunate, so a PROJ function is called through rgdal to retrieve the underlying source definition. The presence of the +towgs84= key in a Proj4 string projargs= argument value may promote the output WKT2 CRS to BOUNDCRS for PROJ >= 6 and GDAL >= 3, which is a coordinate operation from the input datum to WGS84. (PROJ6+/GDA元+) either use global setting (default NULL) or override policy for coordinate ordering easting/x as first axis, northing/y as second axis. The use of 64-bit integers is usually a misunderstanding, as such data is almost always a long key ID.ĭefault FALSE, if TRUE, Integer64 fields are read as doublesĭefault NULL, morph from ESRI WKT1 dialectĭump SRS to stdout from inside GDAL to debug conversion - developer use only Logical: should character vectors be converted to factors? Default NA, which uses the deprecated default.stringsAsFactors() in R = rgdal 1.2). PROJ4 string defining CRS, if default NULL, the value is read from the OGR data set stringsAsFactors From rgdal 1.2.*, layer may be missing, in which case ogrListLayers examines the dsn, and fails if there are no layers, silently reads the only layer if only one layer is found, and reads the first layer if multiple layers are present, issuing a warning that layer should be given explicitly. Layer name (varies by driver, may be a file name without extension). OGRSpatialRef(dsn, layer, morphFromESRI=NULL, dumpSRS = FALSE, driver = NULL,Įnforce_xy = NULL, get_source_if_boundcrs=TRUE)Ī Spatial object is returned suiting the vector data source, either a SpatialPointsDataFrame (using an AttributeList for its data slot directly), a SpatialLinesDataFrame, or a SpatialPolygonsDataFrame.ĭata source name (interpretation varies by driver - for some drivers, dsn is a file name, but may also be a folder) MorphFromESRI = NULL, dumpSRS = FALSE, enforce_xy = NULL, Use_iconv=FALSE, swapAxisOrder=FALSE, require_geomType = NULL, Integer64="no.loss", GDAL1_integer64_policy=FALSE, morphFromESRI = NULL,ĭumpSRS = FALSE, enforce_xy = NULL, D3_if_2D3D_points=FALSE, missing_3D=0) UseC=TRUE, disambiguateFIDs=FALSE, addCommentsToPolygons=TRUE,Įncoding=NULL, use_iconv=FALSE, swapAxisOrder=FALSE, require_geomType = NULL, ![]() PointDropZ=FALSE, dropNULLGeometries=TRUE, Usage readOGR(dsn, layer, verbose = TRUE, p4s=NULL, With the GPX driver for reading GPS data as layer="tracks" Interpreted differently, and may be the file name itself, as for example This is that typically one keeps all the shapefiles for a project inĪs noted below, for other file type drivers, the dsn= argument is Map <- readOGR(dsn="C:/Maps", layer="bounds"). The folder (directory) where the shapefile is, and the layer is the If reading a shapefile, the data source name ( dsn= argument) is It will set the spatial reference system if the layer has such metadata. It can only handle layers with conformable geometry features (not mixtures of points, lines, or polygons in a single layer). The function reads an OGR data source and layer into a suitable Spatial vector object. ReadOGR: Read OGR vector maps into Spatial objects Description ![]()
0 Comments
Leave a Reply. |