Shifting Polyline Feature Class

673
8
02-11-2014 12:58 AM
anTonialcaraz
Occasional Contributor II
Hi,

I need to horizontally shift a Polyline feature class (clip1diss) (just one raw) 360 degrees East (deltaX = 360).

It would be the equivalent as to "Move" in an Edit session in ArcMap but I cannot quite find the appropriate Python code to perform the same operation. Running 10.0

Any help would be greatly appreciate it.

Many thanks
Tags (2)
0 Kudos
8 Replies
NeilAyres
MVP Alum
You can do this by manipulating the "SHAPE@XY" token as detailed on the ArcPy Café page.
http://arcpy.wordpress.com/page/2/
Look down the page for "Shift Features".
I used it on a quickly digitized polyline. I shifted the copy Polyline2.
Then added in the line midpoint to show that the data is different.
But why increment a geographic dataset by 360º. This just brings you back to where you started.
Expect ArcMap to have some difficulty with geographic coords with Longs that are <-180 or >+180, ditto the Lats (-90 to +90).

Cheers,
Neil
0 Kudos
anTonialcaraz
Occasional Contributor II
Thank you for your reply Neil.

I had seen that post in the ArcPy Café page already. I think that is meant for 10.1
It doesn't work for 10.0

The reason I need to shift 360 is to make the world "wider" (see image of the feature layer to be shifted East; in fact I need to shift one part +360 (East) and another -360 (West)) as a previous step to run Euclidean Distance so I can get a continuous raster layer instead of having a sharp end where both edges meat. The result is then clipped to the appropriate extent.

As I said, it is easy enough to use the Move functionality within an edit session but I need to include this process as a part of a larger python script.

[ATTACH=CONFIG]31308[/ATTACH]

In the image, the Feature layer in red needs to be shifted 360 East and the feature layer in blue 360 West


Cheers
0 Kudos
NeilAyres
MVP Alum
Ah, I think the da module only came in at 10.1
I think that the only way you will achieve this is to cycle through each point of the polylines to update.
N
0 Kudos
KimOllivier
Occasional Contributor III
Use a custom projection with a false origin of 360 degrees.

We have just been doing shifts in NZ after major earthquakes which have all features moving different amounts over a lot of featureclasses. Too many for rubber sheeting to handle.

The solution was to create a transform grid using the NTv2 tools and run a pseudo-projection by defining a custom projection.
After the projection using transform we redefine the projection back to the original.

In your case it is easier because you don't need a transform, just a shift.

Get out a copy of the projection (from properties of a featureclass in ArcCatalog) and hit the copy_and_modify button.
Add a false origin of 360 degrees for your custom projection. Then reproject to the new projection and afterwards override the new projection by redefining it back to the original projection. Merge the two.
0 Kudos
anTonialcaraz
Occasional Contributor II
Thank you Neil anyway.

Thanks for your suggestion Kim.
I wonder if you can do that in 10.0 as I cannot find the copy_and_modify button (just modify) as well as the option of adding a false origin.

Cheers
0 Kudos
NeilAyres
MVP Alum
Kim,
The solution was to create a transform grid using the NTv2 tools and run a pseudo-projection by defining a custom projection.

What are these "NTv2 tools" and where do I find them?
Thanks in advance,
Neil
0 Kudos
KimOllivier
Occasional Contributor III
Sorry the NTv2http://en.wikipedia.org/wiki/NTv2 is National Transform version 2 developed by the Canadian mapping agency to use a grid to adjust for nonlinear distortions that a datum transform requires. It enables efficient coordinate adjustment that is fast and reliable. It has been adopted by many national agencies to upgrade coordinate systems. It was not relevant to your shift problem because you are not changing datums with a simple shift.

I described the latest way to handle projection definitions in ArcGIS that was confusing. At 10.x Esri imbedded all the text file definitions (*.prj) files into a binary dictionary. I have forgotten the magic incantation for the earlier version to create a custom projection. At the worst all you need to do is copy a .prj file and edit with a text editor that handles unix line endings (eg wordpad not notepad).

The basic idea still holds, create a custom projection with the offset you require as a false origin.
0 Kudos
NeilAyres
MVP Alum
Sorry Kim,
I know exactly what NTv2 and datum transforms is about.
I thought you were referring to some method to actually create a NTv2 gsb file for your control points.
Or some other method to handle this.
The only way now is some pretty deep C stuff.

Thanks anyway,
Neil
0 Kudos