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
10
votes
4 answers

Exporting a Geopandas dataframe to a zipped shapefile directly

I'm trying to save Geopandas data frame into a shapefile that is written to a zipped folder directly. As any shapefile user knows, a shapefile is not a single file but rather a collection of files that are meant to be read together. So calling …
saQuist
  • 416
  • 7
  • 19
10
votes
5 answers

How to export contours created in scikit-image find_contours to shapefile or geojson?

I'm trying to export the results of the scikit-image.measure.find_contours() function as a shapefile or geojson after running on a satellite image. The output is an array like (row, column) with coordinates along the contours, of which there are…
Cate
  • 431
  • 1
  • 7
  • 22
10
votes
1 answer

How to run GDAL (ogr2ogr) in Java to convert Shapefiles to GeoJSON

I'm a beginner at programming and get pretty confused when trying to use external libraries. I have my maps in shapefiles that I convert to GeoJSON using the website Mapshaper.org, and only then can i read the map from my Java application. I want…
user29903
  • 101
  • 1
  • 3
10
votes
1 answer

How to set line width and color when plotting a shapefile with plot()

I have a simple shapefile I want to plot with the general plot() (I noticed that ggplot is extremely slow in plotting maps). I can correctly plot the shape with the code library(maptools) map_shp <- readShapePoly(map_filepath) map <-…
CptNemo
  • 6,455
  • 16
  • 58
  • 107
10
votes
2 answers

How to extract vertexes of geometries in ESRI shapefiles using ogr library with c++

I have answered the question and also changed the title of the question from How to access vertices in a polygon layer using ogr library with c++ to How to extract vertexes of geometries in ESRI shapefiles using ogr library with c++. The code can…
Sepideh Abadpour
  • 2,550
  • 10
  • 52
  • 88
10
votes
1 answer

gdal/ogr: How to really crop a shapefile?

Given a SHP file corresponding to European countries, and... Given defined area corresponting to France such : West : 005° 48' W East : 010° E North : 051° 30' N South : 041° N How to get only the dots/geometries which intersects my defined area…
Hugolpz
  • 17,296
  • 26
  • 100
  • 187
10
votes
2 answers

SpatialPolygonDataFrame plotting using ggplot

I have a shape file for the greater London area. I use the readShapePoly function from the maptools package to load it in R as a SpatialPolygonDataFrame . I want to the plot those polygons .. Which I have already done by using the basic of plot…
Moustafa Alzantot
  • 397
  • 1
  • 4
  • 16
10
votes
3 answers

Manipulate shapefile attribute table using R

I've posted this question on the GIS stack exchange, but it's not seeing much traffic. I'm a GIS user who's been using R for stats for a few years, and I'm excited to see a lot of new GIS capabilities being released (raster, shapefiles, rgdal,…
RichT
  • 304
  • 1
  • 3
  • 13
10
votes
2 answers

Creating Shapefiles in R

I'm trying to create a shapefile in R that I will later import to either Fusion Table or some other GIS application. To start,I imported a blank shapefile containing all the census tracts in Canada. I have attached other data (in tabular format) to…
user2142810
  • 1,143
  • 2
  • 9
  • 8
9
votes
1 answer

Problem with a column name contains a colon in PostgreSQL

I downloaded the shape data from OSM. I have imported data from Shapefile into PostgreSQL without any problem but I got an error when I do the select statement. Select addr:city From location; Error: syntax error at or near ":" The problem is…
Vorleak Chy
  • 649
  • 9
  • 13
9
votes
1 answer

Reading shapefile coordinates in c#

I want to draw a polyline on "XAML Map Control" with latitude/longitude, using the content of a shapefile. I have 2 types of shapefile: One with .dbf, .prj, qpj, .shx and obviously .shp file. One with only .shp file Reading with both type of files…
iRubens
  • 315
  • 1
  • 2
  • 11
9
votes
1 answer

Shapefile to raster conversion in R?

I have a shapefile downloaded from the worldwildlife.org for the terrestrial ecoregions of the world. The file can be loaded here: http://worldwildlife.org/publications/terrestrial-ecoregions-of-the-world. It comes as a standard shape file and I…
I Del Toro
  • 913
  • 4
  • 15
  • 36
9
votes
1 answer

Export a polygon from an R plot as a shapefile

I have been trying to export the content of a plot (lines/polygons) as a layer/shapefile that I can open in ArcMap. These are some of the libraries that I have been…
user1626688
  • 1,583
  • 4
  • 18
  • 27
9
votes
2 answers

Read only data slot from shapefile (R)?

I have some very large shapefiles. I can read them into SpatialPolygonsDataFrame's using the rgdal function readOGR, but it takes a very long time for each file. I am actually only interested in the data.frame that shows up in the @data slot. Is…
attitude_stool
  • 1,023
  • 1
  • 13
  • 18
8
votes
4 answers

How can I transform the coordinates of a Shapefile?

I am trying to get neighborhood data into my application, and I'm having problems with the data I am using, which I got from here. This file contains a shapefile that has the neighborhoods of San Francisco. I am running a Ruby on Rails framework,…
Larry
  • 664
  • 6
  • 9