Working in lat long. I'm doing a bit of code to get the bottom-left coord of a raster and then put a point in a shapefile at that location, however it appears that the lat/long coords are rounded to 3 decimal places when the shapefile is created - in the instance that I'm testing this means the point in the shapefile is offset by approx 2m which isn't good enough. How can I prevent this rounding (it looks like I really want 13dp).
Here's my little bit of code:
#get coords
RasterLeft = arcpy.GetRasterProperties_management(myraster, "LEFT").getOutput(0)
RasterBottom = arcpy.GetRasterProperties_management(myraster, "BOTTOM").getOutput(0)
#create geometry
point = arcpy.Point()
point.X = RasterLeft
point.Y = RasterBottom
pointGeometry = arcpy.PointGeometry(point)
#copy geometry into shapefile
arcpy.CopyFeatures_management(pointGeometry, "test.shp")
Solved! Go to Solution.
Appending existing data won't fix the issue if it exists, it occurs at the time of creation
Could you try to give it a spatial reference as well, there have been issues with single precision values being used for geometry if a SR isn't specified This may not be the case...but
Waaait a minute - this (probably) isn't a rounding issue at all - (I tried Append to put my point into an existing shapefile that has an SR and I get the same geometry)
my input numbers after the decimal point are:
RasterLeft: .36184......
RasterBottom: .694507.....
whereas the geometry is created at:
x: .36181........
y: .694519......
any ideas?
Appending existing data won't fix the issue if it exists, it occurs at the time of creation