ArcGIS 10.0/10.1 – arcpy – automate projection tool with different datum or projection – www.scriptscoop.net

I am getting stuck with a task that is slightly different from the posts I found so far on this same website. Problem: I would like to automate a python script (using arcGIS 10.1 but 10.0 is fine as well) that projects a list of vector layers (some of which with different coordinate systems) to a common coordinate system, given by a target vector layer. The main issue I would need help with is how to automate something this: 3) if it's the same datum, then project the current layer to the target layer without any datum transformation 4) if, instead, they do not have the same datum, pick a pre-defined transformation and include that in the projection function with projected coordinate system, you have access to the GCS object which is where the datum info lives. if you're working with a GCS object already, just access the relevant datum properties (datumName, datumCode) directly. The ListTransformation's extent is optional but you could pass in you data's extent for best transformation. This is the same functionality used in gp's Project tool (to pick default transformation) as well as map's data frame. Documentation link There should be no special steps. Although, you should keep in mind that if other people are working with the same mxd and do not have 10.1 they will not be able to open it. In that case, you should 'save a copy as...' a 10.0 document. You're going to need to wrap the whole script in the try:...except SystemExit clause. I fixed that in 10.1, but for 10 you're stuck doing that. Sorry. Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: April 22, 2016 @ 10:10 pm