Skip to main content
added 175 characters in body
Source Link
zeffii
  • 39.9k
  • 9
  • 106
  • 189

In your example code there is a variable-name-typo (results in an Exception; Attribute vs Attibute, but after that's fixed there's still some things to explain.

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

shows location of the raiseerror toggle

Usually this will be enough to show the error/exception right beside the node in the nodeview.

show error in nodeview

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

In your example code there is a variable-name-typo (results in an Exception; Attribute vs Attibute, but after that's fixed there's still some things to explain.

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

shows location of the raiseerror toggle

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

In your example code there is a variable-name-typo (results in an Exception; Attribute vs Attibute, but after that's fixed there's still some things to explain.

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

shows location of the raiseerror toggle

Usually this will be enough to show the error/exception right beside the node in the nodeview.

show error in nodeview

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

added 117 characters in body
Source Link
zeffii
  • 39.9k
  • 9
  • 106
  • 189

it might just beIn your example code there is a typovariable-name-typo (results in an Exception; Attribute vs Attibute, but after that's fixed there's still some things to explain.

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

Attribute vs Attibute , IfIf you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

shows location of the raiseerror toggle

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

enter image description here

it might just be a typo

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

Attribute vs Attibute , If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

enter image description here

In your example code there is a variable-name-typo (results in an Exception; Attribute vs Attibute, but after that's fixed there's still some things to explain.

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

shows location of the raiseerror toggle

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

added 547 characters in body
Source Link
zeffii
  • 39.9k
  • 9
  • 106
  • 189

it might just be a typo

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

Attribute vs Attibute , If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

enter image description here

it might just be a typo

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

Attribute vs Attibute , If you have the command prompt open or the info panel, you might be able to see the nature of the error.

it might just be a typo

"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np


gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

Attribute vs Attibute , If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like

[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like

gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

enter image description here

Source Link
zeffii
  • 39.9k
  • 9
  • 106
  • 189
Loading