Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a arc toolbox which converts JSON txt file to a shapefile but we have to define the projection.

How can I hard code the defined projection so that user don't have to input the projection ?

I need to define projection parameter to web mercator and to add a function to reproject the shapefile to NAD 83 UTM.

I am editing in Python.

share|improve this question
    
How do I put the code in here? –  mridul May 22 '12 at 15:33
add comment

1 Answer 1

you can use Define Projection (Data Management) here...

This tool overwrites the coordinate system information (map projection and datum) stored with a dataset.


Syntax

DefineProjection_management (in_dataset, coor_system)

Example Code:

# Name: DefineProjection.py 
# Description: Records the coordinate system information for the specified input
dataset or feature class
# Author: ESRI

# import system modules
import arcpy

# set workspace environment
arcpy.env.workspace = "C:/data"

# set local variables
inDataset = "forest.shp"
coordinateSystem = "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',
                   SPHEROID['WGS_1984',6378137.0,298.257223563]],
                   PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"

arcpy.DefineProjection_management(inDataset, coordinateSystem)

i hope it helps you...

share|improve this answer
    
Can I do it by defining Spatial reference, if so how? –  mridul May 22 '12 at 16:44
add comment

Your Answer

 
discard

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.