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.

Having created a tool as a macro for several geoprocessing tasks, I'm saving user input to application settings so the user doesn't have to enter all required data on each use. I'm stuck on saving the spatial reference.

ESRI code shows using the FactoryCode and an enumeration to create either a projected or a geometry spatial reference. What I'm trying to figure out is how to get the enumeration, and how to identify whether the factorycode/enumeration points to a projected or geometry spatial reference.

I will greatly appreciate any answers/directions provided.

share|improve this question
    
That should be handled by the environment settings. –  Brad Nesom May 10 '11 at 15:19
1  
I'm weak on the programming side, so I don't feel I can treat this as an answer. You can use the factorycode (aka well-known ID/WKID) directly. You don't need the enumeration/macro. You can't directly check the factorycode. You would have to check the coordinate system object itself using TypeOf, for instance. You can also store the well-known text (WKT). This doesn't store the rest of the spatial reference info (min xy, resolution, and tolerance values). –  mkennedy May 10 '11 at 22:00
    
In the Settings.settings file, create a record to store your custom object and make it any type (string, int). Then open the Settigns.Designer.cs file, find the statement for the record you just made and change the type to whatever object type you wish, including any user-defined type referenced in you project. The setting can now be referenced and updated programmatically. –  Luther Quinn May 11 '11 at 16:20
add comment

1 Answer

In the Settings.settings file, create a record to store your custom object and make it any type (string, int). Then open the Settigns.Designer.cs file, find the statement for the record you just made and change the type to whatever object type you wish, including any user-defined type referenced in you project. The setting can now be referenced and updated programmatically.

share|improve this answer
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.