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
13
votes
2answers
19k 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. ...
13
votes
1answer
28k views

Resizing shapefile features proportionally in QGIS

In QGIS (1.8.0-Lisboa) on Windows (OSGeo4W Install), how 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.6) plugin or ...
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
1answer
21k 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 ...
13
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 ...
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
676 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
5answers
5k 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?
12
votes
4answers
51k views

How to export a dataset with “SpatialPolygonsDataFrame” as a shapefile

How to export spatial datasets in R, such as tornados dataset in GISTools package, as a shapefile with the exact same spatial reference and the exact values? library(GISTools) data(tornados) ...
12
votes
8answers
60k 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 ...
12
votes
7answers
32k 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 ...
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
3answers
18k 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
2answers
15k 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 ...
12
votes
2answers
11k 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
40k 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 (...
12
votes
4answers
15k 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 ...
12
votes
4answers
8k 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 -> ...
12
votes
2answers
25k 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
16k 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
2answers
3k 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
1answer
1k views

How to convert a line shapefile into a CSV with nodes and links?

Is there a way to convert a linear shapefile into a CSV file of the following format: Node_1, Node_2, attribute_1, ...., attribute_x 1 2 "hello" 567845.334 I have ...
12
votes
3answers
8k views

Extract data from NetCDF using a shapefile polygon in Python [duplicate]

I need to subset data from a NetCDF using a specific shapefile. The data are sea surface temperature and ocean color at 1/4 degree resolution. I have 4 polygons describing the US. Northeast ...
11
votes
3answers
17k views

Getting shapefile of river from OpenStreetMap?

I do not want to download the 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 ...
11
votes
3answers
8k views

Explaining difference between shx and shp files of shapefile?

I am searching for a more in depth explanation of the differences in shp and shx files to little avail. I mean beyond the 'shp contain geometry - shx contains an index of the geometry'. The reason I ...
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
5answers
16k 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
2answers
2k 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
1answer
24k views

How to import using shp2pgsql?

I want to import shapefile into PostGIS. There is one database postgres in it but no table added yet. I am using this command: shp2pgsql -I -s 4326 districts.shp districts | psql -d postgres -U ...
11
votes
3answers
27k 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
1answer
37k 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
8answers
10k 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
20k 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 ...
11
votes
8answers
15k views

Seeking Free Opensource Shapefile Writer for .NET

I am looking for a well documented, Open Source 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. I have ...
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
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
2answers
56k 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
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
1answer
2k views

Split up shapefile into little shapefiles

I have a very large shapefile (all the roads in RI). I need to split it up into chunks so that I can process the file with multiple worker threads in Python. So far I have created a grid in QGIS that ...
11
votes
1answer
16k 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
1answer
5k views

Convert shapefile from projected coordinates using Python

Newbie here struggling with GIS. I am trying to map out wards for the city of Milwuakee using shapefiles found on their county website county website. I am following the thread here with some success. ...
11
votes
3answers
4k views

Adding a GIS feature to existing database entry with QGIS

I've built a database with postgreSQL with tables, which include geometry columns. When I add some data to my non-geometry columns, I can see them in QGIS when I connect to my database using postgis. ...
11
votes
3answers
8k 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
8k 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
4k views

Convert longitude/latitude to pixels on the map

I have a map from here. I want to be able to simply convert arbitrary lon/lat pair to pixels on the map (also the ability to do reverse conversion). The maps come with .tfw file and projection info, ...
11
votes
1answer
15k 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
1k 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
3answers
5k views

Best choice for building static maps: PostGIS, SpatiaLite or Shapefile?

I usually build static topographic maps, which are mostly printed. I'm often using OSM and rasterfiles (mainly different DEMs). The areas I'm mapping seldom exceeds 20.000 km². I'm using exclusively ...

1 2
3
4 5
91