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
12
votes
3answers
15k views

How to delete multiple selected polygons at once?

I'm new at this, a novice at best. I'm using QGIS 1.7.3. I simply want to select a large number of polygons on screen and hit the delete key to delete them and resave the shapefile. Can this be done?
12
votes
3answers
25k views

Extract Raster from Raster using Polygon shapefile in R

I am new to R and using the raster package. I have a problem extracting polygons from an existing raster file. If I use extract(raster, poly_shape) function on the raster it always creates a list ...
12
votes
2answers
10k views

How to split non-contiguous feature in QGIS?

I have a shapefile with a feature that is non-contiguous. I want to split the areas on the left from the area on the right. However, QGIS's Split Features tool requires you to draw a line over the ...
12
votes
8answers
14k views

Is there a Free Opensource Shapefile Writer for .NET?

I am looking for a well documented, OpenSource Library that can create and write to a shapefile from .Net. I need lower lever access:i.e. I should be able to write feature by feature. Does such a ...
12
votes
2answers
9k views

Removing rows in shapefile in R

I've imported a shapefile into R, and joined it to a table. My shapefile contains all the census ids, while my table only contains selected census ids. I'm now trying delete all the rows didn't get a ...
12
votes
4answers
21k views

Importing .shp to PostgreSQL?

I want to import a shp file to postgreSQL. First I create sql file and then run PostgreSQL. To create sql file, I run this command in windows cmd: shp2pgsql -s 4326 worldCountries.shp worldcountries ...
12
votes
1answer
11k views

Import a shapefile to postgis with ogr2ogr gives: Unable to open datasource

I want to use ogr2ogr in order to import a shapefile in a postgis database. I have successfully installed ogr2ogr and I run from the pgsql the following command: ogr2ogr -f "PostgreSQL" PG:"host=...
12
votes
2answers
21k views

How to convert a shapefile to WKT?

I'm trying to convert a shapefile into the simple Well Known Text (WKT) format in the example below (from http://en.wikipedia.org/wiki/Well-known_text). MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), (...
12
votes
2answers
12k views

writeOGR with a spatialpolygon simplified by gSimplify

I'm using gSimplify (rgeos package) to simplify the geometries of a shapefile. The funcion works good, but now I can't write the output in a new shapefile. I tried some ways: writeOGR(simplyshape, ...
12
votes
1answer
16k views

Reprojecting raster from lat/lon to UTM in R?

i have to turn it into a UTM in order to make the buffer functional. wets<-readOGR(dsn=".",layer="shapefile") r.raster <- raster() extent(r.raster) <- extent(wets) res(r.raster) <- 100 ...
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 ...
12
votes
2answers
5k views

Reduce the resolution of a shapefile in R (or QGIS if necessary)

I'm using shapefiles of history U.S. state boundaries from NHGIS to make maps in R. These shapefiles are much higher resolution than I need when making maps at the scale of the country: over 2 million ...
11
votes
5answers
4k views

how can i convert a shapefile to lat and lon boundaries?

i have a shapefile of country subdivisions and i would like to extract an array of bounding lat and lon for each division.. is it possible to do?
11
votes
7answers
26k views

QGIS exporting attributes in a KML file

Here is what I am doing: Create a layer by uploading a shapefile into QGIS Select attributes of that file Export selected attributes with the "save only selected features" check box when I save the ...
11
votes
2answers
1k views

Are mixed geometry types allowed in shapefiles?

Does the shapefile support mixed geometry types (ie. point and polygon all in the same file)?
11
votes
2answers
5k views

Join a CSV file to shapefile using gdal/ogr?

I have a shapefile with several attributes, for example YEAR, COUNTY, and AREA. I also have a CSV file with more fields that I want in the shapefile, such as POPULATION. Both the shapefile and the CSV ...
11
votes
3answers
24k views

City shapefile for free

I am looking for a simple point shapefile which indicates where the cities of the world are. I cannot seem to find one which is free of charge and meets my requirements. Ive got this one: http://...
11
votes
4answers
13k views

How to change field length in QGIS

I have a shapefile I made in QGIS 1.7.4. One of the fields is a String of length 80. I'd like to make the field accept longer stings, but I can't figure out how to change its length. How do I do this? ...
11
votes
1answer
34k views

Georeferencing shapefile using ArcGIS for Desktop?

I have a shapefile with some polygons that I would like to superimpose to a raster image, but unfortunately they don't match perfectly due to the reference system the shp has been created with. So, I ...
11
votes
7answers
9k views

Creating shapefile from current dataframe extents in layout view of ArcMap?

Where is the ArcGIS 10 tool for creating a shapefile from current dataframe extents in layout view? Have looked around and the closet thing i can find is Toolbox's Grid/Strip Map Index tools under ...
11
votes
3answers
13k views

Counting points in shapefile within polygons of another shapefile using ArcGIS Desktop?

I'm creating a map with two shapefiles: A polygon of counties Points of cities I used the function Intersect to group the cities in each county. I'm trying to get the number of cities in each ...
11
votes
4answers
13k views

using shapely: translating between Polygons and MultiPolygons

[EDIT: the solution to this was simply to use OGR to read shapefiles. See geographika's example.] In an ESRI shapefile, there is no distinction between Polygons and MultiPolygons. Furthermore, there ...
11
votes
2answers
6k views

Cutting up a shapefile into smaller parts

I've downloaded the 450MB coastline shapefile from OpenStreetMap, I want to split it up in smaller parts. Is there a way to generate a shapefile with only the polygons contained in a smaller area? ...
11
votes
1answer
9k views

Python can't read shapefile

I am trying to open a shapefile with Jupyter notebook, but I can't get it to open. The shapefile is located in the same folder as my workbook, and Python can't identify it even if I use the full path. ...
11
votes
3answers
2k views

Which data format typically displays fastest in ArcMap?

My organization is working on an application running on ArcGIS Engine. Previous versions of the application used primarily Shapefiles for displaying roads, parcels, buildings, etc. Since I was ...
11
votes
2answers
47k 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 ...
11
votes
1answer
15k views

Importing shapefiles to SQL Server [closed]

I often use the brilliant SQL Server 2008 Spatial Tools to import shapefiles into SQL Server 2008. This works absolutely fine but it leaves me wondering, how do Microsoft expect end users of SQL ...
11
votes
3answers
7k views

Divide a complex shapefile into a grid

I have a decently detailed shapefile with polygon/multipolygon features (the file is about 500mb). It's actually a shapefile of the entire world, with the features representing coastlines. I need to ...
11
votes
3answers
7k views

Create Shapefile with auto increment primary key in QGIS

Is there a way to create an auto increment primary key column when creating a new Shapefile in QGIS?
11
votes
1answer
13k views

How can I use fortify() to create a filtered R data frame from a shapefile?

I am in the process of building a ggplot choropleth map of population in administrative areas in Wales. I have downloaded the Boundary-Line data from the Ordnance Survey and extracted what seems to be ...
11
votes
1answer
2k views

Conflate (merge) private shapefile data with OSM data

Background Downloaded Alberta OSM data from Geofabrik and have it running on a private Linux server using PostgreSQL 9.1, PostGIS 2.0, Mapnik 2.1.0, osm2pgsql, Apache 2, mod_tile, renderd, and ...
11
votes
1answer
841 views

Batch load multiple shapefiles to Postgis

According to the shp2pgsql help, the options drop, append, create and prepare are mutually exclusive. So, if I want to create a table from a shape and then append multiple other shapefiles, I do ...
10
votes
7answers
48k views

Seeking Free Shapefile of European Countries?

I do not seem to be able to find a free shapefile of the European countries. This is the kind of map I am looking to populate with my own data using ESRI ArcGIS: The Eurostat website only seems to ...
10
votes
6answers
8k views

How to add a projection to a Shapefile using open-source tools?

I have been given some shapefiles WITHOUT a projection. So I need to add the projection in order to display it on google map. I found the projection information I need at http://spatialreference.org/...
10
votes
3answers
20k views

Creating shapefile from lat/long values using ArcPy? [closed]

How can I create a shapefile using Python in ArcGIS 10? I have lat & long. From this I need Python code which will create a shapefile in ArcGIS Desktop 10.
10
votes
5answers
882 views

Database versus Files for Solo Developer

I'm just getting started in GIS and am interested in using it to create maps of mountain biking trails in my area and nearby. I've been learning QGIS and have made enough progress to generate a decent ...
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.....
10
votes
2answers
13k views

How to access Shapefile metadata using OGR?

I'm trying to use ogrinfo to get some details on a shapefile I downloaded. Currently, the only way I know how to do this is to load it into QGIS and manually click around to find any information on ...
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,...
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 ...
10
votes
3answers
3k views

Polygon shapefile with null values?

Does anyone know where I can find a sample shapefile that has null entries in it (preferably a polygon shapefile)? I'm not sure how to create one with null entries.
10
votes
2answers
14k views

Making shapefile from Pandas dataframe?

I´d like to construct a shapefile from a Pandas Data Frame using the lon & lat rows. I have got a csv file and I process it with pandas to make a data frame which is easier to handle Is it ...
10
votes
2answers
7k views

Point (of a linestring) within Polygon using ogr and Python

I'm currently working on a project in which I need to build a topological network out of the geometry features I find in shapefiles. So far using Ben Reilly's open source project I've managed to ...
10
votes
2answers
602 views

Retrieving size of shapefile in ArcPy?

Is it possible to retrieve the size of a shapefile using python and arcpy? If so, how?
10
votes
1answer
932 views

Automatically aggregate German ZIP codes by the first two digits in a shapefile

I have a shapefile which contains all German Zip-Codes in a a five-digit format (e.g. 80637). For what I intend to do, this is way to much detail. I would like to aggregate all Zip-Code areas by the ...
10
votes
2answers
17k 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 ...
10
votes
4answers
6k views

Renaming Shapefiles in QGIS?

I have a huge list of layers in a project that are named in a foreign language. I want to translate and add the English title to the name. When I right click on a layer and choose Properties -> ...
10
votes
4answers
35k views

Reading shapefile using C#? [closed]

I am new to ArcGIS and trying a few things.. I'm trying to read shapefile (which is supplied as an input) using C# and I want to generate a PDF file which contains underlying metadata information (...
10
votes
5answers
3k views

Looking for USDA plant hardiness zone shapefile

Given that this is a USDA resource I really thought that it would be available online somewhere, but for the life of me I cannot find a shapefile for the USDA plant hardiness zones anywhere. Does ...
10
votes
1answer
1k views

Identify shape of the polygons: elongation, roundness, etc

I am generalizing geological map. In the initial step I am dealing with small polygons which should be either deleted, enlarged, aggregated and etc. Before applying operations mentioned above I ...