working on shapefiles in ArcGIS for creating buffering on multiple shapefiles

50 Views Asked by At

I am working on multiple shapefiles at once and I want to shift the shapefiles in a particular direction by 15m at the same time keeping the original shapefile on place. Kindly guide me for the same.

description of my task to be done

1

I have tried through buffering, but its is not giving the desired results.

1

There are 1 best solutions below

0
MughtyWinky On

I guess, it could be solved using a custom projection. I'm not sure if you use ArcGIS Pro or ArcMap. This description works for ArcMap:

  • Use toolboxesdata managementprojections and transformationsproject and choose your dataset as input
  • As target system, copy and modify the actually defined crs and add 15 meters to false northig
  • Execute tool
  • remove the new created layer from map window, as it prevents the following step
  • Edit the new created shapefiles properties
  • Switch to xy ccordinate system and define it back to the original system

If this works for you, you could try to automate it via the model builder. (I use a german version of ArcMap, the propper english naming could differ a little bit)

Example for germany, using 1500 m shift

Moved geometries

Another option would be to use FME Workbench. It includes the offsetter and is afaik free to try for 30 days. Also it is very usefull for batch transformations.

Additional idea: solve it, using arcpy like this:

from glob import glob
import os
# Adjust paths to your needs.
# Remember to end  with /
source_dir='C:/temp/'
target_path='C:/temp/projected/'
#Add original crs definition
source_crs="PROJCS['DHDN_3_Degree_Gauss_Zone_4',GEOGCS['GCS_Deutsches_Hauptdreiecksnetz',DATUM['D_Deutsches_Hauptdreiecksnetz',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Gauss_Kruger'],PARAMETER['False_Easting',4500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',12.0],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]"
#Add offset to crs definition
target_crs="PROJCS['DHDN_3_Degree_Gauss_Zone_4',GEOGCS['GCS_Deutsches_Hauptdreiecksnetz',DATUM['D_Deutsches_Hauptdreiecksnetz',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Gauss_Kruger'],PARAMETER['False_Easting',4500000.0],PARAMETER['False_Northing',15000.0],PARAMETER['Central_Meridian',12.0],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]"


#no user serviceable parts inside ;-)
files = glob(source_dir + '*.shp')
arcpy.env.addOutputsToMap = 0
for in_file in files:
    print("processing " + in_file)
    out_file = target_path+os.path.basename(in_file) 
    arcpy.Project_management(
        in_dataset=in_file, 
        out_dataset=out_file, 
        out_coor_system=target_crs,
        transform_method="",
        in_coor_system=source_crs,
        preserve_shape="NO_PRESERVE_SHAPE",
        max_deviation="",
        vertical="NO_VERTICAL")
    arcpy.DefineProjection_management(in_dataset=out_file, coor_system=source_crs)