2

I have a raster : population density of Ivory Coast. I need to convert it to points, but I met several problems because of the size I think.

Here is what I tried :

1) GRASS GIS 7 command : r.to.vect => It works but takes several hours !

2) SAGA (2.1.2) : Raster values to points => It doesn't work (Couldn't load gdal_MrSID.dll -> but gdal_MrSID.dll is well installed in the SAGA package).

3) GDAL/ORG -> GDAL Conversion -> gdal2xyz -> It works but takes a lot of time (after 15min Processing algorithm still on 0%).

4) Raster -> Conversion -> Translate -> Save as ASCII grided XYZ. Then Layer -> Add Layer -> Add Delimited Text Layer :

     File name : the created file : xyz file
     File format : Custom delimiters : Tab & Space
     Record option : Unchecked the "First record has field names"
     Geometry definition : Point coordinates : X field = field_1 ; Y field = field_2.

Layer appears in the Layers Panel (contains 40 millions points).

Does anyone have a solution?

  • But, why you want to convert to points ?! – WKT Jun 15 '16 at 10:07
  • Because I need to target special areas in the country that would respect several conditions. – Janita Jun 15 '16 at 10:14
  • Just asking because it is possible to use rasters in many ways without export to vector. – WKT Jun 15 '16 at 10:31
  • It might help to cut the raster into smaller parts, convert them and merge the points in the end, but it will take long anyway and all ongoing calculations will take long as well when you go for the vector datatype. Some tools also have problems with large datasets. By the way: What output file-type you used for the ones where it did not work? Shape for example has a max size of 2gb for the single files. – Matte Jun 15 '16 at 11:25
  • You can try GDAL from command line gdal_translate -of XYZ -src 0 0 1000 1000 input.tif output.xyz. That command starts reading from the top-left corner (0 0) and converts a 1000x1000 pixel sized sample for you and it should be pretty fast. You can increase and slide the data window as you wish and use -projwin instead of -src if that suits you better. – user30184 Jun 15 '16 at 11:51
1

I don't know if there is a similar tool in QGIS, but in ArcGIS there is a function called Extract to Points (under Spatial Analyst Tools - Extraction). I have been using this with big datasets, and it works. However, you would have to define the points initially that you want to extract the data too.

If you wish to lower the resolution, you could use a tool similar to geospatial statistics first.

I know this isn't directly applicable to QGIS, but someone might know if there is an equivalent in QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.