Skip to main content
Bumped by Community user
Bumped by Community user
grammatical error fixed and formatting improved.
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Extract raster values to .csvCSV in pythonPython

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), QGIS and ArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector but keep getting the following:

ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault

I have seen a method to extract to a .csv using r, however, I would prefer for this to be done within pythonPython. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)

Extract raster values to .csv in python

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), QGIS and ArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector but keep getting the following:

ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault

I have seen a method to extract to a .csv using r, however, I would prefer for this to be done within python. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)

Extract raster values to CSV in Python

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), QGIS and ArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector but keep getting the following:

ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault

I have seen a method to extract to a .csv using r, however, I would prefer for this to be done within Python. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)
grammatical error fixed and formatting improved.
Source Link

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), QGIS and ArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector, but keep getting the following:

"ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault"

ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault

I have seen a method to extract to a .csv using r, however, I would prefer for this to be done within python as I am more familiar with it. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), QGIS and ArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector, but keep getting the following:

"ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault"

I have seen a method to extract to a .csv using r, however I would prefer for this to be done within python as I am more familiar with it. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), QGIS and ArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector but keep getting the following:

ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault

I have seen a method to extract to a .csv using r, however, I would prefer for this to be done within python. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)
naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), qgisQGIS and arcmapsArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector, but keep getting the following:

"ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault"

I have seen a method to extract to a .csv using r, however I would prefer for this to be done within python as I am more familiar with it. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), qgis and arcmaps crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector, but keep getting the following:

"ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault"

I have seen a method to extract to a .csv using r, however I would prefer for this to be done within python as I am more familiar with it. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)

Attempting to gather MODIS aerosol data for a number of different AERONET stations in the UK to plot against one another. However, due to the number of files (upwards of 2000), QGIS and ArcMap crash.

I have attempted to find a solution within RSGISLib, whereby I extract a raster to .csv via a defined vector, but keep getting the following:

"ERROR 1: Attempt to read shape with feature id (1) out of available range. Segmentation fault"

I have seen a method to extract to a .csv using r, however I would prefer for this to be done within python as I am more familiar with it. Is there a way?

import rsgislib
from rsgislib import zonalstats
import glob

inputimage = '/home/student/Desktop/Ben_Folder/Test2/test.kea'
inputvector = '/home/student/Desktop/Ben_Folder/AERONET_POINTS/Chilbolton.shp'
outputtxt = 'test.csv'
useBandNames = False
zonalstats.pointValue2TXT(inputimage, inputvector, outputtxt, useBandNames)
Source Link
Loading