Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Apologies if this is easy but I cannot seem to find the answer. Is there a way to convert a graphic to feature, i.e. use the "Convert Graphics to Feature" tool on the toolbar, within an script?

I need to use a graphic as a selectbylayer feature, so either converting it or using the graphic directly would be nice.

share|improve this question

There appears to be no SelectLayerByGraphic tool equivalent to SelectLayerByLocation so I think you are correct to seek an alternative approach.

There also appears to be no "ConvertGraphicToFeature" tool.

I looked for whether you could access a graphic drawn in Data View from Python but GRAPHIC_ELEMENTs appear to be available for resizing and repositioning only.

If what you are looking for is a way to feed a "graphic" drawn by the end user into a Python script tool then the alternative you may wish to use is to request the user to draw the "graphic" by using a Feature Set as a parameter.

share|improve this answer

Select all graphics you want to convert to shape. On the Drawing toolbar, choose "Convert Graphics to Features". Fill in the appropiate fields in the pop-up window and you're good to go.

share|improve this answer
Welcome to GIS Stack Exchange :) and thank you for your contribution. However the OP is asking how to do this from a script, not interactively. In your defence I see that's not clear; I'll update the Q. – matt wilkie Nov 2 '15 at 16:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.