raster clip

55 views
Skip to first unread message

magda

unread,
Feb 19, 2014, 6:21:20 AM2/19/14
to geospati...@googlegroups.com
Hello,

I am using the raster clip python script that I found at:
http://geospatialpython.com/2011/02/clip-raster-using-shapefile.html

This python script does exactly what I need to do, however teh resulting clipped raster does not seem to load in a correct spatial location.

To run it succesfully I needed to first change the following in the script:

lyr = shapef.GetLayer(shp) into

lyr = shapef.GetLayer()

as otherwise I was getting this error message:

'NoneType' object has no attribute 'GetNextFeature'

However the output clipped image is not loading in a correct spatial location (as indicated by the clip shapefile) but it loads at the upper left corner of the original input image to clip.

Please could anybody help? Much appreciated!

Thanks
Magda

Joel Lawhead

unread,
Feb 19, 2014, 7:20:53 AM2/19/14
to geospati...@googlegroups.com
Magda,

It sounds like the "y" value is flipped or is not being calculated correctly for the world file or referencing information. 
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
Joel Lawhead, PMP
E-mail: jlaw...@geospatialpython.com
Web: GeospatialPython.com
Twitter: @SpatialPython

Reply all
Reply to author
Forward
0 new messages