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

Converting shapefile to raster

I'm having an issue rasterizing a shapefile to produce points on a 0.5*0.5 grid. The shapefile represents classifications of risk level (Low-0, Medium-100, High-1000, Very High-1500) of global coral reefs to integrated threats. I pulled the code…
RMFish
  • 43
  • 1
  • 1
  • 4
4
votes
1 answer

Testing point with in/out of a vector shapefile

Here is my question. 1. Intro a shapefile in polygon type represent the study area http://i8.tietuku.com/08fdccbb7e11c0a9.png some point located in the whole rectangle map http://i8.tietuku.com/877f87022bf817b8.png I want to test whether each…
Han Zhengzu
  • 3,694
  • 7
  • 44
  • 94
4
votes
1 answer

Shapefiles under 1000 features but ArcGIS Online not accepting it?

I have a couple of zipped shapefiles with around 100-150 features. I am trying to add them on ArcGIS Online (which accepts under 1000 features per shapefile) but it is unable to do so, indicating to me that the zipped shapefile is too big. I am not…
Toronto23
  • 327
  • 8
  • 20
4
votes
2 answers

flatten/dissolve/merge entire shapefile

I've been using ogr2ogr to do most of what I need with shapefiles (including dissolving them). However, I find that for big ones, it takes a REALLY long time. Here's an example of what I'm doing: ogr2ogr new.shp old.shp -dialect sqlite -sql "SELECT…
stewart715
  • 5,557
  • 11
  • 47
  • 80
4
votes
2 answers

Count number of points in multipolygon shapefile using Python

I have a polygon shapefile of the U.S. made up of individual states as their attribute values. In addition, I have arrays storing latitude and longitude values of point events that I am also interested in. Essentially, I would like to 'spatial…
wuffwuff
  • 730
  • 2
  • 9
  • 19
4
votes
2 answers

Intersections of 3D polygons in python

Are there any open source tools or libraries (ideally in python) that are available for performing lots of intersections with 3D geometry read from an ESRI shapefile? Most of the tests will be simple line segments vs polygons. I've looked into OGR…
Andrew Walker
  • 40,984
  • 8
  • 62
  • 84
4
votes
1 answer

How to draw a line on a shapefile using Geotools

I have a shapefile that is opened and looks as such: Now I am attempting to draw a line from two points I click on that map; however the code they give for the QuickStart.java example is exceptionally vague. Here is their code: package…
Timothy Frisch
  • 2,995
  • 2
  • 30
  • 64
4
votes
2 answers

How to download the county boundaries of China in OpenStreetMap?

Is there a way to download the shp format file about eh county boundaries of China in OpenStreetMap?
Ben
  • 665
  • 1
  • 10
  • 27
4
votes
2 answers

Extract polygons from shapefile using Geotools

I have a shape file (Sample.shp) along with two other files (Sample.shx and Sample.dbf), which has geometry (polygons) defined for 15 pincodes of Bombay. I am able to view the .shp file using the Quickstart tutorial. File file =…
Manisha
  • 55
  • 1
  • 4
4
votes
6 answers

Error when opening shapefile

I am trying to open a shapefile in R, but I am getting the following error message: Error in getinfo.shape(filen) : Error opening SHP file I have checked other responses and most problems seem to have been solved by ensuring that the .dbf and .shx…
user3281487
  • 97
  • 1
  • 1
  • 9
4
votes
4 answers

Opening SHP file in RStudio

I've a package of five files with all French administrative limits (available here). All these five files LIMITE_DEPARTEMENT.SHP/DBF/AVL/PRJ/SHX are in a the folder /home/jonathan/R. I use this code…
jonathan
  • 149
  • 4
  • 11
4
votes
1 answer

Weird memory problems with ggplot maps

I'm trying to make some maps of the British Isles and have come across a very strange memory problem. My workflow is taking advantage of ggplot's layers to add new detail onto a base map. The base map itself takes shape files for the UK and Ireland…
jkeirstead
  • 2,881
  • 3
  • 23
  • 26
4
votes
1 answer

Python: find a method to calculate the "inner centroid" (X,Y) of a polygon

I have a polygon (converted in a Shapely object). My goal is calculate the "inner centroid" (also known as "point on surface")(return x,y values) and the "centroid" (return x,y values) following the figure example: from shapely.geometry import…
Gianni Spear
  • 7,033
  • 22
  • 82
  • 131
4
votes
1 answer

Outline polygon border that has been removed due to NA's

I want to plot a shape file using ggplot2 in R. More specifically, I want to plot % white living in each block for several major cities. So far, I've worked with New Haven. The problem is that some blocks are unpopulated, in which case % white = NA.…
4
votes
3 answers

difficulty plotting layer from shapefile in rstudio

I'm trying to load and plot a layer from a simple shapefile. It is state boundaries in the US. I can load it fine: > library("sp","rgdal") > shape = readOGR("/home/username/data/share/mapnik/world_boundaries/states_EPSG4326.shp",…
nomadicME
  • 1,389
  • 5
  • 15
  • 35