1

I've tried several ways to create a string and use it in the line:

inproj = Proj(init="epsg:2276",preserve_units=True)

I'd like it to do something like this:

epsg_in = 2276
code = '"epsg:' + epsg_in + '"'
inproj = Proj(init=code,preserve_units=True)

but I've tried this and several other variations. No luck.

I've wrote a program to convert data, but would like to have it GUI driven so a non-computer savvy co-worker can use it. To do this, I must be able to pass the state plane epsg code to the inproj.

MackM
  • 2,906
  • 5
  • 31
  • 45
  • Hello GIS_tex_joe, and welcome to the site. I tried to tidy your question up a little, feel free to edit it again if you aren't happy with it. – MackM Mar 10 '17 at 21:33

1 Answers1

0

The code is not creating a formatted string that will result in a string with "epsg:2276". Change this line to one of the following and it should work.

code = 'epsg:' + str(epsg_in)

or

code = 'epsg:%s' % epsg_in

or

code = 'epsg:{}'.format(epsg_in)