Solimyr,<br><br>For shapefiles just copying and renaming the .prj file might be enough. Extents can be computed and stored using the ogr2ogr utility.<br><br>If copying the .prj file didn&#39;t work, you can use the -s_srs option in the ogr2ogr utility. You can get the SRS WKT from the ogrinfo output.<br>
<br>Of course, you can do this programatically using OGRDataSource::CopyLayer() method. The spatial reference has to be set to each layer in a datasource. There is no GeoTransform. You can force calculation of extent using OGRLayer::GetExtent() method.<br>
<br><a href="http://www.gdal.org/ogr_utilities.html">http://www.gdal.org/ogr_utilities.html</a><br><a href="http://www.gdal.org/ogr/ogr_arch.html">http://www.gdal.org/ogr/ogr_arch.html</a><br><a href="http://www.gdal.org/ogr/annotated.html">http://www.gdal.org/ogr/annotated.html</a><br>
<br><br><div class="gmail_quote">On Fri, Jul 8, 2011 at 3:48 PM, Solimyr <span dir="ltr">&lt;<a href="mailto:giannicristian@msn.com">giannicristian@msn.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi guys,<br>
I have two shapefile with same features but one miss the extent and the<br>
projection. What I want to do is copy the extent and the projection from the<br>
first and set to the second. I did something  similar with two images using<br>
these step:<br>
<br>
inputimg = gdal.Open(str(fileName), GA_ReadOnly)<br>
gdalformat= inputimg.GetDriver().ShortName<br>
geoinput = inputimg.GetGeoTransform()<br>
projinput= inputimg.GetProjection()<br>
..<br>
outimg = gdal.Open(str(result), GA_Update)<br>
outimg.SetProjection(projinput)<br>
outimg.SetGeoTransform(geoinput)<br>
<br>
<br>
Do you know if there is something similar to this but for shapefile? Do you<br>
have any suggests?<br>
thx<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Change-the-spatial-reference-of-a-shapeile-tp6561998p6561998.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/Change-the-spatial-reference-of-a-shapeile-tp6561998p6561998.html</a><br>

Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>