All Questions
5,801 questions
124
votes
8
answers
370k
views
Calculating polygon areas in shapefile using QGIS
How do I calculate areas of an area shapefile in square meters (m²) or in acres (ha)?
I didn't find that functionality in the Vector Tools.
116
votes
5
answers
302k
views
Merging multiple vector layers to one layer using QGIS
I've imported several shapefiles which where exported from a Mapinfo .tab. Several .tab-files are imported resulting in 20+ layers.
Afterwards I want to export it to GeoJSON; but I'm reluctant to ...
115
votes
23
answers
144k
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 and vice versa?
108
votes
16
answers
76k
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?
96
votes
5
answers
157k
views
Renaming attributes/fields in shapefile attribute table using QGIS
I would like to rename some fields in my attribute table:
Like rename "XRF_N3"in something else. It seems quite a easy issue but I don't find any information about how can I do that.
75
votes
6
answers
286k
views
Opening shapefile in R?
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 ...
70
votes
7
answers
4k
views
Are there any attempts to replace the shapefile? [closed]
Recently I've been spending a lot of time converting perfectly good field names like "Percent of citizens age 25 and over with a bachelor's degree or higher" into things like "edbchogtr" to meet the ...
61
votes
5
answers
48k
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 ...
58
votes
6
answers
58k
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 ...
57
votes
3
answers
54k
views
How can I get a shapefile from a postgis query?
My data is in a PostGIS database. I would like to generate a shapefile from a query. How can I do that?
57
votes
5
answers
75k
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' - ...
54
votes
2
answers
96k
views
Understanding difference between Polygon and Multipolygon for shapefiles in QGIS?
Creating Scratch layer gives me a choice between Polygon and Multipolygon, so I started wondering how should I make use of them.
Reading a new book "Mastering QGIS" (through this answer by Joseph to ...
53
votes
3
answers
76k
views
Reprojecting vector layer in QGIS
I have a series of layers of lines (shapefiles) in My Project. The CRS of some are different and to merge them they all must have same CRS.
When I use Processing > Toolbox > Qgis_algorithims >...
50
votes
4
answers
65k
views
Joining non-spatial CSV file to spatial data (shapefile) using QGIS
I have a CSV file which has postcode data in a field, but it is non-spatial e.g. no Easting and Northing.
I have a shapefile with postcode in a field and some additional data.
I want to join the ...
48
votes
3
answers
61k
views
Adding shapefiles to PostGIS database
I was able to create a Postgresql database and then I executed,
createlang plpgsql geospecies
psql -d geospecies -f postgis.sql
psql -d geospecies -f spatial_ref_sys.sql
So now can I directly import ...
43
votes
7
answers
39k
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 ...
43
votes
3
answers
29k
views
Is it possible to look at the contents of Shapefile using Python without an ArcMap license?
I wondered if it is possible to look at the contents of a shapefile using Python without having and ArcMap license. The situation is that you can create shapefiles from many different applications, ...
40
votes
15
answers
121k
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 ...
39
votes
5
answers
80k
views
Writing 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 ...
38
votes
4
answers
31k
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:
...
38
votes
10
answers
78k
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 ...
38
votes
10
answers
36k
views
Open Source Tool capable of reading Esri File Geodatabase (.gdb)?
I have an ESRI File Geodatabase (.gdb) file that I would like to convert to shapefile (or any other non-proprietary format). Are there any Open Source tools to do so?
37
votes
6
answers
59k
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 '...
36
votes
5
answers
10k
views
Advantages of using spatialite over shapefile? [closed]
I found spatialite more useful than shapefiles as it does not have the limitations of shapefile and it is also portable. Many people here use shapefiles to exchange data and even the experts do not ...
35
votes
6
answers
60k
views
Free tool to convert ArcGIS layer package (*.lpk) to shapefile (*.shp)?
I have received a *.lpk file from Esri's ArcGIS platform that I would like to convert to a shapefile.
How can I do this, using only free software?
34
votes
5
answers
13k
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 ...
34
votes
6
answers
29k
views
GeoJSON too bulky
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 ...
34
votes
3
answers
20k
views
How to easily edit attribute data using Regular Expressions?
I am writing a tutorial for MSc students that uses QGIS.
One of the tasks requires the attribute data to be modified
(see pdf draft of tutorial here if interested ).
The question is how to get them ...
33
votes
12
answers
63k
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?
32
votes
8
answers
29k
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 ...
32
votes
3
answers
43k
views
How to encode shapefiles from LATIN1 to UTF-8?
Is there a way to encode shapefiles from LATIN1 to UTF-8?
32
votes
6
answers
2k
views
"Oddities" in the Shapefile technical specification
I've been writing a shapefile parsing library, and have encountered a couple of design decisions in the specification that I don't immediately understand. I'm hoping there's a wizened old ESRI ...
31
votes
8
answers
24k
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 ...
30
votes
6
answers
35k
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 ...
30
votes
2
answers
7k
views
Using OGR and Shapely more efficiently? [closed]
I'm looking for some suggestions about how to make my python code more efficient. Normally efficiency doesn't matter for me but I am now working with a text file of US locations with over 1.5 million ...
29
votes
3
answers
106k
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 ...
29
votes
7
answers
15k
views
How can I update ogr2ogr to include the PostgreSQL driver?
I'm trying to use ogr2ogr to upload a shapefile to a remote PostGres installation. When I ran this command:
celenius:~ celenius$ ogr2ogr -f PostgreSQL PG:"host=255.34.00.00 user=postgres dbname=mydb ...
29
votes
5
answers
36k
views
Converting image of map into vector format [closed]
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 ...
29
votes
3
answers
23k
views
Selecting feature types when using ogr2ogr to convert to shapefile?
Shapefiles can only have one geometry type, but many other formats (kml, geojson) can have multiple types.
When converting to shapefiles, is it possible to to tell ogr2ogr to create multiple ...
28
votes
5
answers
58k
views
Converting shapefiles to GeoJSON
I'm trying to convert shapefiles from the State of Texas Senate Districts website into a GeoJSON file for use with Google Maps API.
I'm using QGIS to facilitate but I can't get the projection/...
27
votes
2
answers
65k
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)...
27
votes
9
answers
20k
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 ...
27
votes
4
answers
38k
views
What is the difference between Coverage, Shapefiles and Geodatabases in ArcGIS?
I was wondering about the difference in spatial data storage methodology used by Coverages, Shapefiles and Geodatabases in ArcGIS. Coverage was the initial format, followed by Shape Files and now ...
27
votes
1
answer
20k
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 ...
27
votes
6
answers
36k
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 ...
27
votes
2
answers
30k
views
Converting from Geography to Geometry data type in PostGIS?
I have a shapefile that has geography types.
Can I convert it with a tool like shp2pgsql or is there a postgis function to do that?
27
votes
4
answers
14k
views
How do you determine a shapefile's charset?
Is there a way to determine the charset used for a given shapefile?
27
votes
5
answers
33k
views
Adding 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 ...
26
votes
3
answers
35k
views
Order of polygon vertices in general GIS: clockwise or counterclockwise [closed]
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 ...
26
votes
1
answer
25k
views
Merging adjacent polygons in shapefile that has been split at tile boundaries?
I'm currently using building data from the Ordnance Survey Vectormap District and I've noticed that a lot of building polygons are split in 2 because of the way the OS split up the shapefile.
This is ...