No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Need help with the following code, The error comes at line 20. import ogr import os, shutil,sys import osr regionShp = "ne_50m_geography_regions_polys.shp" regionFile = ogr.Open(regionShp) regionLayer = regionFile.GetLayer(0) spatRef = regionLayer.GetSpatialRef() countryShp = "ne_50m_admin_0_countries.shp" countryFile = ogr.Open(countryShp) countryLayer = countryFile.GetLayer(0) dstDir = "spatial_analysis_2" if os.path.exists(dstDef): shutil.rmtree(dstDir) os.mddir(dstDir) dstPath = os.path.join(dstDir, … | |
Trying to write a code that finds out if a random latitude is north of a list of cities. I have the latitudes of the cities as was thinking to use them as the random latitudes. I know this code is wrong, it was the way I could get it … | |
#import libraries import random # #create empty list places = [] i = 0 # open file handle myfile = open ('places.csv') # Subsquentially read lines for line in myfile: row = line.strip().split(',') # first line of test if if i == 0: fields = row i = 1 else … |