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
4
votes
1 answer

How to filter a shape file before plotting it in R

Just to try to filter a shape file to ease plotting I have a shape file downloaded from UK…
Dennis Ng
  • 361
  • 3
  • 11
4
votes
1 answer

How to change an attribute in Shapefile with a certain value with QGIS / Python

I want to use the Python Console in QGIS to change all attributes in a Shapefile with a certain value. I have a field named "ANB" and I want to change the value "2" in for example "3". I know how to access the layer and select the values I…
Robert BK
  • 81
  • 1
  • 4
4
votes
1 answer

NetLogo GIS: dealing with large shapefile

I'm developing a NetLogo model using the GIS extension to import a road network shapefile. The model works fine when I work on a small area of about 5x5 km. However I would like to allow potential users of the model to determine themselve their…
4
votes
1 answer

Dissolving hexmap polygon shape files

I am trying to produce an outline for a hexagonal cartogram by dissolving the inner polygons via the unionSpatialPolygons or aggregate functions. I am getting stray hexs that do not dissolve... a dummy example to show the problem: # grab a dummy…
guyabel
  • 8,014
  • 6
  • 57
  • 86
4
votes
0 answers

Calling Large Shapefiles into R, 2 GB polygon layer, rgdal

I'm attempting to open a shapefile in R using rgdal. my code is simply: shp <- readOGR("D:/Documents/EPA/Groundwater_Wells/R Work", "us_blocks_2010") The error message I receive is: Error: C stack usage 81982167 is too close to the limit The…
4
votes
1 answer

Map Lat/Lon Points to a Shape File in R

I am trying to identify the zip code for each set of lat/lon coordinate using a shapefile. Lat Lon data is extracted from: https://data.cityofchicago.org/Public-Safety/Crimes-2017/d62x-nvdr (Crimes_-_2001_to_present.csv) Shapefile:…
IsisDorus
  • 67
  • 2
  • 10
4
votes
2 answers

Calculate the length of shared boundaries between multiple polygons

I have a shapefile and I want to know for each polygon what other polygons touch it. To that end I have this code: require("rgdal") require("rgeos") download.file("https://www.dropbox.com/s/vbxx9dic34qwz63/Polygons.zip?dl=1",…
Chris
  • 1,197
  • 9
  • 28
4
votes
2 answers

Write Pandas Dataframe to DBF File?

I'm working with shapefiles, which have the attribute data stored in a DBF file. I need to manipulate the attributes using Pandas, and write the new DBF data back to disk. Unfortunately Pandas dataframes don't have a df.to_dbf method (whereas R…
Steve Maughan
  • 1,174
  • 3
  • 19
  • 30
4
votes
1 answer

Plotting a shapefile on a raster layer in R

I want to plot a raster layer with points from a shapefile on top. I have checked previous answers on this, but i still have a problem. I can plot the point shapefile and the raster layer separately without problem, but not together. As far as I…
dtanon
  • 173
  • 1
  • 2
  • 14
4
votes
1 answer

Read a shapefile with character encoding

Is there a way to read a shape file with a specific character encoding? I'm trying to read in a Canadian shapefile that has special (French) characters in some of the names. I can convert them manually, but I'd prefer not to do this if there's a…
Brandon Bertelsen
  • 43,807
  • 34
  • 160
  • 255
4
votes
1 answer

Listing Attribute values of Shape file ogrinfo/ogr2ogr

How do I list the values of an attribute in a shape file. ogrinfo -so -al build/SLA11aAust.shp shows the attributes. Which command to list values of STATE_CODE: : Layer name: SLA11aAust Geometry: Polygon Feature Count: 1390 Extent: (96.816941,…
Dawid
  • 165
  • 4
4
votes
1 answer

Merging spanish shapefile with dataframe

I am having problems merging a Spanish provinces' shapefile with a particular dataframe. After merging them, somehow the shapes get linked to the false provinces (f.e. Barcelona returns the shape of Teruel). I have searched for examples, but I can…
GGaudio04
  • 83
  • 1
  • 6
4
votes
1 answer

readOGR(), "cannot open file" error

Let me begin by saying that I have exhaustively looked at the other threads that have dealt with readOGR errors, and have made several attempts to implement them for my own benefit. The issue I have is similar to questions previously addressed:…
MLU0907
  • 43
  • 1
  • 4
4
votes
1 answer

Shapefile to 2D grid as sparse matrix

I'm getting well and truly lost in all the bolt-on libraries for doing geospatial calculations with NumPy. What is the most straightforward way to take a shapefile (whose extent is the entire Earth), and construct from it a sparse matrix that…
zwol
  • 135,547
  • 38
  • 252
  • 361
4
votes
1 answer

Shade states of a country according to dictionary values with Basemap

I want to plot the map of Mexico and shade the states accordingly to a the values of a dictionary. I used the following code suggested in previous question (Easiest way to plot data on country map with python), so far it plots the country and…
RM-
  • 986
  • 1
  • 13
  • 30