Skip to main content
19 events
when toggle format what by license comment
Dec 7, 2017 at 23:31 history edited PolyGeo CC BY-SA 3.0
deleted 18 characters in body
Apr 13, 2014 at 0:04 history edited PolyGeo
edited tags
Feb 14, 2013 at 5:39 vote accept MierMoto
Feb 13, 2013 at 4:58 comment added blah238 So there might be a bug with SelectLayerByLocation with PointGeometry objects. I found that it was necessary to supply a search distance for it to select intersecting polygons. You can supply a fixed amount such as "50 Feet" (or whatever units you want), or use the getSearchDistanceInches() function my linked answer.
Feb 13, 2013 at 4:36 comment added MierMoto let us continue this discussion in chat
Feb 13, 2013 at 4:35 comment added blah238 I don't know why that wouldn't work unless pointGeom doesn't actually intersect anything in unit_layer. Perhaps you need to just refresh the view?
Feb 13, 2013 at 4:30 comment added MierMoto In the Python window (ArcMap) I've used the following, after creating the geometry in pointGeom: arcpy.MakeFeatureLayer_management("nsw_map_units","unit_layer") where nsw_map_units comes from the TOC. I then use that to run arcpy.SelectLayerByLocation_management('unit_layer',"INTERSECT",pointGeom,"#","ADD_TO_SELECTION") , but I get no selection. I've even tried to physically create a point layer.
Feb 13, 2013 at 4:21 comment added MierMoto fc is set from a combo box selection. So I've made that global. ELAtemplate is a shapefile here, but I've tried running this in the Python window as a layer, shapefile or dragged from the TOC and none of them work.
Feb 13, 2013 at 4:14 comment added blah238 Where is fc set? It's not set to anything but an empty string in this code. Also the input to SelectLayerByLocation must be a reference to a Layer object or the name of a feature layer in the current map document. ELAtemplate is a string pointing to a shapefile.
Feb 13, 2013 at 3:59 history edited MierMoto CC BY-SA 3.0
added 891 characters in body
Feb 13, 2013 at 2:29 comment added blah238 Post the complete code, not just a snippet. Also to easily format the code correctly, select it in the question body editor and hit Ctrl-K.
Feb 13, 2013 at 1:51 history edited MierMoto CC BY-SA 3.0
Add current code
Feb 1, 2013 at 7:03 history tweeted twitter.com/#!/StackGIS/status/297238734095675393
Feb 1, 2013 at 5:44 history edited blah238
edited tags
Feb 1, 2013 at 4:39 answer added blah238 timeline score: 4
Feb 1, 2013 at 4:23 history edited PolyGeo
edited tags
Feb 1, 2013 at 4:22 answer added PolyGeo timeline score: 1
Feb 1, 2013 at 4:02 review First posts
Feb 1, 2013 at 4:07
Feb 1, 2013 at 3:42 history asked MierMoto CC BY-SA 3.0