Create feature layer from geometry

783
0
10-24-2018 11:38 PM
HugoBouckaert1
New Contributor III

Hi 

I looked extensively in this forum but I cannot get to decipher the answer. If I create a polygon (this is from an example in here) and want to make that into a feature layer, how can this be done? This would be useful for me to do. So, say I create a polygon from bufferin an initial point:

import arcpy,json 

x = 116.6735507

y = -31.28888386

point = arcpy.Point(float(x),float(y))

sr = arcpy.SpatialReference(3857)

ptGeometry = arcpy.PointGeometry(point,sr)

length = 1

buff_geometry = ptGeometry.buffer(length)

densify = buff_geometry.densify('DISTANCE',1,1)

shape = densify.JSON

newshape = json.loads(shape)

So now i have a "newshape" polygon geometry object. I cannot seem to display this as a visual item in jupyter, but moreover, I cannot find a way to save this permanently as a feature layer. I think you have to create a feature layer collection first and I looked at the arcgis.gis api but could not find anything that would do this. Any ideas on how to save a polygon (or point or line feature) created this way as a feature layer?

And once I have created the layer, how would I add additional polygons to it? 

Thanks 

Hugo 

0 Replies