Hi Mustafa,<div><br></div><div>To my knowledge (which is limited) OL doesn&#39;t do this natively, from my limited reading on the subject  the easiest way to do this e probably going to be to use a python script  on the server-side. You should look into the python shp file library <a href="http://code.google.com/p/pyshp/">http://code.google.com/p/pyshp/</a>. Doing this manually would be kind of complicated, because as you probably know, the shp file format is actually a collection of files (shp, shx, dbf, prj). I attach a sample python script below, but it&#39;s up to you to tailor it to your needs. </div>
<div>My best guess is that the process would look like this:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><u>Client-Side:</u></div></blockquote>
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>1) select geometry pass it to server-side script with projection/attribute info</div>
</blockquote></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><u>Server-side: process CS data pass it to python script</u></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>2) produce shp file </div></blockquote></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>3) save it to storage location on the server</div></blockquote></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div><u>Client-Side Again</u></div></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>3) ??? (joke!)</div><div>4) prompt user to DL zipped shp file</div></blockquote></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>5) Desktop-happiness (profit)</div></blockquote></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><br></div></blockquote><div>From what I&#39;ve read, the best/easiest way to do this is with a database involved, both because python will talk to the database, and it will let you organize your information for the end-user (i.e. pre-populate the attribute data as necessary). If you&#39;re using geoserver, you probably already have PostGIS and PostGRES on the backend which have some native shp file support, but I don&#39;t know enough about that to be of any practical use to you.</div>
<div><br></div><div>I hope this helps, python script is below (from the HTML5 geolocation book)</div><br><div># Include the Python Shapefile Library</div><div>import shapefile as sf</div><div># Name of the shapefile to create</div>
<div>filename = &#39;shapefiles/geolocation&#39;</div><div># Create a /point/ shapefile, and turn on autoBalance</div><div>sf_w = sf.Writer(sf.POINT)</div><div>sf_w.autoBalance = 1</div><div># Add the points</div><div>sf_w.point(-90.185278, 38.624722, 212)</div>
<div>sf_w.point(-89.788221, 38.4233, 18)</div><div>sf_w.point(-90.123129, 37.992331, 25)</div><div># Create attribute information</div><div>sf_w.field(&#39;Name&#39;, &#39;C&#39;, 20)</div><div>sf_w.field(&#39;Description&#39;, &#39;C&#39;, 80)</div>
<div>sf_w.field(&#39;Timestamp&#39;, &#39;D&#39;)</div><div>sf_w.field(&#39;Accuracy&#39;, &#39;N&#39;, 4, 0)</div><div>sf_w.field(&#39;AltitudeAccuracy&#39;, &#39;N&#39;, 4, 0)</div><div>sf_w.field(&#39;Heading&#39;, &#39;N&#39;, 9, 6)</div>
<div>sf_w.field(&#39;Speed&#39;, &#39;N&#39;, 7, 4)</div><div># Add attribute information</div><div>sf_w.record(&#39;Point 000000&#39;, &#39;This is the first point collected.&#39;, \</div><div>&#39;2011-04-06T23:24:12+06:00&#39;, 20, 100, None, 0)</div>
<div>sf_w.record(&#39;Point 000001&#39;, &#39;This is the second point collected.&#39;, \</div><div>&#39;2011-04-07T00:15:37+06:00&#39;, 10, 10, 37, 15.6464)</div><div>sf_w.record(&#39;Point 000002&#39;, &#39;This is the third point collected.&#39;, \</div>
<div>&#39;2011-04-07T11:49:03+06:00&#39;, 60, 80, 147, 31.2928)</div><div># Save the file</div><div>sf_w.save(filename)</div><div># Create a projection file</div><div>prj = open(&quot;%s.prj&quot; % filename, &#39;w&#39;)</div>
<div>epsg = &#39;GEOGCS[&quot;WGS 84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,6378137, \</div><div>298.257223563]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;, \</div><div>0.0174532925199433]]&#39;</div>
<div>prj.write(epsg)</div><div><br><div class="gmail_quote">On Thu, Jul 7, 2011 at 3:37 AM, Mustafa646 <span dir="ltr">&lt;<a href="mailto:noorcs22@gmail.com">noorcs22@gmail.com</a>&gt;</span> wrote<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I have developed a web application where i am using GeoServer and Openlayers.<br>
I have displayed some Layers over Google map in a ASP.Net Web Page. I want<br>
to know is there any Method or Script available in Openlayer for downloading<br>
and saving shapefile (the shapefile which is displayed over Google map in<br>
Web page) from web interface.<br>
<br>
Actually the user wants to download the shapefile from Web interface and<br>
open it in his Dektop GIS (ArcView) system.<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Getting-downloading-shapefile-from-Openlayer-Web-page-and-saving-to-local-disk-tp6557574p6557574.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/Getting-downloading-shapefile-from-Openlayer-Web-page-and-saving-to-local-disk-tp6557574p6557574.html</a><br>

Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</font></blockquote></div><br></div>