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
6
votes
2 answers

making a choropleth in R: merging zip code shapefiles from multiple states

Motivated by the post here, Developing Geographic Thematic Maps with R, I was thinking about constructing a choropleth map based on zip codes. I've downloaded the shape files for New Hampshire and Maine from…
andrewj
  • 2,965
  • 8
  • 36
  • 37
6
votes
1 answer

Using ggplot to plot shapefile and gganimate for animation

Sample data library(raster) library(ggplot2) my.shp <- getData('GADM', country = 'FRA', level = 1) plot(my.shp) If I want to plot this data using ggplot: my.shp_f <- fortify(my.shp, region = "ID_1") ggplot(data = my.shp_f, aes(long, lat, group =…
89_Simple
  • 3,393
  • 3
  • 39
  • 94
6
votes
2 answers

How to upload shapefile into Shiny App

I am trying to figure out how, using Shiny App, a user can submit a shapefile via fileInput and then map it on a leaflet basemap. I am stuck on the server.R script and unsure how to handle the user submitted shapefile and convert it into a spatial…
dwiz
  • 410
  • 3
  • 16
6
votes
1 answer

Mercator projection world map with Geoserver and Openlayers

I'm trying to render a world map shapefile on my Geoserver with a Mercator projection. I've tried declaring the SRS on Geoserver and defining EPSG projections of 3785 or 900913 in Openlayers with no success. I've also tried to reproject the…
bjaxbjax
  • 1,351
  • 2
  • 15
  • 24
6
votes
1 answer

Geojson to shapefile using Python

I'm trying to convert a geojson file into a shapefile. I'm trying this way (I'm very new to Python so it might be incorrect). import urllib, geojson, gdal url= '…
Gus
  • 85
  • 1
  • 2
  • 6
6
votes
1 answer

spatial join on two simple features {sf} with over 1 mil. entries as fast as possible

I hope this is not too trivial but I really can't find an answer and I'm too new to the topic to come up with alternatives myself. So here is the Problem: I have two shapefiles x and y that represent different processing levels of a Sentinel2…
6
votes
1 answer

Adding custom Feature attributes to ESRI Shapefile with Python

I am seeking a way to take an existing ESRI Shapefile that has a Feature set of 200 countries. Each country Feature has an attribute of "NAME." My objective is to create a Python script that adds an arbitrary (for now) additional attribute, say,…
mattdeboard
  • 700
  • 1
  • 7
  • 17
6
votes
2 answers

Easiest way to plot data on country map with python

Could not delete question. Please refer to question: Shade states of a country according to dictionary values with Basemap I want to plot data (number of sick people for a certain year) on each state of Mexico. I am using jupyter notebook. So far…
RM-
  • 986
  • 1
  • 13
  • 30
6
votes
1 answer

PHP - Generate kml from 'Point' shape

I'm using PHPShapefile library for generating KML and displaying data to the google map but while it comes to 'Point' shape its not working and not generating KML for same. Here is the code snippet for Polygon shape help me to create for Point…
Wit Wikky
  • 1,542
  • 1
  • 14
  • 28
6
votes
1 answer

Python: assign point to roads shapefile

I have some data points from gps data (Lat,Lon) and the relative shapefile of the area I am considering. So: import pandas as pd import shapefile sf = shapefile.Reader('roadshape') df = pd.read_csv('gpsdata.csv') Now df contains the data I am…
emax
  • 6,965
  • 19
  • 74
  • 141
6
votes
0 answers

MySQL Geometry Limit (Maximum Length of Polygon String)

Is there a limitation of how many Points a Polygon may have? I use shp2mysql-php (http://sourceforge.net/projects/shp2mysql-php/) to import SHP Shape Data of countries. It works fine, but all my polygon date is limited to an maximum…
6
votes
1 answer

ggplot2: Combine shapefiles from two different geodatasets

I am trying to plot some geolocational data pertaining to Great Britain and Ireland in ggplot. Running the following code, I can successfully map some values from this tab-separated file onto the GBR shapefile data found here (country = Great…
duhaime
  • 25,611
  • 17
  • 169
  • 224
6
votes
2 answers

How to combine state-level shapefiles from the united states census bureau into a nationwide shape

The census bureau doesn't provide a nationwide shapefile of public use microdata areas (the smallest geography available on the American Community Survey). I tried combining them all with a few different methods, but even the one that de-dupes…
Anthony Damico
  • 5,779
  • 7
  • 46
  • 77
6
votes
1 answer

How to use set clipped path for Basemap polygon

I want to use imshow (for example) to display some data inside the boundaries of a country (for the purposes of example I chose the USA) The simple example below illustrates what I want: import numpy as np import matplotlib.pyplot as plt from…
Dipole
  • 1,840
  • 2
  • 24
  • 35
6
votes
2 answers

How to limit the raster processing extent using a spatial mask?

I am trying to limit raster processing in MATLAB to include only areas within a shapefile boundary, similar to how ArcGIS Spatial Analyst functions use a mask. Here is some (reproducible) sample data I am working with: A 4-band NAIP image (WARNING…
Borealis
  • 8,044
  • 17
  • 64
  • 112