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
3
votes
0 answers

Automatically Get the Latest Version of a Shapefile From ONS Open Geography Portal

I am trying to automate a data pipeline in Python. Currently I manually download the latest version of the Local Authority Districts UK BUC shapefile from:…
mmTmmR
  • 573
  • 2
  • 8
  • 20
3
votes
1 answer

Edit polygon coords using Python, Shapely and Fiona

I need to edit the geometry of intersecting polygons and I don't know how I can save modified geometry to a shapefile. Is it even possible? from shapely.geometry import Polygon, shape import matplotlib.pyplot as plt import fiona c =…
anyryg
  • 313
  • 2
  • 13
3
votes
1 answer

Why can't I get st_read to open a shapefile from a compressed file? (Map is read if saved on local Onedrive folder but not unzipped in R)

I'm creating a report that includes a vector map of the state of Oklahoma in the US. I found shapefiles that I need, but these are in zipped files. I found a similar question on Stackoverflow (link here) about downloading and extracting zipped…
T PERRY
  • 81
  • 7
3
votes
1 answer

How to Properly Store ShapeFiles when Deploying R Shiny App

I am working on an R Shiny project to visualize the spread of COVID19 around the world. When I run the app locally, it works just fine, but when I try to deploy the app, it runs into issues which I am assuming are related to storing the shapefiles:…
user2813606
  • 797
  • 2
  • 13
  • 37
3
votes
1 answer

Merging topojson using topomerge messes up winding order

I'm trying to create a custom world map where countries are merged into regions instead of having individual countries. Unfortunately for some reason something seems to get messed up with the winding order along the process. As base data I'm using…
Flavio
  • 1,507
  • 5
  • 17
  • 30
3
votes
1 answer

How to concat/merge multiple zipped shapefiles using geopandas and python?

I have a ~60 zipped shapefiles from the US census for different states. I want to combine them all into one nationwide shapefile. I've tried so many different approaches from trying to download the file with read_file and a variety of other…
Kyle Pennell
  • 5,747
  • 4
  • 52
  • 75
3
votes
2 answers

Networkx Writing to Shape File

I am trying to write a shapefile using python 3.8 and Networkx v2.4. import networkx as nx import pandas as pd f= open('Onslowedge.edgelist','rb') G = nx.read_edgelist(f) latlong = pd.read_csv('latlong.csv',index_col=0) for index in…
3
votes
1 answer

Converting an image file to a shapefile

I have this road map in Nepal as an image within a pdf, distinguishing different types of roads by colors or line type. I am trying to make a shapefile from the image. What is the best practice converting an image to a shapefile? Ideally, I would…
Kichan Kim
  • 31
  • 1
3
votes
1 answer

How to place a shapefile on top of raster file in one plot, and then save the plot in a Jpeg file format

I am posting this question after three days searching the net but no success. Hope can get the answer here. Please do NOT delete the post as I did not find an answer for it here also. Thanks. I have 2 files: A raster image file (i.e., Air…
Canada2015
  • 187
  • 1
  • 12
3
votes
1 answer

Can't convert shapefiles to geojson

I need js code to convert shapefile files to geojson and vice versa, and I'm having trouble to find valid tools. I found Calvin Metcalf's repository, which should allow me to convert shapefile files to geojson, but I can't run it. Actually, I'm a…
epilurzu
  • 147
  • 8
3
votes
1 answer

How to query data from PostGIS by country?

I've download the a world map shapefile from TM_WORLD_BORDERS_SIMPL-0.3.zip The world map table's columns are as below: gid integer NOT NULL DEFAULT nextval('table_world_gid_seq'::regclass), fips character varying(2) COLLATE…
boybeak
  • 417
  • 5
  • 19
3
votes
2 answers

Overlay shapefile over Raster in Multiple plots

I am trying overlay the shapefile of south asia on top of multiple raster plots using the code as below: 'a' is a multilayered raster file. Here is the link to the data (917KB size) Test_Data ras <- list.files("/filepath/", pattern = "\\.tif$",…
Dipu
  • 123
  • 2
  • 14
3
votes
0 answers

Writing SpatialPointsDataFrame to Shape File gives Error rgdal::writeOGR : Non-unique field names

I'm trying to write a SpatialPointsDataFrame to a Shape file, like so: class(sampled_points) [1] "SpatialPointsDataFrame" attr(,"package") [1] "sp" rgdal::writeOGR(obj=sampled_points, dsn=paste0(getwd(),"/Data"), layer="pixels_pakistan1",…
D. Li
  • 123
  • 6
3
votes
1 answer

Alpha transparency not uniform when plotting a shapefile with Geopandas

When plotting a shapefile with Geopandas, I need to make the features transparent. When applying an alpha parameter, some of the features become less transparent than others. fig = plt.figure(figsize = (8.5,11)) ax…
3
votes
1 answer

Trying to plot in tmap shapefile with attribute

I am trying to work with municipality data in Norway, and I'm totally new to QGIS, shapefiles and plotting this in R. I download the municipalities from here: Administrative enheter kommuner / Administrative units municipalities Reproducible files…
Joanna
  • 33
  • 4