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
94
votes
15answers
49k views

Identifying Coordinate System of Shapefile when Unknown?

I have a Shapefile but its coordinate system is Unknown, and there is no *.prj file. How can I identify it now?
72
votes
4answers
151k views

Calculating polygon areas in QGIS?

How do I calculate areas of an area shapefile in square meters or in acres (ha)? I didn't find that functionality in the vector tools.
8
votes
2answers
656 views

Computing dominant area in polygon using ArcGIS Desktop?

First, I have a shapefile consisting of square grids and each grid has an ID. Second, I have a shapefile consisting of different zones (with IDs). A grid ID in the first shapefile can contain many ...
32
votes
5answers
54k views

Splitting shapefile into separate files for each feature using QGIS/GDAL/SAGA?

I have a polyline shapefile with about 20 kinds of roads. I would like to know how can I create automatically a vector file for each one. I am aware of how to do it using ArcGIS for Desktop - see ...
52
votes
4answers
52k views

Which character encoding is used by the DBF file in shapefiles?

Which character-encoding is used by the dbf-file in shapefiles? It seems it is handled different, based on the program and the local encoding-settings of the machine. Which encoding is 'right' - ...
20
votes
2answers
32k views

Adding shapefile or feature class as layer in ArcGIS Desktop using Python/ArcPy?

I am trying to automate various tasks in ArcGIS Desktop (using ArcMap generally) with Python, and I keep needing a way to add a shapefile to the current map. (And then do stuff to it, but that's ...
33
votes
4answers
9k views

Bulk load multiple shapefiles into PostGIS

I've got over a hundred data layers in shapefile format that I want to upload into a PostGIS database. They are all in the same projection, but represent different data layers so they do not have the ...
97
votes
24answers
114k views

Converting between KML and shapefile (SHP) format?

My users are sending me point data that were digitized using Google Earth. How can I convert their KML to a shapefile?
37
votes
15answers
100k views

Converting MapInfo TAB and/or MIF to SHP using free tools or ArcGIS for Desktop core product?

How do I convert MapInfo TAB and/or MIF files to SHP using only free tools or ArcGIS itself? I've not had much luck trying to do this in the past and I don't want to have to shell out for the ArcGIS ...
25
votes
8answers
18k views

Using ogr2ogr to convert all shapefiles in directory?

I have a directory with several shapefiles. How can convert all these shapefiles to MapInfo with ogr2ogr? I know how I can convert one file. And I can make a batch script writing a line for each ...
31
votes
12answers
49k views

Converting shapefiles to text (ASCII) files? [duplicate]

How can I convert a shapefile (GIS) to text, or, how can I extract the information in a shapefile?
10
votes
5answers
12k views

Clipping LAS data using shapefile polygons and open source software?

I am trying to clip or filter lidar files (.las, .xyz) using a shapefile that contains multiple polygons. Is there open source software that can do this spatial operation? My .las files are enormous,...
26
votes
4answers
36k views

How to write Shapely geometries to shapefiles?

Can someone demonstrate a simple way to write geometry data-structures from shapely into shapefiles? I am particularly interested in polygons with holes and linestrings. It would also be beneficial to ...
26
votes
9answers
17k views

How can I convert an excel file with x, y columns to a shapefile?

How can I convert an excel file with x, y columns to a point shapefile? There are some somewhat optional requirements in addition to the correct creation of a shapefile: Column types (as per Excel's ...
34
votes
5answers
35k views

Converting .shp into .gpx using QGIS?

I would like to convert .shp into .gpx. Using GIS, I open my shapefile and I tried to "save as" gpx but it gives an OGR error: creation of field ObjectId failed (OGR error: Field of name '...
4
votes
2answers
10k views

Intersect Shapefiles using Shapely

What I'd like to try and do is intersect some point buffers with census tracts, maintain their ID's and the tracts attributes. I found a sample from http://www.macwright.org/2012/10/31/gis-with-...
43
votes
7answers
37k views

Choosing File Geodatabase (*.gdb), Personal Geodatabase (*.mdb) or shapefile format?

Previously, I have used geodatabases as an easy way to keep all files together rather than having dozens of shapefiles all over the place, and it is easier when finally exporting all the relevant data ...
28
votes
3answers
34k views

How to encode shapefiles from LATIN1 to UTF-8?

Is there a way to encode shapefiles from LATIN1 to UTF-8?
22
votes
4answers
19k views

Using ogr2ogr to convert GML to shapefile in Python?

I am trying to convert a GML to an ESRI shapefile using ogr2ogr utility in a python script. I have successfully installed the GDAL/OGR package via osgeo but I am now struggling to find/understand ...
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 ...
13
votes
2answers
4k 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 ...
12
votes
2answers
2k views

Where did the polygons go after projecting a map in QGIS?

I'm fairly new at GIS know-how, but I've run into a problem with a projection of a world map. I have a shapefile of all countries I downloaded from Natural Earth. After projecting it into a ...
10
votes
7answers
19k views

Fixing corrupt shapefile?

I have a shapefile that I was working on in ArcGIS Desktop 9.3 get corrupted somehow and it gives me the error "Number of shapes does not match the number of table records.". What I would want is to ...
5
votes
1answer
405 views

Turning vector grid into individual shapefiles using QGIS?

I am using QGIS and I created a vector grid on a crop field in order to cut it into plots. I want to save each grid cell into individual polygon shapefiles automatically. Here is an example of a ...
37
votes
4answers
24k views

Simple thematic mapping of shapefile using Python?

I wish to visualize geographical data in Python, without using ArcGIS/ArcPy, and make a map. On the internet I found how to make a thematic map using Python: Here is some code that I tried: ...
33
votes
10answers
58k views

Adding Attribute data to shapefile?

I can display a shapefile in openlayers but I need to add some attribute data. I can open the dbf file in excel but there is no save as option in excel to the updated file as a dbf. What is the ...
23
votes
2answers
70k views

Cropping Shapefiles in QGIS?

I need to clip a large and very detailed shapefile in QGIS showing environmental data similar to a temperature map. Is there something like the very simple crop tool like in Adobe Photoshop where ...
35
votes
4answers
20k views

Is there an automatic function in QGIS to package all files in a project for transferability?

In my project, I use a lot of geodata from different directories. Now I want to give the QGIS project to a colleague (eg on a CD). Is it possible to copy the shapes from different directories ...
11
votes
2answers
48k views

Changing unit of measure from degrees to meters in QGIS?

I am running QGIS 1.7.0 on windows, and I donwloaded a shapefile of census block group boundaries from TIGER. This file appears to be in the WGS 84 coordinate system, and when I open it in QGIS the ...
7
votes
3answers
8k views

How to read Greek fonts (ISO-8859-7) in shapefile attributes within QGIS 1.8.0?

I'd like to ask whether there is a way to read greek fonts in a shapefile's attribute table within QGIS 1.8.0.
41
votes
5answers
30k views

Bypassing 10 character limit of field name in shapefiles?

I'm exporting geometry with attached text attributes from oracle database to esri shapefile format (.shp) with Java and Geotools library. Attribute columns in our database have names with more than ...
3
votes
2answers
234 views

Moving a shapefile point 500 m west

I am a novice to arcgis 10 so please forgive my ignorance.I have this 2000 survey points shapefile and I was told to , I guess is dislocate, generate new survey points, each new should be 500m west ...
24
votes
5answers
22k views

How to add attribute field to existing Shapefile via Python without ArcGIS?

I have a Python script that adds an attribute field to a Shapefile if doesn't exist. This is easy to do with ArcGIS (graphically or via Python), but I'm looking for something that doesn't depend on ...
22
votes
3answers
17k views

Order of polygon vertices in general GIS: clockwise or counterclockwise

Two days ago I asked a question about the internal storing order for the vertices of a polygon in ESRI shapefiles. That question was answered (Are polygons stored clockwise or counterclockwise in a ...
10
votes
2answers
32k views

Check if a point falls within a multipolygon with Python

I have tried several examples of code using libraries such as shapefile, fiona, and ogr to attempt to check whether a point (x, y) falls within the boundaries of a multipolygon created with ArcMap (...
10
votes
5answers
14k views

How to display special characters German “ÄÜÖß” in a map?

I have a shapefile with names for Regions. These don't seem to contain special characters but ugly hieroglyphs. What can I do do display them correctly. If I import the shape as UTF-8 it doesn't work.....
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. ...
1
vote
1answer
840 views

Reverse gdal_rasterize (-i option) does not work

When I use: gdal_rasterize -b 1 -b 2 -b 3 -burn 255 -burn 255 -burn 255 polygon.shp tiff.tiff I get a new tiff with a white hole in it with the shape of the polygon shp. However, when I use the ...
27
votes
5answers
28k views

How to convert image of map into vector format?

What is the best way of converting a gif of a map into a vector format, such as a shapefile? The only relevant parts that I am interested in are the outline of the island so I realize some manual ...
21
votes
6answers
59k views

Convert shapefile to CSV including attributes AND geometry?

I have a shapefile with 60k+ entries, all of which are polygons with corresponding attributes (acreage totals, landowner names, tax ID #s, etc.). What I ultimately need is a CSV file with all of ...
4
votes
3answers
8k views

Using PyShp to convert polygons in *.csv to *.shp files?

I'm converting csv data to shapefiles using the pyshp python library. What I want to do is very similar to Using pyshp to convert .csv file to .shp?, except that I don't know how to handle polygons. ...
4
votes
1answer
10k views

Using Fiona to write a new shapefile from scratch

I am new to Fiona, and trying to wrap my head around reading a csv file and writing out an ESRI shapefile. I have most of it down, but am missing two things; (1) defining the projection/spatial ...
8
votes
3answers
3k views

How to set a default value for attributes in shapefiles?

In QGIS 2.14.6 I would like to define a default value for an attribute in a shapefile (or spatialite layer as well) which is applied if the user doesn't explicitely sets the value. Is there a way to ...
7
votes
1answer
1k views

Creating parallel line in ArcGIS Pro using ArcPy?

I want to create offset/parallel lines for my centre lines (over 12000 polylines) in different distance for each class number(i have numbers in column) and with the same line direction as centre line. ...
6
votes
1answer
9k views

Assigning CRS to shapefile when it doesn't have one, in R?

I think that by using readOGR to import a shapefile renders worthless to put proj4string to the script since if any coords are available in the shapefile, it will be transported through the readOGR. ...
8
votes
1answer
22k views

How to resize shapefile features proportionally in QGIS?

In Quantum GIS (1.8.0-Lisboa) on Windows (OSGeo4W Install), how exactly would you resize a feature proportionally. The only way I've found to do this is by hand using either the Freehand Editing (0.2....
61
votes
6answers
145k views

Opening shapefile in R? [closed]

I need to open a shapefile from ArcMap in R to use it for further geostatistical analysis. I've converted it into ASCII text file, but in R it is recognized as data.frame. Coordinates function doesn't ...
17
votes
2answers
30k 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)...
10
votes
2answers
18k views

Using pyshp to convert .csv file to .shp?

I am trying to understand how I can use the csv module in python to open a csv file in the same folder as the python script, and then create a shapefile using the shapefile module pyshp. The csv file ...
8
votes
3answers
19k views

Finding municipal-level administrative boundary data for India? [duplicate]

Does anyone know how to find a shapefile with boundaries of Indian municipalities? I have tehsil boundaries as for year 2001, but I would like boundaries of municipalities and, ideally, also ...