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

Unzipping and reading shape file in R without rgdal installed

I would like to unzip and read in a shape file from the web in R without relying on rgdal. I found the read.shp function of the fastshp package that can apparently accomplish this without rgdal installed in the environment, however, I'm having…
Cyrus Mohammadian
  • 4,982
  • 6
  • 33
  • 62
8
votes
3 answers

combining multiple shapefiles in R

I have a folder with about 100 point shapefiles that are locations obtained while scat sampling of an ungulate species. I would like to merge all these point shapefiles into one shapefile in R. All the point data were in .gpx format initially which…
V.Menon
  • 81
  • 1
  • 1
  • 3
8
votes
4 answers

b'Recode from ANSI 1252 to UTF-8 failed with the error: "Invalid argument".' geopandas python

I am trying to read in a shapefile into a GeoDataFrame. Normally I just do this and it works: import pandas as pd import geopandas as gpd from shapely.geometry import Point df = gpd.read_file("wild_fires/nbac_2016_r2_20170707_1114.shp") But…
Julien
  • 992
  • 1
  • 10
  • 26
8
votes
2 answers

How to import a shape file into SQL Server?

In the past I have used shape2sql to import shape files into SQL Server. I tried that route again on a newer Windows 10 box, and nothing seems to happen when trying to use that application. Any suggestions for either getting shape2sql to work, or…
Jereme
  • 1,445
  • 1
  • 16
  • 32
8
votes
1 answer

Extract routes between stations from a rail network shapefile

Problem: I want to extract a route along the rail network between two stations from a shapefile and only plot this particular route, rather than the entire network. This is what I have so far: I have a shapefile with the entire rail network of the…
Gwenywar
  • 83
  • 6
8
votes
2 answers

Projecting my shapefile data on leaflet map using R

I (on Win7) was trying to get my shapefile data (Here are the data files.) to be displayed using leaflet package. But without any success. I only get the background map tile but not my data. I am able to see my data in QGIS though. I got the…
Stat-R
  • 5,040
  • 8
  • 42
  • 68
8
votes
1 answer

Split or save a subset of a ESRI Shape SHP file to a new file?

I'm working with shape files in GeoDjango. Right now I'm trying to write a test for code that loads in a shape file and saves it to a database. The shape file currently has a feature count of 64,118. I'd like to reduce this to a handful so the…
Eric Palakovich Carr
  • 22,701
  • 8
  • 49
  • 54
8
votes
1 answer

cant connect to postgres with GDAL ogr2ogr remotely

I am trying to insert a shapefile into PostgreSQL via Gdal ogr2ogr, the command looks like this: ogr2ogr -f 'PostgreSQL' PG:dbname='dbname',user='user',host='172.17.2.176',password='password',port='5432' shapefile -nln 'cities' However, ogr2ogr…
Marcus Ruddick
  • 9,795
  • 7
  • 28
  • 43
8
votes
1 answer

Android lib to read or parse shapefile

is there any library that is able to read parse a .shp file, preferably on where I don't need to use NDK. I was trying to use GeoTools but i can't seam to get it to work on Android.
Hugo Alves
  • 1,555
  • 2
  • 18
  • 41
8
votes
5 answers

TimeZone by Coordinate

As the title infers I need to find a time zone (or perhaps just the UTC offset) based on a pair of coordinates. I've been searching for different solutions, and there is a couple of web services out there but I need to be able to access the…
Morten
  • 1,819
  • 5
  • 28
  • 37
8
votes
4 answers

shapefile and matplotlib: plot polygon collection of shapefile coordinates

I'm trying to plot filled polygons of countries on the world map with matplotlib in python. I've got a shapefile with country boundary coordinates of every country. Now, I want to convert these coordinates (for each country) into a polygon with…
hannesk
  • 439
  • 1
  • 3
  • 8
8
votes
1 answer

R - stuck with plot() - Colouring shapefile polygons based upon a slot value

I have a shapefile showing remote areas in Australia, obtained from the Australian Bureau of Statistics: http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.005July%202011?OpenDocument At the same URL is a PDF "ASGS Remoteness Structure…
Michael Henry
  • 599
  • 2
  • 4
  • 17
7
votes
2 answers

Shapefile with ObjectiveC

I like to know if there is a Class, in objective-C, that manipulates shapefile (read/write/edit)? I have found a bunch of stuff on kml files but nothing about shp files, but definitely want to avoid the need of converting files format…
shadowing
  • 81
  • 1
  • 2
7
votes
1 answer

Add legend to geopandas

I have a map of Chile (http://labgeo.ufro.cl/fichas/chile_geo/ficha_cl_geo.html first link that says "Chile continental) and would like to plot it and add some points of centers for which I have latitude and longitud data. I am newbie with geopandas…
Isa
  • 93
  • 1
  • 1
  • 7
7
votes
4 answers

can't open shape file with GeoPandas

I don't seem to be able to open the zip3.zip shape file I download from (http://www.vdstech.com/usa-data.aspx) Here is my code: import geopandas as gpd data = gpd.read_file("data/zip3.shp") this gives me the error: CPLE_AppDefinedError: b'Recode…
Fred R.
  • 557
  • 3
  • 7
  • 16