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
10
votes
4answers
8k views

Postal areas for Germany?

Does anyone of you know how and where I can download postal area districts of Germany in shapefiles (download free of charge if possible).
10
votes
1answer
3k 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. ...
10
votes
9answers
10k views

From .shp to .kml to .shp Without Losing Attributes

I've converted a shapefile with attributes to a .kml for a client. The .kml and attributes were then edited within google earth. I received the updated .kml and now I need to get it back to .shp. ...
10
votes
5answers
7k views

update one shapefile attribute table with values from another dbf table

I try to explain here what I am trying to do: I have one shapefile and one independent dbf table with the same fields. In the dbf table all the fields are populated but in the shapefile attribute ...
10
votes
2answers
779 views

What's the batched Refactor Fields tool “field mapping” syntax in QGIS?

In QGIS, there is this nice tool "Refactor Fields" in the Processing Toolbox : Using it on a single layer is fairly straightforward. However, when you plan on using it in a batch mode, one can see ...
10
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 looked at ...
10
votes
2answers
5k views

How do dissolve polygons from shapefile using open source tools?

In my current project I'm visualizing data on a map representing some values for each administrative areas of a country. I'm given a shapefile of this country, which I'm converting to GeoJSON for use ...
10
votes
2answers
2k views

Which Windows GIS editors support the creation of 3D shapefiles besides ArcGIS with 3D Analyst?

I need to find and easy and affordable way to generate 3D linear shapefiles in Windows so one of our users can inspect our tool. We incorrectly assumed that he had 3D shapefile source data available ...
10
votes
2answers
3k views

Shapefile to SVG with ArcMap (while retaining country attributes)

Does anybody know how to export the Natural Earth 1:110m shapefile to SVG with ArcMap while retaining the country attributes? From SVG I'm gonna try to convert it again over to RaphaelJS to achieve ...
10
votes
2answers
357 views

Determine minimum number of polygons from shapefile to cover an area of interest

I have a large number shapefiles representing areas of interest for an analysis that will be conducted using various sources of satellite imagery (IKONOS, RapidEye, etc.). Unfortunately, the imagery ...
10
votes
2answers
6k views

Extract data from netcdf using a shapefile polygon in python

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 ...
10
votes
1answer
3k views

Polygon creation (Clockwise rotation or not) [duplicate]

According to "ESRI Shapefile Technical Description An ESRI White Paper—July 1998", Vertices for a single, ringed polygon are, therefore,always in clockwise order. Otherwise,"Dirty" polygons occur when ...
9
votes
7answers
59k views

Joining Excel table to shapefile in ArcMap?

I have a shapefile of lower layer super output areas (LSOA) for England and Wales and I have a spreadsheet of the indices of deprivation for each of the LSOA's in England. I want to join the ...
9
votes
1answer
20k 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 ...
9
votes
5answers
18k views

Adding file name to attribute field using Calculate Field?

Does anybody know how to add the shapefile name to a field in the file's attribute table? I've found a description: 'You have to use inline variable in CalculateField like %Name% in expresssion ...
9
votes
5answers
13k views

Converting shape Polyline-M to Polyline using ArcGIS Desktop?

I have some pretty old software that I am forced to use (no option). It's old enough that it doesn't recognize shapefiles of type Polyline-M, it only recognizes shapefiles of Polyline. I have a ...
9
votes
3answers
6k views

How to find the attributes of a shapefile from the command line?

I'm following Mike Bostock's tutorial "Let's Make A Map." He explains how to filter a shapefile using ogr2ogr based on the attributes of the features. I can open a shapefile in QGIS and look at the ...
9
votes
1answer
18k views

How to re-project shapefiles?

I wanted to re-project a QGIS project, but there is no such option. When searching for an answer I see ogr2ogr suggested for this task, by re-projecting each vector layer (shapefile in this example). ...
9
votes
2answers
4k views

Determining if shapefile and raster overlap in Python using OGR/GDAL? [closed]

I am building a script in python using OGR/GDAL. I have a set of shapefiles and a set of GeoTiff raster files. I would like to have my script ignore shapefiles if they do not intersect with the ...
9
votes
6answers
2k views

How to programmatically check if the number of shapes = number of table records?

I have a handful of approximately 1000 shapefiles that are corrupted (see attached error message). The shapefiles were generated from eCognition Developer 8. There is a script tool that seems to ...
9
votes
3answers
19k views

How to get all the lat/long coords that define a shapefile

I have a Shapefile with several shapes inside it. Using MapWindow I have been able to determine that the shape I need is the one with shapeId 19. As you can probably tell I have very little ...
9
votes
1answer
1k views

Run SQL queries against shapefile in QGIS?

Is there any way I can import a shapefile into QGIS, then run spatial SQL queries against it? I can obviously use ogr2ogr -sql to do this, but I have to import the output into QGIS each time to look ...
9
votes
5answers
6k views

GIS analysis to find duplicate geometries

I have a big shapefile that contains all the buildings and houses of the town that I work in (approx. 90,000 features). The data of the buildings/houses are saved by the town's surveying engineers and ...
9
votes
3answers
1k views

Voronoi Diagram on a given polygon using QGIS

I am trying to create a Voronoi Diagram on a specific polygon, but there is some issue when dealing with edges. Here is how I do it: Preparing the points for Voronoi and the polygon for the diagram ...
9
votes
1answer
10k views

Convert coordinates from readShapePoly in R to long-lat coordinates

I'm trying to find some centroids of a shapefile for Danish municipalities and afterwards find the driving time between them. I use R's readShapePoly function from maptools combined with the ...
9
votes
2answers
3k views

Is it possible to change the field length of a shapefile to over 254?

The maximum field length for a shapefile is 254 (https://en.wikipedia.org/wiki/Shapefile#Limitations) and because of this I'm having problems with the input attributes, which have a size greater than ...
9
votes
1answer
8k views

Dissolving shapefile but retain attribute fields using ArcGIS Desktop?

Is there any way to dissolve shapefile but keep attributes fields in the same time? This is how I want to retain fields: There are two fields I want to conserve in a shapefile. The first column is ...
9
votes
3answers
18k views

Using ArcMap, how may I convert a shapefile to use decimal degrees?

I have a shapefile that currently uses meters as the measure for its coordinate system, but the map framework I wish to use expects decimal degrees. I'd like to reproject my shapefile to use decimal ...
9
votes
2answers
10k views

ggmap: plot polygon from shapefile

Using ggmap, I want to include municipality borders (polygon) from a shapefile on a map containing some location points. This script does everything except plotting the polygon: library(rgdal) ...
9
votes
2answers
6k views

How to convert GDB data to shapefiles without ArcGIS?

We've got some data (supposedly it's a simple collection of points--or at least that is all we need to extract) from a 3rd party in a GDB folder (I don't know how to tell what version) but we don't ...
9
votes
3answers
772 views

Read only part of an ESRI shapefile into R

I have a very large ESRI shapefile (>8000 polygons, .shp file is >32MB), which I want to read into R on Windows 7. I am familiar with rgdal and readOGR(). However, with this size of shapefile, ...
9
votes
4answers
1k views

What are some alternative sources for USGS data?

I've been using the USGS National Map viewer (http://viewer.nationalmap.gov/viewer/) for getting data for QGIS, but the download system is driving me insane. I enter my email address and [sometimes] ...
9
votes
1answer
2k 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, ...
9
votes
5answers
5k views

How to get an ocean shapefile from a very detailed land area shapefile?

I am looking for a possibility to "invert" a shapefile. What I want to do is to convert a shapefile with the continents and islands into a shapefile that has water polygons. The existing ocean ...
9
votes
3answers
14k views

Converting shapefile to SVG keeping internal data?

I am very new to GIS. I found a tutorial on how to make a choropleth using Python tools. I want to follow it but use my own data and map. However the tutorial uses a US map SVG file and I need to use ...
9
votes
3answers
539 views

Identify corrupt shapefiles or rasters via Python or ArcObjects

I'm interested in a way to identify rasters (e.g., ESRI GRID format) or shapefiles that are corrupt that would prevent them from being used in an analysis tool. I have a large number in structured ...
9
votes
1answer
2k views

How to export multiple Shapefiles to one KML file in QGIS?

As the title says, is it possible to export multiple Shapefiles to one single KML in QGIS (Similar to "Map to KML" in ArcMAP)?
8
votes
3answers
4k 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 ...
8
votes
4answers
2k views

Fastest spatial storage format?

I am wondering what storage method will result in the fastest reading of the map vectors for rendering. SHP? PostGres? SQLite? (They do not change often and I do not need spatial functions for these ...
8
votes
2answers
31k 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 (...
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 ...
8
votes
3answers
38k 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) ...
8
votes
3answers
4k 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 ...
8
votes
4answers
3k views

How to publish shapefiles to web with no programming required?

I am new to GIS web development. I do not have any programming background and I want all the maps that I design in GIS (shapefiles, using ArcGIS Desktop 9.3) to be published on the web. Please ...
8
votes
2answers
4k views

Performance of Shapefile and PostGIS with GeoServer?

I'm going to build a web application, which will render around ten maps using GeoServer. I will be also changing the attribute data in the application for some layers. What is the recommended choice ...
8
votes
8answers
36k views

Exporting to DXF file from QGIS?

Is it possible to export labels based on Shapefile attributes into a DXF file? I use QGIS 1.7.4. I've been reading a CSV file and view it as a Shape Layer. With the help of attributes from the File ...
8
votes
1answer
17k views

Calculate area for each polygon in R

I am working with a shapefile that has many polygons. How do I add one more field named "area_sqkm" and calculate area for each polygon in the shapefile?
8
votes
3answers
25k views

Connecting points by lines using QGIS?

I have a .shp file, where I want to connect all points (approx. 100) by lines. I have a data field with the order (i.e. 1, 2, 3, ...). I have tried PointConnector and Points2One, maybe I am using ...
8
votes
3answers
53k views

Converting a .jpg map into a shapefile

I have a .jpg map of a set of U.S. counties that were affected by a tornado. The map shades where the tornado passed through, resulting in some counties only partially experiencing the tornado. I ...
8
votes
1answer
21k 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....