Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from arcgis.gis import GIS
from arcgis.features import SpatialDataFrame
from arcgis.raster import ImageryLayer
from arcgis.geometry import Polygon
from arcgis.geometry import Geometry
import sys
import json
import arcgis_config
# type of coordinate referrence system
crs_id = 3857
gis = GIS("https://www.arcgis.com", arcgis_config.username, arcgis_config.password)
shp_file = 'raw/bottom_part.shp'
building_data = SpatialDataFrame.from_featureclass(shp_file)
# print(type(building_data.geometry))
# print(df.dtypes)
# print(df.shape)
# naip = gis.content.search('Views', 'Imagery Layer', outside_org=True)
naip = gis.content.get('3f8d2d3828f24c00ae279db4af26d566')
# for layer in naip.layers:
# print(layer)
naip_image_layer = naip.layers[0]
# naip_image_layer = apply(naip_image_layer, 'FalseColorComposite')
# print(naip_image_layer.extent)
# redefine occupancy type to be residential(1) and non-residential(2)
with open('residential_occupancy_types.json', 'r') as f:
res_types = json.load(f)
def insert_new_results(selected_auth_fl, selected_res_fl, authoritative_fc, schema):
selected_auth_sdf = SpatialDataFrame.from_featureclass(selected_auth_fl)
print(selected_auth_sdf)
selected_res_sdf = SpatialDataFrame.from_featureclass(selected_res_fl)
print(selected_res_sdf)
fields = field_schema.get(schema)
#for f in fields:
# print(f)
# Write this function
dtypes = dts.get(schema)
fields = field_schema.get(schema)
for idx, sel_auth_row in enumerate(selected_auth_sdf.iterrows()):
geom = sel_auth_row[1].SHAPE.buffer(-.01)
#print(geom)
def insert_new_results(selected_auth_fl, selected_res_fl, authoritative_fc, schema):
selected_auth_sdf = SpatialDataFrame.from_featureclass(selected_auth_fl)
print(selected_auth_sdf)
selected_res_sdf = SpatialDataFrame.from_featureclass(selected_res_fl)
print(selected_res_sdf)
fields = field_schema.get(schema)
#for f in fields:
# print(f)
# Write this function
dtypes = dts.get(schema)
fields = field_schema.get(schema)
for idx, sel_auth_row in enumerate(selected_auth_sdf.iterrows()):
geom = sel_auth_row[1].SHAPE.buffer(-.01)
#print(geom)
#oid = sel_auth_row[1].OBJECTID