Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
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 ...
jgpallero's user avatar
  • 759
23 votes
6 answers
83k views

Converting 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 ...
Rikk's user avatar
  • 231
13 votes
1 answer
12k 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. ...
Oliver Burdekin's user avatar
12 votes
3 answers
31k 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 ...
user30783's user avatar
  • 131
10 votes
5 answers
24k views

How to display special German characters "ÄÜÖß" 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 to display them correctly. If I import the shape as ...
desputin's user avatar
  • 2,331
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 ...
Raffael's user avatar
  • 550
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 ...
djq's user avatar
  • 16.3k
22 votes
4 answers
58k views

Loading .dbf file into QGIS

I want to use QGIS to extract lat/lng data from the vertices of polygons. There are about 400 polygons, each with maybe 200 vertices. I am having trouble with step one, getting the data into QGIS. The ...
tomb's user avatar
  • 361
21 votes
1 answer
29k 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=...
user1919's user avatar
  • 2,694
11 votes
5 answers
27k 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 ...
Nadiia's user avatar
  • 335
8 votes
1 answer
22k 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 ...
MfM's user avatar
  • 81
8 votes
3 answers
26k 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 ...
Sheila's user avatar
  • 237
7 votes
1 answer
24k 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. ...
gsa's user avatar
  • 1,246
7 votes
3 answers
1k views

QGIS Vector layer stretched across entire map

I've imported a vector layer with extents between two hemispheres near the antimeridian. Unfortunately, instead of having the geometry split in two, where one part lies east of the antimeridian, and ...
Geographos's user avatar
  • 3,801
5 votes
4 answers
10k 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. ...
Joe's user avatar
  • 151
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 ...
slava's user avatar
  • 751
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 ...
Devils Dream's user avatar
  • 3,217
18 votes
3 answers
8k views

Join 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 "...
Lincoln Mullen's user avatar
17 votes
3 answers
14k views

Inverting Polygons using QGIS?

I have a Shapefile with Polygon features representing the world's land areas (continents, islands). Is it possible to invert these, and get a geometry that represents the world's oceans and seas? ...
kontextify's user avatar
12 votes
1 answer
2k 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 ...
John Powell's user avatar
  • 13.7k
12 votes
1 answer
30k 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 ...
sandeep's user avatar
  • 251
12 votes
2 answers
22k views

Is there a way to export the style, along with a shapefile, to a kml in QGIS?

I see there were plugins in the past that may have done this such as qgis2kml and qgis2google, but they no longer exist.
Chris Paul Geo's user avatar
10 votes
9 answers
72k 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 ...
Alexander's user avatar
  • 117
10 votes
3 answers
3k views

Can ogr2ogr "reverse clip" (or "clip out" or "erase" or "difference") one shapefile from another?

Is there a means in ogr2ogr to "clip out" one shapefile from another? I know ogr2ogr -clipsrc B.shp out.shp A.shp will remove any part of A.shp that is NOT in B.shp. Is there an ogr2ogr command to ...
Tom West's user avatar
  • 201
10 votes
3 answers
22k 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 ...
kogia's user avatar
  • 101
9 votes
7 answers
64k 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 ...
dpc1989's user avatar
  • 265
9 votes
1 answer
1k views

How does shapefile 2GB limit equate to 70 million points?

Reading Geoprocessing considerations for shapefile output by Esri, it says that the 2GB limit translates roughly to 70 million Points. When looking at the ESRI Shapefile Technical Description, the ...
pstatix's user avatar
  • 426
7 votes
2 answers
28k views

Convert shapely polygon coordinates

I am trying to work with a shapefile using shapely, fiona and python. The original coordinate system is in latitude and longitude that I am trying to convert to state plane system. So I want an ...
statBeginner's user avatar
6 votes
1 answer
2k 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 ...
anamée's user avatar
  • 63
6 votes
2 answers
2k views

Transform tif file to shapefile to get outer contour of area

I have the following .tif file of an area: I want to make a shapefile out of the contour of the entire area, like the red line in the image below. Is there a way to do this with QGIS? I've tried ...
sander's user avatar
  • 171
5 votes
1 answer
2k views

Automating plan report generation using ArcGIS Desktop? [closed]

i have shapefile that contains a lot of parcels "parcel has like fields (n° parcelle,proprietaire, cin) see picture : and i want for all parcels to generate this plan : take a parcel and generate ...
Mounaim's user avatar
  • 645
4 votes
1 answer
3k views

Clipping polygon precisely to raster (extent) using GDAL?

I need to clip a vector layer to the extent of a raster. It has to be very precise that's why I would not want to draw a polygon myself (and clip the two polygons). There seem to be some ways to clip ...
Li12's user avatar
  • 317
2 votes
1 answer
1k views

Shapefile with no map and no attributes in QGIS

For QGIS 3.14 I was following the tutorials, and I got stuck in adding my very first new vector layer. Every time I tried to do the option new Vector Layer, no map appears and the the attribute table ...
oric29's user avatar
  • 23
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?
rudivonstaden's user avatar
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 ...
Sam007's user avatar
  • 4,415
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 ...
Abhishek Potnis's user avatar
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 ...
Robin Hawkes's user avatar
  • 1,035
23 votes
7 answers
89k views

Plot shapefile with matplotlib

I am trying to read a shapefile and plot it using matplotlib. Here is the code: import matplotlib.pyplot as plt import shapefile shpFilePath = "D:\test.shp" listx=[] listy=[] test = shapefile....
statBeginner's user avatar
22 votes
2 answers
16k views

Instantiating spatial polygon without using a shapefile in R

So, the usual way we read a shapefile in R is via the maptools package, like this: sfdata <- readShapeSpatial("/path/to/my/shapefile.shp", proj4string=CRS("+proj=longlat")) However, I have a use ...
Calvin Cheng's user avatar
22 votes
4 answers
32k views

Exporting shapefile to PostGIS database in QGIS [closed]

How do I export a vector shapefile to PostGIS database? I am asking what format I have to export it.
Arun's user avatar
  • 1,462
21 votes
7 answers
18k views

How to improve rendering performance of a very large shapefile?

I have a polygon shapefile that has a 100MB .dbf, and 500MB .shp file component. The reason it is so large, is that it is classified as a landbase for a whole district. Everytime I view the file in ...
youzer's user avatar
  • 574
17 votes
2 answers
9k views

Is there a standard for the specification of .prj files?

We use shape files for data exchange. I've looked at the .prj files: different programs produce different prj files. Is there a standard how the parameters must be specified in a prj file? AFAIK the ...
Jens's user avatar
  • 6,239
16 votes
7 answers
49k views

Exporting attributes in KML file using QGIS

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 ...
Francesco Bria's user avatar
15 votes
5 answers
31k views

Identify polygon containing point with R sf package

I would like to be able to map geocoded coordinates to a region on a .shp file in R using the sf package. I can load up the map and plot it but I am struggling with the code to return the region for ...
jmc's user avatar
  • 151
12 votes
2 answers
3k views

Are mixed geometry types allowed in shapefiles?

Does the shapefile support mixed geometry types (ie. point and polygon all in the same file)?
Nadir's user avatar
  • 177
12 votes
3 answers
51k 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 ...
Magnus's user avatar
  • 121
11 votes
1 answer
28k views

Exploding multipart polygons within shapefile in QGIS?

I've got a shapefile with polygons, some of which are multipart polygons. I need to create individual polygons out of the multipart polygons. Is there a tool or plugin that can do this in QGIS 1.8?...
user12711's user avatar
  • 1,620
10 votes
2 answers
11k views

Creating missing .shx file?

I am using ArcGIS Desktop to view one shapefile. Only a select number of features are being displayed. The same number are showing in the attribute table even though the database file (.dbf) has a ...
Ezra Rynjah's user avatar
10 votes
1 answer
5k 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 ...
Jermain Marthin's user avatar
10 votes
1 answer
3k views

Cleaning large Shapefile using v.clean in order to dissolve features?

I'm having real problems cleaning up and reducing the size of a Shapefile which is published by the UK's Environment Agency. It shows the extents of the LiDAR open data they publish: each polygon is ...
user2950747's user avatar

1
2
3 4 5
18