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
70
votes
7 answers

Best way to overlay an ESRI shapefile on google maps?

What is the best way to overlay a shapefile in Google Maps? After some reading suggests that, converting shapefile into KML and overlaying KML in Google map is an option. If that is the case, how do I convert a shapefile into KMLs? I believe there…
Carsen
  • 709
  • 1
  • 6
  • 3
61
votes
5 answers

Does anyone know of a library in Java that can parse ESRI Shapefiles?

I'm interested in writing a visualization program for the road data in the 2009 Tiger/Line Shapefiles. I'd like to draw the line data to display all the roads for my county. The ESRI Shapefile or simply a shapefile is a popular geospatial …
KingNestor
  • 65,976
  • 51
  • 121
  • 152
45
votes
3 answers

Need the path for particular files using os.walk()

I'm trying to perform some geoprocessing. My task is to locate all shapefiles within a directory, and then find the full path name for that shapefile within the directory. I can get the name of the shapefile, but I don't know how to get the full…
Schack
  • 833
  • 2
  • 7
  • 18
37
votes
4 answers

sp::over() for point in polygon analysis

I have a shapefile named "ind_adm" and a SpatialPointsDataFrame called "pnts". The "pnts" contains points generated at random, and some of the points overlap with the polygon. See picture below. Now, I want do do a point in polygon analysis, i.e. I…
DotPi
  • 3,977
  • 6
  • 33
  • 53
36
votes
4 answers

How/Where do I get geoJSON data for states, provinces, and administrative regions of non-US countries?

I need geoJSON formatted paths for states, provinces, and regions within multiple countries. Most readily available geoJSON data is for US states and country level boundaries, not regions within the country. This geoJSON will be used to create a…
bburrier
  • 1,399
  • 1
  • 17
  • 18
34
votes
2 answers

Clipping raster using shapefile in R, but keeping the geometry of the shapefile

I am using {raster} to clip (or crop) a raster based on an irregular shapefile (the Amazon biome) but the output always has a rectangular extent. However, I need the output in the exact same geometry of the shapefile. Any tips?…
ALSM
  • 627
  • 1
  • 5
  • 14
29
votes
7 answers

Check if a geopoint with latitude and longitude is within a shapefile

How can I check if a geopoint is within the area of a given shapefile? I managed to load a shapefile in python, but can't get any further.
Gerald Bäck
  • 445
  • 1
  • 5
  • 7
24
votes
3 answers

Shapefile into geojson conversion python 3

output_buffer = [] for features in range(0,layer.GetFeatureCount()): feat = layer.GetNextFeature() geom = feat.GetGeometryRef() result = feat.ExportToJson() output_buffer.append(result) When I convert into geojson, I get output, but…
Vas
  • 395
  • 1
  • 3
  • 13
24
votes
1 answer

Create convex hull polygon from points and save as shapefile

Needing some help re a conversion problem in R. I've got calculated the convex hull of a cloud of points. I'd like, from the points forming the convex hull, to build a polygon object and save that as a shapefile that can be read by a GIS software…
user3310782
  • 811
  • 2
  • 10
  • 18
24
votes
7 answers

Is there any free DBF file converter?

I have only found trial versions of these converters. Does anyone know a free one? Any of the following target formats will do: CSV, MDB, SQL, XLS
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
20
votes
5 answers

Different legends and fill colours for facetted ggplot?

Sorry for not included any example data for my problem. I couldn’t find a way to easily produce an example shape file. Hopefully, experienced users of ggplot can see what I’d like to do from the description below. I’ve got: A data.frame X with…
donodarazao
  • 2,773
  • 4
  • 26
  • 26
19
votes
3 answers

Set SHAPE_RESTORE_SHX config option to YES to restore or create it

I am not able to read the shape file. It says no such working directory. !pip install sentinelsat !pip install geopandas !pip install folium from sentinelsat import SentinelAPI user = '****' password = '****' api = SentinelAPI(user, password,…
19
votes
6 answers

Shapefile reader in Python?

Are there any libraries that I can use to read a shp/shx/dbf/sbx set of files? I mainly need to extract some polygons but something that lets me extract any data that I want would be awesome.
Zameer Manji
  • 3,017
  • 5
  • 31
  • 42
19
votes
7 answers

Error opening SHP file in R using maptools readShapePoly

I am new to R and was following the following tutorial on the ggplot2 package found here. However the readShapePoly() function throws an error whenever I try to load the basic shapefile. I have used the following…
Steve Senior
  • 191
  • 1
  • 1
  • 6
18
votes
3 answers

Intersecting Points and Polygons in R

I am working with shapefiles in R, one is point.shp the other is a polygon.shp. Now, I would like to intersect the points with the polygon, meaning that all the values from the polygon should be attached to the table of the point.shp. I tried…
Jens
  • 2,363
  • 3
  • 28
  • 44
1
2 3
99 100