Questions tagged [shapefile]

The Esri shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems (GIS) software. Questions about shapefiles are best asked on the GIS Stack Exchange.

For questions about shapefiles it is recommended that you research/ask at the GIS Stack Exchange.

Excerpt from Wikipedia:

The Esri Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by Esri as a (mostly) open specification for data interoperability among Esri and other software products.

Shapefiles spatially describe geometries: points, polylines, and polygons. Each item may also have attributes that describe the items.

A "shapefile" is actually a set of several files. Three individual files are mandatory to store the core data that comprises a shapefile: .shp, .shx, .dbf

1985 questions
5
votes
2 answers

How to convert csv to shp in R

I have been trying for the past couple of days to convert a csv to shapefile. I know I can easily do in QGIS or Arc but would like to add this process into my existing R code. So i can read in the csv with no issues MyData <-…
Harmzy15
  • 487
  • 3
  • 6
  • 15
5
votes
1 answer

Should be easy: distance along a line in R?

I have a Shapefile of railroads in Mozambique, and have generated 100 random points along the railroad using the code below. My question is pretty simple, but I can't find an answer: how do you calculate the distance between points along the…
Cornelius
  • 69
  • 1
  • 4
5
votes
5 answers

What projections in r will fatten a city map?

I'm trying to make some city maps, and I'd like to distort them a bit so that the densest parts (manhattan in this case) appear to be a little wider on the final map. I'm having a hard time finding good projection examples at the city-level. I'd…
Anthony Damico
  • 5,779
  • 7
  • 46
  • 77
5
votes
2 answers

coordinates conversion with pyproj

I am not experienced in gis coordinates conversion but managed, using this page: http://all-geo.org/volcan01010/2012/11/change-coordinates-with-pyproj/ to convert shapefile coordinates from EPSG:28992 to EPSG:4326 using the python module pyproj…
musicformellons
  • 12,283
  • 4
  • 51
  • 86
5
votes
1 answer

How to subset a shapefile

The data set of shapefile "Property1A" is: df # suburb area asst # 0 Te Aro 14.541780 R076 # 1 Te Aro 7.655428 R076 # 2 Te Aro 3189.976134 # 3 Te Aro 242.173386 0132 # 4 Karori 537.697290 R003 # 5 …
Bingbing Liu
  • 61
  • 1
  • 1
  • 3
5
votes
3 answers

ogr2ogr Or arcpy for csv to shapefile?

Can ogr2ogr or arcpy do a direct csv to shapefile conversion? I'm trying to automate some processes with a small script and was hoping I can do it easily with ogr2ogr or arcpy which I'm new to. Any input would be appreciated.
Steven Lutz
  • 467
  • 1
  • 6
  • 16
5
votes
1 answer

Python Scripts to ingest a shapefile into a PostgreSQL/PostGIS database utilizing shp2pgsql.exe on windows

I have a PostgreSQL database hosted on a Windows 2008 Server RT Virtual Machine (Yes I know it should be hosted on a Linux VM but this is what my organization has dictated it be on. Sigh...) Our GIS guys dump a lot of shapefiles into a repository.…
AlienAnarchist
  • 186
  • 4
  • 15
5
votes
2 answers

Plotting shapefiles on top of Google map tiles

I have some shapefiles I want to plot over Google Maps tiles. What's the most efficient way to do this? One path might be to use the pkg RgoogleMaps, however, it is still unclear to me how to do this. I assume using PlotonStaticMap with some…
pslice
  • 503
  • 1
  • 4
  • 13
5
votes
1 answer

Reading DWG files in R?

Is there any way to open a DWG file in R and save it as an ESRI shapefile? I don't know any package available yet. Thanks in advance.
Hector
  • 61
  • 1
  • 2
5
votes
2 answers

Plotting elements from shapefiles in R

stackoverflow community, I have two shapefiles of the municipalities of Japan. I'm using R to create separate plots for each of the municipalities. I can make this work with one shapefile, but the identical syntax fails with the other. Here are…
5
votes
2 answers

Opening shapefiles in R using rgdal always better than using maptools?

I found two basic ways to open shapefiles in R - using rgdal and maptools: # 1 require(maptools) shape_maptools <- readShapeLines("file.shp") # 2 require(rgdal) shape_rgdal <- readOGR(".", "file") The data structures seem exactly the same in both…
Tomas
  • 57,621
  • 49
  • 238
  • 373
5
votes
4 answers

Where can I find old R packages in .zip format ?

Where can I find old R packages in .zip format ? At CRAN for example : http://cran.r-project.org/src/contrib/Archive/shapefiles there are only sources of .tar.gz files, I have to install old version of shapefiles because some finctions have been…
Qbik
  • 5,885
  • 14
  • 62
  • 93
5
votes
1 answer

How can I eliminate some areas by attribute from a shapefile in R and create a new shapefile?

I have been at this for a while now and have had some success, however when it comes to rewriting the file, I have had none. The shapefile I am working with is a polygon shapefile of metro and micropolitan areas but I am not interested in the…
Dan Johnson
  • 77
  • 1
  • 7
5
votes
2 answers

Finding 1st order neighbors using shapefile polygons

I am looking a efficient way to find the 1st order neighbors of a given polygon. My data are in shapefile format. My first idea was to calculate the x and y coordinates of the polygons' centroids in order to find the neighbor's centroids. import…
Gianni Spear
  • 7,033
  • 22
  • 82
  • 131
5
votes
3 answers

2008 TIGER/Line® Shapefiles from Census.gov -> Google Maps

How do I take shapefiles and extract lat/lng coords so I can plot polygons on Google Maps? http://www2.census.gov/cgi-bin/shapefiles/national-files I asked this question…
Philip Brocoum
  • 2,866
  • 2
  • 24
  • 25