Questions tagged [shapefile]

A vector data storage format for storing the location, shape, and attributes of geographic features. Often referred to as 'an ESRI shapefile', as ESRI developed it.

Filter by
Sorted by
Tagged with
20
votes
3answers
15k views

Shapefile loader in pgAdmin 4

Recently I have updated my postgresql version. I have also upgraded pgAdmin from 3 to 4. But I was unable to load shapefile. I didn't find any plugin called shapefile loader. How can I get the ...
19
votes
2answers
14k views

API documentation for Gdal/Ogr with C#

I want to assign projection to shapefile in my web C# application, for this i am using Gdal/OGR/OSR C# bindings and add osr_csharp.dll and ogr_csharp.dll references. But i am facing some difficulty ...
18
votes
7answers
19k views

How to change the order of features in a shapefile?

I have a shapefile and I want to change the order of the features. Is that possible? I want to sort the features in the shapefile because I'm embedding this shapefile in a mobile app. The app will ...
18
votes
5answers
12k views

GeoJSON too bulky - what to do?

I am using leaflet.js to allow web users to select a region. Valid regions are US states, Canadian providences, and world countries (except for US and Canada). I constructed a shapefile myself using ...
18
votes
2answers
23k views

Convert a spatial polygon object to data frame using R

My goal is to modify an existing shapefile by merging certain polygons. After importing the shapefile and using the UnionSpatialPolygons command, I get the polygon outline that I want. However, this ...
18
votes
4answers
70k views

Opening and extracting data from Shapefiles?

We are in need of US highway data. We found it for Florida at the state GIS website. We downloaded the data for Florida highway intersections from here (this is a zip file). How do we use these ...
17
votes
4answers
40k views

How do I load a .dbf file into QGIS?

I want to use QGIS to extract lat/lng data from the vertices of polygons. There are about 400 polygons, each with maybe 200 vertices. I am having trouble with step one, getting the data into QGIS. ...
17
votes
4answers
11k views

Getting list of distinct values from shapefile field using QGIS?

I have a shapefile whose features I can filter by specifying a where clause in the query dialogue. F.x. I have a field named 'city_name' and by stating 'city_name = "London"' in the where clause only ...
17
votes
4answers
25k views

Exporting shapefile to PostGIS database in QGIS [closed]

How do I export a vector shapefile to PostGIS database? I am asking what format I have to export it.
17
votes
1answer
9k views

Selecting features by attributes using ogr2ogr?

I am writing a shapefile after some processing; however, in the final step I need to do some selection by attributes from the the shapefile. I am using the command in a shell with the aim of using it ...
17
votes
9answers
7k views

how to overlay shapefile and raster?

I have a shapefile with polygons. And I have a global raster file. I want to overlay the shapefile's polygons onto the raster grid and calculate the mean raster value for each polygon. How can I do ...
17
votes
1answer
1k views

The next big thing in standardized spatial data exchange format?

I remember reading something a few months back, in the latter half of 2012, about a coordinated group effort to design a new standard for sharing geographic / spatial data. It has or aims to have the ...
17
votes
4answers
4k views

Is starting names with numbers a bad data naming convention?

My company uses ArcGIS and has a project and data file naming standards in place and (for the most part) followed. Something that has always bothered me about he naming standards is that it mandates ...
17
votes
3answers
14k views

How to create a GeoJSON that works with D3?

I'm simply trying to convert a .shp file to a geoJSON format using: ogr2ogr -f geoJSON output.json input.shp After executing the command nothing seems to be wrong. Here's an excerpt from the output....
17
votes
1answer
700 views

Query OSM for all beaches facing west? - QGIS preferred

I want to identify all beaches on this planet (or a given subset of it) that are facing westwards (+/- 20-30 degrees). My idea is to use OSM as the data source. Extracting all polygons that have the ...
16
votes
4answers
4k views

Python module to delete SHP features (without Desktop GIS installed)

I have a piece of software (not Arc) that runs nightly on a non-production machine which updates shapefile features from an external database. Periodically I would like to delete all of the features ...
16
votes
2answers
29k views

Extracting intersection areas in R

I have two polygons. One contains fields(X,Y,Z) and the other contains soil types (A,B,C,D). I want to know what area of every field contains which type of soil. I tried the following: library(rgdal)...
16
votes
7answers
7k views

Free tool to simplify parcel shapefiles?

Is there any tool available which let's me run millions of parcel shapefiles and simplify them?
16
votes
3answers
36k views

Where can I download the Google Road network as shapefile?

Is there any site from where I can get Google Road network as shapefile? As per my knowledge It is not distributed by google. So anybody can suggest how can I create this road network for a custom use?...
16
votes
2answers
587 views

Can colon (“:”) character be used in shapefile field names?

I am trying to find out if the : character is allowed in the name of ESRI's shapefile field. I googled, but I couldn't find an answer. Here is an interesting quote from the article from ESRI FAQ ...
16
votes
5answers
53k views

Looking for free Shapefile editors

I want to create and edit Shapefiles for my application, and I'm looking for a free shape (ESRI) file editor - free for creating and editing.
16
votes
2answers
9k views

How to add custom Feature attributes to Shapefile using Python?

I am seeking a way to take an existing 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 ...
16
votes
8answers
39k views

Seeking shapefile of city boundaries in US?

Where can I find a shapefile that contains boundaries for the major cities in the United States? I have tried the census website but could not find anything.
16
votes
2answers
755 views

How to clean such a bad shapefile for routing?

I am trying to clean a shapefile to make it usable for routing with pgrouting, postgis, postgresql. Here an intersection, it seems to be connected but when we zoom …. It is not: Same here : Here ...
16
votes
4answers
6k views

How to stop writeOGR from abbreviating Field Names when using “ESRI Shapefile” driver

I'm currently using the following script to add some attribute data from a table to lots of individual shapefiles: library(rgdal) specieslist <- read.csv("SpeciesList1.txt", header=F) attdata <-...
15
votes
5answers
3k views

Does Re-Projecting ShapeFile only update content of *.prj file?

If I wish to change the projection of some shapefiles from .. let's say NAD83 (4269) to WGS84 (4326) ... and by using some 3rd party app .... does this mean the .prj file is only updated .. and not ...
15
votes
4answers
32k views

Converting osm file to shapefile (or data frame) in R

I was looking for a road shapefile for Australia today. I ended up going to Geofabrik. Open Street Map has data in .osm format. But they do not have one in .shp for Australia. If possible, I want to ...
15
votes
3answers
7k views

Is there a public shapefile with the London Underground stations and lines?

Is there a public shapefile containing the stations and lines of the London Underground? I've been doing some intensive searching but I can only find the coordinates of the stations, or the lines in ...
15
votes
1answer
26k views

Converting a polygon into a raster using R

I'm trying to convert a shapefile into a raster within R. My approach is to read in the raster as follows: library(rgdal) # Loads SP package by default demo <- readOGR('F:/data/', 'shapefile') # ...
15
votes
4answers
9k views

How to avoid creating corrupt Shapefiles during Editing?

I have one of my GIS technicians digitizing some lines in QGIS in shapefile format. I don't know how he did it (and neither does he), but somehow the shapefile became corrupt. It was creating random ...
15
votes
8answers
9k views

Shapefile layers in QGIS don't display unless I zoom out

I have two shapefile layers in a Qgis project that have problems with zooming. One is a line I copied/pasted in a new layer from a set of height contours and the other one is a polygon layer I created ...
14
votes
2answers
7k views

Get field names of shapefiles using GDAL

I use GDAL in Python for importing shapefile. I want to know the field names for the file, my current way is: fields = [] for i in range(1, layer.GetFeature(0).GetFieldCount()): field = layer....
14
votes
6answers
2k views

Creating simple image from vector data

Can anyone suggest a quick (and preferably open source) way to create an image from a shapefile. For example, I have a shapefile containing parcel boundaries, I want to create a png file depicting ...
14
votes
2answers
27k views

Choosing the correct value for proj4string for shapefile reading in R?

I am having a shapefile of polygons and another CSV file which contains a list of points as (Lat, Lng) pairs.. I want to check for each (lat, lng) pair from the CSV file which polygon does it fall ...
14
votes
6answers
8k views

Automate SHP to JPG creation

Does anyone know of a way to batch convert shapefiles to jpegs or another common image format? edit: I should have clarified that I would like to apply a styling to each shapefile, and then export ...
14
votes
2answers
7k views

Is there a standard for the specification of .prj files?

We use shape files for data exchange. I've looked at the .prj files: different programs produce different prj files. Is there a standard how the parameters must be specified in a prj file? AFAIK the ...
14
votes
3answers
2k views

How can I represent distance using the dashes or markers of a vector line?

I am a very basic user and dont know the lingo to get to the gist of my question so some background might help. Ive volunteered to create a pre-incident planning system for my rural fire department. ...
13
votes
5answers
576 views

What in-depth spatial database systems tutorials exist? [closed]

Is there a good tutorial that explains in depth the internals of a GIS and a spatial database system such as PostGIS with examples and without any background assumption? I'm specifically looking for ...
13
votes
10answers
60k views

Where can I find Canadian postal code geometries?

Where can I find the shapefiles for Canadian postal codes?
13
votes
3answers
5k views

Inverting Polygons using QGIS?

I have a Shapefile with Polygon features representing the world's land areas (continents, islands). Is it possible to invert these, and get a geometry that represents the world's oceans and seas? ...
13
votes
2answers
3k views

Ortho Projection produces artifacts

I`m trying to create a sphere-like view using qgis and the "world from space"-projection http://spatialreference.org/ref/sr-org/6980/ (essentialy an ortho-projection). ArcGIS wraps the shapes ...
13
votes
2answers
25k views

How to convert data from a .gdb into a shapefile without ArcMap?

I have a .gdb folder with LOCK Files, FREELIST Files, ATX Files, GDBINDEXES Files, GDBTABLE Files, GDBTABLEX Files and, SPX Files. I want to convert the parcel data within this folder into a ...
13
votes
4answers
5k views

How to reproject spatial data using free libraries?

How can I use free libraries to transform spatial data? For example, I want to change the projection of a Shapefile within the code of my C# web application. How do I do that?
13
votes
3answers
1k views

Centralizing shapefile data into database

I've got hundreds of shapefiles from various different GIS projects that I want to start consolidating into a single database platform, currently attempting this with Postgres / PostGIS. Hardly any ...
13
votes
4answers
6k views

What is the best way to programmatically convert between WKT and Proj4 string?

Some shapefiles have a .prj file associated with it, and the .prj file contains the projection info of the shapefile in the format of WKT. Sometimes I need to convert WKT to proj4 string, and ...
13
votes
1answer
11k views

Use python to add layers to TOC

I've been battling with adding layers to the TOC for some time now. I have managed to single layers added but need to loop through a folder and add all layers. Shapefiles I cannot get to add at all. ...
13
votes
4answers
641 views

Are long lines in shapefiles to be considered geodesics or straight lines in the 2D latlong space?

Is there a definition on how lines connect vertices in the shapefile format? In the simplest case, imagine a line with only 2 points, from 40,-118 to 40,-112 - that's somewhere random in the US - ...
12
votes
4answers
2k views

How to model a graveyard - one point per deceased or one per grave? [closed]

This is a continuation of my previous question about our project on how to economically get away with the implementaion of a graveyard in a GIS system… On the graveyard we can find Regular ...
12
votes
6answers
33k views

Plot shapefile with matplotlib

I am trying to read a shapefile and plot it using matplotlib. Here is the code: import matplotlib.pyplot as plt import shapefile shpFilePath = "D:\test.shp" listx=[] listy=[] test = shapefile....
12
votes
3answers
14k views

How to get shapefile of river from OpenStreetMap?

I don't want to download whole map of an area. I just want rivers and other waterbodies present in an area in shapefiles so that I can use them in QGIS. I tried geofabrik but it is giving whole map ...