2
votes
1answer
48 views

Clip raster by shapefile in parts

Please help write .sh script command to clip raster by polygonal shapefile. Shapefile have name field with unique name of polygon feature. On the output must be rasters with name of polygons in ...
2
votes
3answers
64 views

How to find all distinct values from a single column of an attribute table with GDAL (Python)?

I am working with GDAL and modify ESRI shapefiles with it. I am searching a possibility how to find all distince values from a single column of an attribute table with GDAL (Python). In SQL it would ...
2
votes
1answer
38 views

QGIS show gdal_polygonized file in EPSG:54004 instead of EPSG:3857

I am polygonizing a TIFF with the gdal_polygonize.py and the resulting Shape is shown in QGIS in the wrong projection - EPSG:54004 instead of EPSG:3857. I have a TIFF in EPSG:3857 and polygonize it ...
-1
votes
2answers
54 views

Converting *.kml file to *.lyr file so Google Earth can create spatial data to use in ArcGIS for Desktop? [duplicate]

Want to convert the .kml file into .shp file so that I can create new the point, line and polygons data to work in ArcGIS. Actually I want to use Google Earth to make data for ArcGIS.
3
votes
1answer
94 views

Join CSV using gdal/ogr

I'm trying to use gdal/ogr to join a shapefile called myshape.shp with a csv called mycsv.csv. The join field in the shape in joinshp and the join field in the csv is joincsv. I've found this command ...
0
votes
1answer
29 views

GDAL: Update spreadsheet from polygons in a shapefile

I am a beginner with GIS data, and have been looking for an answer but have not yet found it. I have a spreadsheet with lat/long points. I also have a shapefile with several numbered polygons over a ...
0
votes
1answer
32 views

Adding a Vertex To Exisiting Feature(linear) Using OGR Python

I am working on a project that involves finding the intersection of linears in a shapefile, if that vertex(the found intersection) doesn't already exist for each(or one) of the features, then that ...
0
votes
1answer
28 views

gdal_rasterize : getting area not in or touching polygon (options -at and -i)

I would like to capture the area that is not in a polygon (option -i) and that doesn't touch that polygon. gdal_rasterize -at will return the polygon + edges, but gdal_rasterize -at -i will not ...
0
votes
0answers
54 views

How can you calculate the union/merge two polygons in ogr2ogr?

I want to calculate the union/merge two overlapping polygons using ogr2ogr (as I have 300+ to do). I want the output to be the same as you would get if you used the 'Merge shapefiles to one' command ...
0
votes
1answer
107 views

Creating records in output shapefile using Python

I have a list (output from a previous loop) containing attributes from an input shapefile. What I am stuck with is inputting those attributes to a new shapefile. I have plotted the point data using ...
0
votes
0answers
34 views

Copy queried attributes of a shapefile to a new shapefile [duplicate]

I have a polyline-shapefile, which I have successfully read into python using pyshp module. My problem is to save the 2nd node of every line feature into a separate, single point file. I have ...
0
votes
0answers
31 views

How do I convert a VMAP to a shapefile using GDAL?

This is my first time trying to convert a VMAP to a shapefile and the examples online aren't as straightforward to me. Any guidance is appreciated.
4
votes
1answer
234 views

How to find the distance to the nearest coastline from a land-based latitude/longitude point?

I'm completely new to GIS and unsure what I need to solve this problem: In the image above turquoise is actually land. Sea is white. I tried using the NASA Distance to the Nearest Coast data dump ...
0
votes
0answers
113 views

How to import SRTM data for the whole planet into TileMill

I need to get SRTM elevation data for the whole planet into TileMill. I already walked through the instructions on Steve Bennett's blog and it worked fine for small areas. The problem is now that for ...
2
votes
0answers
95 views

Convert a classification image to aggregated polygon in shapefile using gdal/python

My goal is convert a 2D numpy array to shapefile. The matrix results from a classification, so the numbers have a meaning. I solved my problem, but the solution is somehow involuted and complicated. ...
1
vote
2answers
188 views

Problem when converting sosi to shapefile with ogr2ogr on Linux

I am trying to convert a SOSI file (Norwegian geodata format) to a shapefile. I have set up gdal, but apparantly there is a lot of things that I dont have support for. When I do a ./configure, this is ...
0
votes
0answers
60 views

need help creating layer with geom type wkbGeometryCollection with gdal python

I am having trouble creating a layer with geom type as geometry collection. Thus I am unable to output to a shapefile. I have attached code below. dstLayer is null. This does not happen if geom type ...
3
votes
2answers
278 views

Error exporting data from Oracle to shp using ogr2ogr

I have an oracle table which I would like to query/make a selection. I would then like to export the selection to a shp file. I'm using gdal and ogr2ogr. Following the guidelines here and here I ...
0
votes
0answers
85 views

Convert Shp to KML error org2org Error4

I am attempting to convert Shp file to Kml using command line org2org application. I have used this in the past to convert more simple shp files and was sucessful. However I get an error message when ...
4
votes
2answers
168 views

Converting shapefile to raster: Character attributes

I've got a shapefile that I would like to convert into a raster, but the trick is that the attribute I want a raster version of is character data. I'm familiar with geoprocessing using GDAL (in the ...
4
votes
2answers
484 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 ...
2
votes
1answer
144 views

Axis of rendered shape files not showing numbers that are latitude and longitude

I am using rgdal to render some shape file. The first is a set of building zones from NYC Open Data. The second is the NYC coast line from OSM. The Zone files seems to generally render an X axis ...
1
vote
1answer
101 views

Polygons not appearing when creating shapefile based on criteria using GDAL and Python (area calculated properly)

I am looping over the features of a shapefile containing multiple polygons. If certain criteria are met, I want to save the current feature in a new shapefile. I am doing this using GDAL 1.10.0 with ...
3
votes
1answer
236 views

Controlling output linewidth linestyle using gdal_rasterize shapefile shp to Geotiff

I have successfully combined a shapefile (.shp) and a GeoTiff using gdal_rasterize. The shapefile displays as one pixel wide in the GeoTiff, but I need it to be wider and more visible, say, 5 pixels ...
2
votes
2answers
161 views

How to convert Point coordinates into CSV format?

The GDAL documentation describes how to convert a ShapeFile into CSV data. The layer create options (-lco parameter) allows to prepend the coordinates of Point features to the actual attributes ...
1
vote
0answers
409 views

Importing Census TIGER Shape Files to SQL Server 2012?

I've been doing my research on how to import shape files into Microsoft SQL Server 2012. and am still unable to figure out how to do it after hours of playing around with it. I'll document what I've ...
0
votes
1answer
174 views

Why do Shapefiles and GeoJSON behave differently in GDAL Python?

I have a test.shp. I loop over the file, buffer the features, and write the buffers to a new file. I tested writing the buffers to a Shapefile and to a GeoJSON. If I try to use the new buffer layer ...
1
vote
1answer
105 views

Load Raster Values into Shapefile [duplicate]

I have a shapefile containing many points. Some of these points fall within an area for which I have raster data. I would like to load the values of the raster which underlie each point into the ...
1
vote
3answers
314 views

KML to Shapefile using GDAL (LIBKML) - MultiGeometry data not transforming

I am trying to convert a KML file to Shapefile using GDAL (ogr2ogr). Regular KML files convert fine but KML files containing MultiGeometry features (eg: Geometry containing both Point and Polygon) do ...
0
votes
3answers
235 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 ...
0
votes
0answers
147 views

why readOGR() is not reading projection information from .spj - r

0 down vote favorite I successfully import a polygon shapefile with readOGR, however the information in the .prj file is not being imported. test class : SpatialPolygonsDataFrame nfeatures : 19407 ...
1
vote
2answers
709 views

Python - GDAL : Polygon to point shape file

I want to read all the points in a polygon shape-file and use their coordinates to make a new point shape file. then find the min and max of the X coordinates. So here is the code I wrote for the ...
1
vote
0answers
87 views

How to join attributes by location with command line

I would like to joint the attributes of 2 shapefiles by location but with a command line (linux). This feature is easy in QGIS but it is VERY slow. Is there a way of doing this with ogr or pyqgis ? ...
-3
votes
1answer
77 views

How can I use ogrinfo to reach information anout a .shp?

How can I use ogrinfo? where should I write it? In the visual studio's command prompt or somewhere else? Can you make some examples? when I use ogrinfo in the windows or visual studio's command ...
1
vote
0answers
77 views

Contours generated from merged TIFs huge - much bigger than individually

I'm generating contours from four 5x5 degree SRTM DEMs in southeastern Australia. I'm using gdalwarp to reproject the DEM, then gdal_contour to generate contours. First, I generated contours for each ...
0
votes
0answers
191 views

How to read vector datasets using GDAL library

Up to now, I have used GDAL in order to read raster information and geotiffs and show them with the help of OpenGL. Now I have a vector dataset, and by that, I mean I have the files with types: DBF ...
2
votes
2answers
551 views

Python GDAL/OGR: retrieved feature is NoneType

I'm doing some scripts in Python to deal with shapefiles, and I have an issue I don't understand. I'm looping over a shapefile, and I want to retrieve the geometry of each feature, but very often I ...
2
votes
2answers
330 views

Driver error when converting MapInfo file to Shapefile with ogr2ogr

I am trying to convert a MapInfo file to an ESRI shapefile using GDAL's ogr2ogr command as described here, but I am getting the following error: FAILURE: Unable to open datasource `Iceland2pts.mif' ...
0
votes
1answer
165 views

Can't convert geometry from Dgn file to Shape file?

I am using below codes to try convert geometry from a Dgn file to Shape file. But, I can't exit the Feature reading loop. Are there anyone know why and how to fix it ? Please download the dgn file ...
1
vote
1answer
361 views

Python GDAL/OGR: WGS84 & meters units

I'm dealing with shapefiles projected in: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_84",6378137,298.257223563]], PRIMEM["Greenwich",0], ...
12
votes
1answer
641 views

How to rename field names in a shapefile from the commandline?

I need to rename the field names (attributes) in a shapefile. Is there an easy way to do this from the command line?
2
votes
1answer
265 views

OGR - Weird GeomType -2147483645 on polygon shapefile

I am trying to import a shapefile (multipolygon) in an app with ogr but I got an error about invalid geom type. If I inspect the data with ogr like this: datasource = ogr.Open("c:\\temp\\data.shp") ...
9
votes
2answers
5k 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?
4
votes
3answers
4k views

How can I get the proj4 string or EPSG code from a shapefile .prj file? [duplicate]

I have to work with a shapefile defined in an unusual projection, which my GIS software does not know about. How can I get the proj4 definition or the EPSG code for the projection?
1
vote
0answers
185 views

How to use GDAL to burn a selected value from one raster into another?

I think this should be a relatively simple process, but I'm not quite sure how to approach it. I have a shapefile containing 1000's of polygons. I also have 19 rasters. All of the polygons fall ...
4
votes
1answer
755 views

Can't export a polygon shapefile to MySQL using ogr2ogr?

I am having problems with ogr2ogr and keep getting different versions of the error: ERROR 1: MySQL error message: The used table type doesn't support SPATIAL indexes. Description: ALTER TABLE ...
2
votes
2answers
2k views

How do you open shapefiles with ogr2ogr

I'm following along the D3 tutorial, and on this line: ogr2ogr \ -f GeoJSON \ -where "adm0_a3 IN ('GBR', 'IRL')" \ subunits.json \ ne_10m_admin_0_map_subunits.shp run into the following ...
4
votes
2answers
336 views

How do I Capture GDAL projection and create matching output (OGR or GDAL) shape files?

Working in C++, using GDAL and OGR: Depending on what the user has supplied for image input, I need to output point (or other) shape files in the same projection as the input raster images. The ...
2
votes
1answer
189 views

Tiling Rasters based on an existing Polygon Shapefile (Vector Grid)

I have a tile index representing the tile scheme used to tile Lidar data. I want to tile imagery rasters using the same tiling scheme. I have not found anyway using open source tools to tile a ...
3
votes
4answers
3k views

How do I use ogr2ogr to convert a 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 ...