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

GIS: Shapefile converted to GeoJSON has unexpected coordinate format

I have taken a shapefile from this page and I converted it to a GeoJSON file using Python and Geopandas like this: import geopandas as gpd file = gpd.read_file("file.shp") file.to_file("file.json", driver="GeoJSON") Here's an example line from the…
Ian Newson
  • 7,679
  • 2
  • 47
  • 80
0
votes
1 answer

Method of dividing geospatial objects into 'buckets' for speed of looking up nearby objects

I need to create an algorithm which allows for objects tagged with a latitude and longitude to be matched with objects in another list which are nearby. To be more specific, the objects in one list are defined by a set of extents which define the…
Ian Newson
  • 7,679
  • 2
  • 47
  • 80
0
votes
1 answer

API to publish data from shapefile

GIS is not really my expertise and need advice from experts here. Pardon me for my incorrect terms. I have a client asking to develop a system which provides API to consume data from their POI, PA and MPA datasets (in shapefile). Question is, what…
Zarul Zakuan
  • 510
  • 3
  • 13
0
votes
0 answers

Python mapping: plotting an electoral boundary over a street map?

I would have thought this would be so simple it would be almost example 1 in any mapping documentation. But it seems not... I want to map the boundary of an electorate over a street map, using cartopy. I can download the GIS data of the…
Alasdair
  • 1,300
  • 4
  • 16
  • 28
0
votes
1 answer

Converting Shp file to .osm.pbf file

I am trying to convert a GIS LINE shapefile into a .osm.pbf file. I've done some research on the topic and some tools that kept coming out are: Merkaator shp2osm - which deals mostly with point shapefile shape2osm.py - which keeps bringing up an…
Renaldo Moon
  • 165
  • 3
  • 14
0
votes
1 answer

How to create a polygon ESRI shapefile in c++?

I am using opencv in c++ to extract a set of 2D points from an geospatial image. Using those points as vertex i want to create a polygon ESRI shapefile. Gdal api tutorials (https://gdal.org/1.11/ogr/ogr_apitut.html) only have examples of how to…
underfloor
  • 301
  • 3
  • 12
0
votes
2 answers

r fill map with color by percentage

How can a map plot be filled with a color, by percentage area of the country. Example library(sp) library(raster) # https://gadm.org/download_country_v3.html level-0 ger.shape <- readRDS("gadm36_DEU_0_sp.rds") plot(ger.shape, col = 'lightgrey',…
Robert
  • 664
  • 9
  • 25
0
votes
0 answers

Leaflet for R not displaying polygons from shape file

I am attempting to make a choropleth using leaflet. I downloaded a shapefile of ZCTAs from data.gov and imported it into R via readOGR. Then, when piping that file into leaflet, nothing happens. I think the issue may be that the lats and lons from…
0
votes
1 answer

Creating shapefile from GeoJSON with multipolygons?

I am trying to do the same thing as this post: Geojson to shapefile convertion using shapefile library The user answered his own question, but I do not fully understand his answer. Can anyone please explain how he "converted multi-polygons into…
aka49
  • 1
0
votes
0 answers

Appending and plotting only those data points which are within the geometry of a sf object

I want to append data points which are within the geometry of a sf object. Wonder to know what is the approach to accomplish this with sf package. Any hints, please. library(tidyverse) library(maps) library(sf) us_map <- map_data('state') %>% …
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
0
votes
1 answer

How to fix "TypeError: Object of type 'bytes' is not JSON serializable" using pyShp in python3

I'm currently using pyShp to convert a shapefile into a geojson file. I saw a lot of people using the same script as me but i trully don't know why it's not working on my computer. I have the same error again and again but i don't understand where…
0
votes
1 answer

Basemap does not fit the shapefile well

I'm drawing a map of Hong Kong and I want to plot all the subway stations on the map. After specifying the bounding box, the center point in the Basemap function and converting the shapefile to the coordinate system 4326 using arcmap, I want to…
0
votes
0 answers

Saving matplotlib map to shapefile in python?

I already plot a prediction map I made with xgboost modal by matplotlib function and I want to save this map as a shapefile so I can work with it in ArcGIS, how can I do that? Picture of the map the code i use test_df['probability'] =…
Maram Mubarak
  • 323
  • 2
  • 3
  • 11
0
votes
1 answer

Where did GADM get its data from?

I need the administrative boundary data levels 0-4 (or as small as possible) for all countries of the world. The best source I can see so far - the most complete - is from GADM. However their license says not for commercial use, which I will intend…
Gryffin
  • 41
  • 9
0
votes
0 answers

How to extract variable data from a netcdf file with shapefile?

I am not getting the "lat" and "long" value for the shapefile I used to mask the netcdf file in R. Here is the link to the data: https://drive.google.com/file/d/15Feww0VvEq9SuJ4j4gxuVqvxpp_w8PVC/view?usp=sharing I read both netcdf and my area of…
CForClimate
  • 335
  • 5
  • 19
1 2 3
99
100