Tag Info

Hot answers tagged

6

OK so a second attempt to answer your question with a pure GDAL solution. Firstly, GDAL (Geospatial Data Abstraction Library) was originally just a library for working with raster geo-spatial data, while the separate OGR library was intended to work with vector data. However, the two libraries are now partially merged, and are generally downloaded and ...


5

I've had some luck reading from and writing to layers. Specifically, I have code that will read a shapefile layer containing polylines and output the geometry of each feature to text files (used as input for an old model). name = layer.name() provider = layer.dataProvider() feat = QgsFeature() # Now we can loop through all the defined features ...


3

According to the GDAL Proximity page: -distunits PIXEL/GEO: Indicate whether distances generated should be in pixel or georeferenced coordinates (default PIXEL). So you can specify the distances in pixels or in the unit of the coordinates you used to georeference the raster.


2

Your error says as.integer(putvals). The R rasterize function can't work on Strings. You have to transform your data first. Something like this may work, but i would assign different ranks (ala 1,2,3,4,..) to your data. However i still get a (different) error for which i don't have an explanation. Maybe the size of your raster is incorrect... ...


2

gdal_rasterize is not a python module, but an exe file. You can not call it that easy inside the python console. See this blogpost on how to wrap the operating system around it: http://geoinformaticstutorial.blogspot.de/2012/11/convert-shapefile-to-raster-with-gdal.html import os os.system('gdal_rasterize -a ICE_TYPE -where \"ICE_TYPE=\'Open Water\'\" ...


2

This is a kludge but it does work - haven't found a way to go directly from points to raster yet (but am hoping someone gives a solution here!). Starting with a point grid (random points in the Serengeti from the Vector|Research tools|Random points tool): Create a polygonal grid of the same extent and cell size as the raster you'd like to have (this from ...


1

Assuming you know how to create the hectare sized grid (using the Vector->Research tools->Vector grid) then you can import both the point shapefile and the grid polygons into SpatiaLite and with an aggregate query get the totals as an attribute column in each grid sqare. For example if you have an id column in the grid polygon layer, and a ...



Only top voted, non community-wiki answers of a minimum length are eligible